SwiftUI Tutorial: Build a Core ML app with stacks, steppers, and date pickers

  Переглядів 14,056

Paul Hudson

Paul Hudson

4 роки тому

Ready to get started with SwiftUI? In this tutorial you'll learn how to build an app that uses Core ML to recommend when users should go to bed based on how much coffee they drink, while also showing you how to use steppers, stacks, and date pickers.
Watch the UIKit version of this project: • Building a sleep app w...
Get the code for the UIKit version of this project: github.com/twostraws/SwiftOnS... - look inside "010 BetterRest" / App / BetterRest for the SleepCalculator.mlmodel file used in this tutorial.
For more information on SwiftUI, see my free online reference guide SwiftUI By Example: www.hackingwithswift.com/quic...

КОМЕНТАРІ: 27
@twostraws
@twostraws 4 роки тому
Watch next: SwiftUI Tutorial: Build a word game with List, TextField, Alert, and more - ukposts.info/have/v-deo/jJZ7a2atf3dzy6c.html Questions? Comments? Tweet me @twostraws.
@coltongenesis1517
@coltongenesis1517 2 роки тому
I realize I'm kinda off topic but does anybody know of a good site to stream newly released tv shows online ?
@alaricfinn9801
@alaricfinn9801 2 роки тому
@Colton Genesis Lately I have been using FlixZone. Just google for it :)
@aydinjoshua2097
@aydinjoshua2097 2 роки тому
@Alaric Finn Yea, I have been watching on flixzone for years myself :)
@kasonhendrix6323
@kasonhendrix6323 2 роки тому
@Alaric Finn thanks, I signed up and it seems like they got a lot of movies there :D I appreciate it !!
@aryanbryson933
@aryanbryson933 2 роки тому
@Colton Genesis Glad I could help :)
@brianbkcodes1449
@brianbkcodes1449 4 роки тому
SwiftUI is very impressive how few lines of code are needed for the date picker and two different steppers. Thanks for the tip at 6:08 for the format specifier: %g for rounding numbers in a simple readable way
@Timisenman
@Timisenman 4 роки тому
Thanks for this, and for all your other videos, Paul. I am no longer timid to experiment with CoreML after this video.
@levindixon
@levindixon 4 роки тому
Thanks for the tutorial, keep up the great work!
@shashikumar740
@shashikumar740 4 роки тому
Paul thanks for the continuous seemles efforts for making swift UI learning content. It really helped me to learn brand new framework SwiftUI. Thanks a ton👌
@mig12394
@mig12394 4 роки тому
thanks for the tutorial
@jerrick.warren
@jerrick.warren 4 роки тому
This is super great
@brooksdubois4721
@brooksdubois4721 4 роки тому
Fantastic tutorial. Love the way you move quickly. What I find hysterical is the way they spin it like it like it's revolutionary; Apple has habit of hyping things up. The truth is, Kotlin has been able to give you this flexibility for quite some time in the Java ecosphere. RxSwift+RxCocoa allows you clean bindings to UI elements. My mind thinks like 'hooray we have TornadoFx/khtml for iOS and it comes with RxCocoa'. I feel like they are perpetually slightly behind the curve. It is nice, declarative templating in UI and dynamic binding are way better than xibs, storyboards, delegates, IBActions, IBOutlets, Selectors, etc. It's just that iOS + Swift I seem to feel perpetually behind the curve. My major contentions are tooling and documentation. Admittedly, tooling is improving. Also, top notch videos like this fill in the documentation gap. Kudos to you.
@johnforde7735
@johnforde7735 4 роки тому
Nice tutorial! Just getting the layout of this right with UIKit would take so much more code, let alone handling the state of multiple inputs. Thinking about it, you could probably do away with the calculate button and auto-calculate on changing state with suitable Combine filters and debounce's to ensure you don't run the prediction when changing input. One thing: shouldn't .navigationBarTitle etc. be indented to be in line with the previous }? That feels natural to me.
@th8alm0y48
@th8alm0y48 Рік тому
Why i got errors like 1-Cannot find “SleepCalculator()” in scope 2-cannot infer contextual base in reference to member” omitted” 3- cannot infer contextual base in reference to member “shortened” ? How to fix these errors
@eypgym2979
@eypgym2979 4 роки тому
extension View { func bigText() -> some View { return ModifiedContent(content: self, modifier: BigText()) } } struct ContentView: View { @ObservedObject var dedector = BeaconManager() var body: some View { Text("Hello World") .bigText() .background(Color.gray) .edgesIgnoringSafeArea(.all) } } This is also good for custom view modifiers usage.
@37zizo
@37zizo 4 роки тому
i have 2 years to graduate and i am learning ios should i continue learning with uikit or switch to swiftui
@Shogoeu
@Shogoeu 4 роки тому
Double the amount of coffee!
@w33zel
@w33zel 4 роки тому
Hey Paul, thanks for your awesome tutorials. With this one, I have the problem that always when I put the .presentation in, I get an error at the first Text label saying "Type of expression is ambiguous without more context". Cant find out the problem. Is it because it's beta or am I doing something wrong? I'm on Mojave with Xcode Beta 🤔
@NikosAntonakakis
@NikosAntonakakis 4 роки тому
Try this: var body: some View { VStack { Text("When do you want to wake up?") .font(.headline) .lineLimit(nil) DatePicker($wakeUp, minimumDate: nil, maximumDate: nil, displayedComponents: .hourAndMinute) Text("Desired amount of sleep") .font(.headline) .lineLimit(nil) Stepper(value: $sleepAmount, in: 4...12, step: 0.25) { Text("\(sleepAmount) hours") } } }
@juniorsuarez4544
@juniorsuarez4544 4 роки тому
I get the same error did you figure it out?
@anianii
@anianii 3 роки тому
I think .presentation has been renamed to .alert
@user-iv8ci1ml4q
@user-iv8ci1ml4q 4 роки тому
Hello, could you please tell me what video recording tool do you use?
@simplywiktor
@simplywiktor 4 роки тому
He probably uses QuickTime that is pre-installed on MacOS.
@udaysurya7777
@udaysurya7777 4 роки тому
Sooooooper
Конгрес голосує за допомогу Україні. Спецефір Голосу Америки
5:43:13
Голос Америки Українською
Переглядів 443 тис.
5 Steps to Better SwiftUI Views
31:19
Paul Hudson
Переглядів 54 тис.
Create ML for Everyone
43:40
Paul Hudson
Переглядів 30 тис.
CoreML: Real Time Camera Object Detection with Machine Learning - Swift 4
26:11
Lets Build That App
Переглядів 184 тис.
24 Xcode Tips in 15 Minutes
15:30
Paul Hudson
Переглядів 72 тис.
SwiftUI - How to do Navigation in your Swift UI app
41:58
CodeWithChris
Переглядів 79 тис.
Build Anything with OpenAI Assistants, Here’s How
12:31
David Ondrej
Переглядів 10 тис.
How to use neumorphism in SwiftUI
51:08
Paul Hudson
Переглядів 39 тис.
Самая редкая видеокарта от SONY
13:51
Nitroxsenys
Переглядів 51 тис.
#smartphone #screenprotection #tech #shorts #magicjohn
1:01
MagicJohn
Переглядів 6 млн
Ошибка в калькуляторе iPhone
0:22
Romancev768
Переглядів 1 млн