Build your first iOS app with SwiftUI

1 431 Көрүүлөр 145 миӊ.
Илим жана Технология

In this livestream I'll show you how to build a complete SwiftUI app from scratch, while also teaching you the basics of Swift. Along the way I'll be answering questions that you might have, and also providing quizzes to help test your learning.
To follow along, you'll need to install Xcode from the Mac App Store. I'll be using Xcode 12.3, but any version of Xcode after 12.0 should be fine.
* You can download the finished project source code here: github.com/twostraws/Trekr
* You can get the assets used in this video from here: www.hackingwithswift.com/samples/first-swiftui-app.zip
* You can download the free SF Symbols app from Apple here: developer.apple.com/sf-symbols/
As well as helping absolute beginners learn some SwiftUI, this livestream is also taking place in aid of Julian House - a UK charity that provides support for vulnerable and at-risk individuals. These include men, women and young people experiencing homelessness, women and children escaping domestic abuse, adults with learning difficulties and people who need support after leaving prison.
You can donate to my fundraising effort here: justgiving.com/fundraising/twostraws

Жорумдар

  1. Paul Hudson
    Paul Hudson
    3 ай мурун

    If you've watched this and decided you want to continue learning SwiftUI, I have great news: I have a 100% free series of tutorials that teach you everything you need to know, including lots of videos, interactive tests, challenges, and more. It's called the 100 Days of SwiftUI, and you can find it here: www.hackingwithswift.com/100/swiftui

    1. Kicks N Foot
      Kicks N Foot
      20 күн мурун

      hello paul whats your social media account and email i need your help please.

    2. gregory allen
      gregory allen
      3 ай мурун

      Thank you so much for the videos and I gladly appreciate the knowledge. However my flags are lining up in the wrong countries. Anyway I could fix that issue?

  2. Jun Takeshita
    Jun Takeshita
    17 саат мурун

    Memorize about all of Japanese don:t like Hinomaru and Hinomaru is not really Japanese simbol. So don:t use Hinomay easy, OK?

  3. Own Branch
    Own Branch
    19 саат мурун

    Thank you for your message. We’re unavailable right now, but will respond as soon as possible. Dear Customer/Sir Own Branch Corporation has been established from September 24, 2020 as a Retail company and Upcoming Trademark (Brand) in New York State in North America. Our traditional business model is based on the accomplishment of properties in Manufactures trademark Cloths, shoes. Also, we do Retail sales and buying markets in worldwide. ownbranch.com/shop ownbranch.com/about-us ownbranch.com/contact-us facebook.com/ownbranch ownbranch.com/privacy-policy Contact: +19292639886 Email: ownbranch@yahoo.com

  4. Yogesh Bhusara
    Yogesh Bhusara
    3 күн мурун

    @video 1:04:23 How can i get location title as navigation title? **this should only happen when i scroll up location title out of the screen. Thanks for the video it's helping me a lot and i'm a designer who wants to code :D

  5. Top Clips
    Top Clips
    6 күн мурун

    Hi brother. I want to learn to build a mobile app. but I don't know which type I need to learn. iOS or android should I learn. I love iOS but I want to learn android and I need to work with iOS. can you recommend it?

  6. Rebar
    Rebar
    6 күн мурун

    #FlutterGang 🥸

  7. swoah
    swoah
    7 күн мурун

    Thank you so much for recording this - it was EXTREMELY helpful. I am taking your 100 Days of SwiftUI course and this made me motivated to get through the boring normal Swift stuff. This is gonna sound weird asl, but you're truly an inspiration to me. You appear to be a wonderful dad, a dog owner, a developer, and a teacher. Your personality is so fun to watch.

  8. sahil puri
    sahil puri
    8 күн мурун

    kgshows.info/code/rG98g3xqqbCMksw/video.html

  9. Maxymilian Burian
    Maxymilian Burian
    8 күн мурун

    One of the basics in programming print ("Hello world") Paul Hudson: HELLO DOGS HAHAHAH

  10. Sembian Cailassame
    Sembian Cailassame
    13 күн мурун

    1:34:37 is the place where i left

  11. Jalal
    Jalal
    13 күн мурун

    AMAZING SIR ...thanks for what your doing it's really outstanding

  12. Decepi Art
    Decepi Art
    13 күн мурун

    @152:10 mark (ish) I am getting a fatal error from the try due to lat/long being nil? Not sure why I am not able to build it here like you are, any sugestions? it has the ".decode" underlined, and gives this error: "

    1. Decepi Art
      Decepi Art
      13 күн мурун

      won't let me include the error :#

  13. Brother Caleb
    Brother Caleb
    18 күн мурун

    Incredible SwiftUI primer 👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽

  14. Amy Zhao
    Amy Zhao
    19 күн мурун

    this is so so so helpful for beginners, thank you Paul for the lesson!

  15. technical Tv
    technical Tv
    19 күн мурун

    kgshows.info/code/tZ6ikWSKhIuHqK4/video.html

  16. Peter A Cortiel
    Peter A Cortiel
    21 күн мурун

    The link; does not work for me

  17. Matthew Jones
    Matthew Jones
    21 күн мурун

    Bit of a long shot but if anyone has sound issues (delay/skipping/crackling), I found that when I have the simulator open, going to Simulator > File > GPU Selection > Prefer Discrete GPU & I/O > Audio Output > MacBook Pro Speakers (I'm using headphones for tutorial).... solved my issues!

  18. C D
    C D
    23 күн мурун

    How are you persisting data

  19. csgloak
    csgloak
    23 күн мурун

    The onerous oboe aesthetically appear because sister-in-law macropharmacologically dance astride a even excellent excited skill. smiling, actually detective

  20. Leondra Smith
    Leondra Smith
    23 күн мурун

    You threw me off when you started copying the files to your project. I am a beginner with no files. Trying to build from scratch. I am trying to build with no files. using your files defeats my purpose it seems.

    1. Paul Hudson
      Paul Hudson
      23 күн мурун

      I’m copying across data to use in the app, not code. If I wanted to include photos in my app, it would hardly make sense to stop coding and spend an hour walking outside with a camera. The data is just sample stuff we can work with, and you’re welcome to replace it with something else.

  21. Chandan Joarder
    Chandan Joarder
    26 күн мурун

    Wonderful session. Thank you very much for putting this tutorial together. It was awesome. I am a newbie and learned quite a lot from this tutorial. I will check out the other tutorials that you mentioned. God bless you!

  22. csgloak
    csgloak
    27 күн мурун

    The jumbled geology noticeably memorise because ophthalmologist angiographically fax like a ten plywood. materialistic, macho push

  23. Prabodh
    Prabodh
    28 күн мурун

    Really glad I stumbled upon this video. Paul is an amazing teacher and equally nice human being. Thanks.

  24. David Mancuso
    David Mancuso
    Ай мурун

    I'm getting the idea that I should not answer in the chat if I view your video quizzes live. (insert laugh emoji but then a "sigh" emoji).

  25. Gilberta Malory
    Gilberta Malory
    Ай мурун

    The high-pitched helium endoscopically enter because cheek psychophysically sparkle under a flawless wound. victorious, guarded step-daughter

  26. The Spectator
    The Spectator
    Ай мурун

    I love u bro thanks - I owe you one

  27. Dave Gaskell
    Dave Gaskell
    Ай мурун

    Brilliant, thanks Paul. This takes me back to the mid ‘90s when I fist learnt to program on Mac Quadras and Performas using Thinks Pascal, ResEdit for the GUI and the Apple QuickDraw toolbox. Thanks again, Dave.

  28. JonesJr876
    JonesJr876
    Ай мурун

    Thanks. This was great.

  29. AC40
    AC40
    Ай мурун

    Happy late Birthday btw.

  30. AC40
    AC40
    Ай мурун

    Insanely helpful for getting a general overview for a variety of different topics (@Bindings, Navigation and Tab View, etc. Really great Video, and you are really nice

  31. Demi Laming
    Demi Laming
    Ай мурун

    I keep getting a Thread Error (Fatal error: Unexpectedly found nil while unwrapping an Optional value: file Trekr/Locations.swift, line 19) It won't let me show Simulator with this error. But I'm sure I have to place the "!" there. I eventually even copied and pasted the whole code from your GIT. But unfortunately, it still won't work. Any idea's how I can solve this?

    1. Ion Șipilov
      Ion Șipilov
      Ай мурун

      The problem is in the Location file, where you determine all the JSON fields, the app try to go thought all of them and crash on the wrong name for example. Just copy all JSON fields from the source file. Should help.

  32. Jyoti Ranjan Pradhan
    Jyoti Ranjan Pradhan
    Ай мурун

    Thank Paul. It was really interesting and I learned a lot

  33. ReflectingMe
    ReflectingMe
    Ай мурун

    Wonderful stuff Paul, thank you. Wondered if you might do something in a future live stream similar to your Guess the Flags game, but in SwiftUI instead?

    1. ReflectingMe
      ReflectingMe
      Ай мурун

      @Paul Hudson Oh heck! Very sorry Paul, I have missed this. Will take a look now - thank you for getting back to me so quickly too, much appreciated.

    2. Paul Hudson
      Paul Hudson
      Ай мурун

      I already remade Guess the Flag using SwiftUI, although it wasn't a livestream. Find the articles/videos starting here: www.hackingwithswift.com/books/ios-swiftui/guess-the-flag-introduction

  34. David
    David
    Ай мурун

    “Please! Do not answer in the chat!” *a thousand answers in the chat later* “sigh"

  35. Hanny Kristian
    Hanny Kristian
    Ай мурун

    What requirements mac for being ios dev?

  36. Robertux DeClercq
    Robertux DeClercq
    Ай мурун

    top

  37. IT information
    IT information
    Ай мурун

    kgshows.info/code/vaierH-IkHp_rJE/video.html

  38. IT information
    IT information
    Ай мурун

    kgshows.info/code/vaierH-IkHp_rJE/video.html

  39. Rukmani Vinay
    Rukmani Vinay
    Ай мурун

    Thank you

  40. Марина Куленкова
    Марина Куленкова
    Ай мурун

    Paul, thank you very much! Your video and the course are very helpful!

  41. Dougie Fresh
    Dougie Fresh
    Ай мурун

    The relieved walk recurrently flash because tsunami additionaly talk upon a pointless net. guiltless, aboard sousaphone

  42. ADHYAN DUA M 04
    ADHYAN DUA M 04
    Ай мурун

    Thanks for the video!

  43. Michael Jr A Obi
    Michael Jr A Obi
    2 ай мурун

    var body: some View { List(tips, id: \.text) { tip in if tip.children != nil { Label(tip.text, systemImage: "quote.bubble") .font(.headline) } else { Text(tip.text) } } .navigationTitle("Tips") } } it is citing 'comparing non-optional value type '[Tip]' to nil always returns true.' I need help with that please. Appreciate.

  44. Michael Jr A Obi
    Michael Jr A Obi
    2 ай мурун

    Around the “if tip.children!= nil {Label(tip.text, systemImage: ....” it cited that comparing non-optional value of type [Tip] to nil always returns true.

  45. Michael Jr A Obi
    Michael Jr A Obi
    2 ай мурун

    It is working. Appreciate.

  46. Michael Jr A Obi
    Michael Jr A Obi
    2 ай мурун

    At point of adding, let location: Location, it says, ‘Cannot find Location in scope’

  47. Juan Mejia
    Juan Mejia
    2 ай мурун

    I keep getting an error code that says (below) when I try to proceed to 1:52:29.

    1. Juan Mejia
      Juan Mejia
      2 ай мурун

      swift.decodingerror.keynotfound(coding keys(stringValue: "hero picture",intValue:nil and multiple others like that... I triple checked all my code. Someone pls help :(

  48. NonYourBuz
    NonYourBuz
    2 ай мурун

    where is the "samp" file to go with this project....kinda needed....

  49. Lalit Yalamanchili
    Lalit Yalamanchili
    2 ай мурун

    This man is Amazing

  50. Ann Burgess
    Ann Burgess
    2 ай мурун

    No problem with people posting quiz answers on the chat window because you went full screen. Writing after quiz 1 - this is just what I was looking for - something to make a bridge from Swift Playgrounds to something rather more practical and useful. Very clearly put across. Thank you!

  51. Carley Burke
    Carley Burke
    2 ай мурун

    Hello, can you make a beginners video for turning website into iso app? Xcode 14.2

  52. Govar zelf
    Govar zelf
    2 ай мурун

    thank you so much for your help!

  53. Cogncierge
    Cogncierge
    2 ай мурун

    What a great human being you are Paul! Thank you.

  54. PAVUN RAJ
    PAVUN RAJ
    2 ай мурун

    awesome i loved all videos

  55. tammim haque
    tammim haque
    2 ай мурун

    fatal error: Unexpectedly found nil while unwrapping an Optional value. this error is coming from let url = Bundle.main.url(forResources: "locations" , withExtension: "json")!

    1. tammim haque
      tammim haque
      2 ай мурун

      @Paul Hudson locations.json this file is already added in my project

    2. tammim haque
      tammim haque
      2 ай мурун

      @Paul Hudson no I've downloaded it from your link

    3. Paul Hudson
      Paul Hudson
      2 ай мурун

      This means you didn't add the JSON file to your project or target.

  56. tammim haque
    tammim haque
    2 ай мурун

    hi

  57. Raoni Zanovello
    Raoni Zanovello
    2 ай мурун

    thank god I found this. so much bs and so much shit outdated out there

  58. Wyld Morris
    Wyld Morris
    2 ай мурун

    Watching from UK Sound level is fine

  59. guitarcoey
    guitarcoey
    2 ай мурун

    Love this video stream! Now I want to do almost the exact same project except that instead of using UIMapkit, I want to put a static "map" (aka a PNG) into a scrollable view and click on an area to go to a content view. Any ideas?

  60. James Hanly
    James Hanly
    2 ай мурун

    Thanks for an awesome tute! After compiling I'm getting dyld`getattrlist errors saying unable to simultaneously satisfy constraints. App works but errors persist - what have I done!?

    1. Paul Hudson
      Paul Hudson
      2 ай мурун

      You’ve done nothing wrong; that’s an internal Apple error, so nothing you need to worry about.

  61. Antonio Soto
    Antonio Soto
    2 ай мурун

    My friend displays sites in Yandex, says some raccoon global is with him like everything is done at once, maybe who knows?

  62. cookiesup2music
    cookiesup2music
    2 ай мурун

    Sound issues is (someone brought it up in stream chat) is caused by XCode 12 on Catalina... no real fix other than restarting the CoreAudiod process

  63. Sarung Mesres Chanel
    Sarung Mesres Chanel
    2 ай мурун

    I didnt hear the directives Since I was on mute and came off as a jerk after I rewatched this...but that was not my intention.

  64. pankaj sharma
    pankaj sharma
    2 ай мурун

    happy belated birthday !!

  65. Jason Chandler
    Jason Chandler
    2 ай мурун

    Did you create the json files we moved over? How did you get all the information into that format?

    1. Jason Chandler
      Jason Chandler
      2 ай мурун

      @Paul Hudson So text has to be in json before it can be placed in Xcode? Sorry, I was a little lost with the json files portion. How did they get in that format for use in the App etc.?

    2. Paul Hudson
      Paul Hudson
      2 ай мурун

      Yes; I just typed in the text by hand.

  66. Wasting Time
    Wasting Time
    2 ай мурун

    Great Stuff from a seemingly great individual. Giving to others as a present to himself.

  67. Davide Areias
    Davide Areias
    2 ай мурун

    Today i have finished all my exams soo i decided what a better thing to do than creating my own app. I heard ios app would be easier and funnyer than android, and I also have an iphone. Having a windows pc my self i took 4 hours to install mac os on a VM and then found your amazing video and watch it all, lovethe dogs and your daughter is soo cute. Soon i will create an app like Tinder, but way better and cheaper, TY.

  68. medichi SWQ
    medichi SWQ
    3 ай мурун

    Thank you for your interesting and helpful video!)) But there seems to be new Apple bug: in WorldView.swift file NavigationLink does not seem to work. I couldn't find any helpful information, so it would be just great if you'd find a moment and tell if you know anything about possible bug (mb you've met it already?) (misprints are not the option, I copied this file from your repo, project is building and running, no errors except of broken navlinks)

  69. Alej M-C
    Alej M-C
    3 ай мурун

    I’m only 30mins in, I couldn’t help but comment right away. Thanks a lot for demystifying Swift like this, the presentation skills are off charts and the way you are handling trolls is top-notch, I really really hope that those rare instances don’t take too much of your energy or deter you from continuing on in the future. Subscribed instantly, now onto resuming the tutorial : ). Reason: some months ago I started using FCPX and Motion, mostly in hobbyist experimental mode (although have already took the risk at times and use those in real things) and realized that plugins for that are made via the FxPlug API which has a Swift template and all... slowly getting to understand Swift first before getting into the rabbit hole (got a bit of a background writing shaders and mostly C# code). EDIT: ok, just finished, jeez gotta get on it and definitely spend more time on it... I still have the feeling of magic is what’s making it work still, as soon as it gets on the MapKit, MapAnnotation, Swift KeyPath, environment objects, etc I kinda lose track of how it works exactly. Would it be safe to say that Swift has a sort of built-in dependency injection support with the environment objects and a sort of query/LINQ style selectors for arrays (with the element ‘in’ syntax)? Nevertheless, mindblown, doing something like this from scratch or ‘by-hand’ would take a whole lot more than 3 hours, these APIs are crazy good in my view.

  70. Johan S
    Johan S
    3 ай мурун

    stupid ppl answering in the chat! xoxo

  71. Saneesh Antony
    Saneesh Antony
    3 ай мурун

    urlString = Bundle.main.path(forResource: song.trackName, ofType: "mp3") while I try this... error occurred ; Console:- urlstring is null and when I gave the direct audio file name instead of (song.trackName) it works.. how to solve this issue..?

  72. Alejandro Heredia
    Alejandro Heredia
    3 ай мурун

    I just love SwiftUI, so elegant and simple

  73. Joe Doe
    Joe Doe
    3 ай мурун

    I going through the Unwrap course. Does someone have the solution to: Write code that reads the “name” key. let details = [“name”: “Sophie”] ] “Unknown” details[ “name” , default: = name let I tried every combination of I could think of. I’m completely stumped. Thanks.

  74. MrPB3N
    MrPB3N
    3 ай мурун

    This has finally cleared my confusion about structs, classes, ContentViews, parameters, etc. I always conceptualized structs and classes as these crazy scary things, but your explanation of them as data structures made perfect sense. I was so confused whenever someone in a tutorial made a custom data type, but no longer! I would pay for more walk throughs like these.

    1. Vincent Adolph
      Vincent Adolph
      3 ай мурун

      Hello

  75. Nick Limo
    Nick Limo
    3 ай мурун

    Hello Paul! Thank you for the video! It is noteworthy that you made this live broadcast on your birthday)) Happy birthday! Happy New Year!

  76. hilal btn
    hilal btn
    3 ай мурун

    thank you Paul, and happy birthday :)

  77. Ron Rolle
    Ron Rolle
    3 ай мурун

    here it is, my new App 'QR Address'

  78. Евгений Перевалов
    Евгений Перевалов
    3 ай мурун

    func thanks(text: String)-> String { return "\(text) for your great work!!!"} thanks("Please take my gratitude")

  79. Shaobo Yang
    Shaobo Yang
    3 ай мурун

    Best SwiftUI tutorial ever!

  80. solutionsagent
    solutionsagent
    3 ай мурун

    Phenomenal video - I've been trying to learn Swift for a while now and your instruction was just so very clear... you've kicked open the door open for me. Thank you!

  81. Jane101
    Jane101
    3 ай мурун

    This video was really helpful, thank you!

  82. Zheng Cheng
    Zheng Cheng
    3 ай мурун

    1:09:40 ah I see, in Web development have padding and margin, but in SwiftUI there are only padding(). good to know

  83. William Allen
    William Allen
    3 ай мурун

    I think Paul is one of the best know and most respected teachers of Swift and SwiftUI in the English speaking world, as he should be. So not 'terribly underrated.'

  84. WellWellWell
    WellWellWell
    3 ай мурун

    Now put 50 views with complex layout into VStack and see amazing performance.

  85. Ivar VW
    Ivar VW
    3 ай мурун

    Released by first app and already made a few sales. Coudn't have done it without you Paul. Thanks for all your tutorials!

  86. David Agyakwa
    David Agyakwa
    3 ай мурун

    oops mistake it produced later issues ,I now see why the tabview must be at the top

  87. David Agyakwa
    David Agyakwa
    3 ай мурун

    I wrote the tabview under the Navigation view and it still works why is that

  88. Deeb Sanwa
    Deeb Sanwa
    3 ай мурун

    Sir Paul Hudson, you're an inspiration. I've been watching your tutorials for 2 years now and have learned SwiftUI solely through your videos and website. I'm stunned that you don't have any courses for sale on Udemy. You'd easily outrank the top teachers currently listed for iOS development.

  89. _r3mote
    _r3mote
    3 ай мурун

    When setting the NavigationTitle I get a LayoutConstraints warning which says: Unable to simultaneously satisfy constraints. Any suggestions?

    1. Double-Edged Swordfish
      Double-Edged Swordfish
      3 ай мурун

      Same here, have you managed to fix this?

  90. Mark Patterson
    Mark Patterson
    3 ай мурун

    Thanks for the Christmas present, Paul!

  91. Dave Baxter
    Dave Baxter
    3 ай мурун

    I don’t understand why you needed the Environment object. Wouldn’t the created variable be a global anyway or doesn’t swift work like that?

  92. Blu Yeti Inc
    Blu Yeti Inc
    3 ай мурун

    Hi Paul, after this tutorial, which videos would you recommend next. Need more practice.

  93. Apple Developer
    Apple Developer
    3 ай мурун

    Hi Paul, NavigationLink(destination: ContentView(location: locations)) This not working in Xcode12 giving compile time error and autocomplete feature not showing the same . Am I missing anyrhing ?

    1. Bryan L
      Bryan L
      3 ай мурун

      I had the same issue originally - try to copy paste the entire var:body for git.

  94. Mr.Sojek
    Mr.Sojek
    3 ай мурун

    I've always thought programmers are people who have almost no private life, much less a family.

  95. Gary Watson
    Gary Watson
    3 ай мурун

    Great tutorial and I have learnt more stuff.

  96. Daz
    Daz
    3 ай мурун

    I wonder why would someone came and dislike the video, Paul took his time to do Swift beginner a favor. We gained many knowledge from Paul's web too, big thanks to Paul.

    1. A stemets
      A stemets
      6 күн мурун

      Lucifero got big mad

  97. Vincent Pradeilles
    Vincent Pradeilles
    3 ай мурун

    Asking for a friend: which software did you use to manage your stream? OBS? And did you have issues with MacBook fans "polluting" the sound capture? 🤔

    1. StuFF mc
      StuFF mc
      3 ай мурун

      @Vincent Pradeilles It's not only the most amazing software in the world, it's made by my dearest friends the Twins Ken & Glen. They must be the nicest Mac devs on this planet :)

    2. Vincent Pradeilles
      Vincent Pradeilles
      3 ай мурун

      @Paul Hudson I didn’t know Ecamm Live! Will check it out, thanks for the answer Paul!

    3. Paul Hudson
      Paul Hudson
      3 ай мурун

      I use Ecamm Live, and have a shotgun microphone to reduce noise from my fans 👍

  98. Zheng Cheng
    Zheng Cheng
    3 ай мурун

    Thanks for the video

  99. Darren Miller
    Darren Miller
    3 ай мурун

    This is such an excellent resource for those new to coding! Clearly, your site and YT channel will prove to be key in my journey. ✌🏼🖖🏼

  100. Temo Kaxniashvili
    Temo Kaxniashvili
    3 ай мурун

    Mr. Hudson, can you please share your opinion, about why SwiftUI does not provide alternative for UISearchController and UISearchBar?