SwiftUI Form w/ TextField, DatePicker, Toggle, Stepper, Link and Sections w/ Header

Поділитися
Вставка
  • Опубліковано 4 тра 2021
  • Head to squarespace.com/seanallen to save 10% off your first purchase of a website or domain using code SEANALLEN.
    In today's video I show you how to create a Form in SwiftUI. We'll build a SwiftUI View that resembles a typical account screen that you would find in an app. I populate the Form with common elements you may use like TextFields, DatePicker, Toggle, Stepper, and a Link. I also show you how to break the form into sections with section headers and way to handle some keyboard issues you may have with your Form.
    This tutorial was created in Xcode 12.5 and Swift 5.4.
    SF Symbols Video:
    • What's New in SFSymbol...
    If you like my teaching or presentation style, I've started creating my own courses:
    seanallen.teachable.com/
    Twitter:
    / seanallen_dev
    Link to my book - How I Became an iOS Developer:
    gumroad.com/l/sean-allen-origin
    Hired.com:
    hired.com/x/1n01g
    Check out my podcast, iOS Dev Discussions:
    itunes.apple.com/us/podcast/i...
    Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
    Ray Wenderlich Books:
    store.raywenderlich.com/a/208...
    Ray Wenderlich Videos:
    store.raywenderlich.com/a/208...
    Paul Hudson's Hacking With Swift:
    gumroad.com/a/762098803
    Learn Advanced Swift Here:
    gumroad.com/a/656585843
    Links to my iOS Dev Setup & iOS Dev Book Recommendations
    www.amazon.com/shop/seanallen
    #swift #softwaredeveloper #iosdeveloper
  • Наука та технологія

КОМЕНТАРІ • 85

  • @seanallen
    @seanallen  3 роки тому +4

    If you enjoy my teaching/presentation style, I started creating my own iOS development courses at seanallen.teachable.com. You can watch the first ~10% as a free preview to get a feel for them.

    • @a4advanture755
      @a4advanture755 3 роки тому

      I love it . i love your coding style because of amazing skill you have .

  • @obtusei
    @obtusei 3 роки тому +16

    SwiftUI becomes even easier after Sean's explanation...
    Thank you Sean!

    • @seanallen
      @seanallen  3 роки тому +2

      Thanks for the kind words, Abhi.

  • @shedrackejeh6542
    @shedrackejeh6542 3 роки тому +2

    Thank you Sean for all the tutorials, I don't have a Macbook yet but, I will use mac in cloud, I can't wait to play with swiftUI🚀🚀

  • @williamallen4607
    @williamallen4607 2 роки тому

    Very clear and helpful. Thanks, Sean.

  • @glennadams7047
    @glennadams7047 3 роки тому +6

    This is a great demo of where SwiftUI shines vs UIKit. Thanks Sean.

    • @seanallen
      @seanallen  3 роки тому

      Agreed. Really excited to see the improvements at WWDC this year. Hopefully we get another big step.

  • @ClintonSiegel
    @ClintonSiegel Рік тому

    Super helpful and informative!! Thank you!!

  • @karhoshe
    @karhoshe 3 роки тому +1

    Thanks for the demo, can add this to my project now. 👍🏻

  • @manoz1245
    @manoz1245 3 роки тому +1

    Man Very easy to learn.. I am doing the screen while watching your videos. Thanks alot..

  • @kibugenzaking3473
    @kibugenzaking3473 Рік тому +1

    this is really great, keep up the great work Sean Allen

  • @radfaredu644
    @radfaredu644 Рік тому

    Thank You i learned a lots of new things

  • @martinmaulhardt9852
    @martinmaulhardt9852 3 роки тому +1

    The master of IOS is you, Sean. Can’t believe I’m doing my first app thanks to you. Cheers from Argentina, my friend!

    • @seanallen
      @seanallen  3 роки тому

      Best of luck with the app, Martin!

  • @andrevdw747
    @andrevdw747 2 роки тому +1

    Great tutorial again Sean, thanks!

  • @user-yf8ns8ox5k
    @user-yf8ns8ox5k 2 роки тому

    You are the best, bro ;)

  • @andrejkling3886
    @andrejkling3886 3 роки тому +1

    Good lesson Sean... thank you

    • @seanallen
      @seanallen  3 роки тому

      Happy to help, Andrej.

  • @wocaoli2618
    @wocaoli2618 3 роки тому +1

    very nice video, thanks,is helpful for me

    • @seanallen
      @seanallen  3 роки тому

      Glad you liked it, Naicai!

  • @LaurIle
    @LaurIle 3 роки тому +8

    Hey Sean, would love to see a SpriteKit series on youtube or a new course about it. Many of us would like to dive into iOS game development and all the tutorials out there are 3-5 years old. Also great video!

    • @seanallen
      @seanallen  3 роки тому +5

      SpriteKit videos are pretty high on my to-do list. You may see those soon...

  • @elbah
    @elbah 3 роки тому +1

    Gréât vidéo , Thanks you Allen

  • @Jake-bh1hm
    @Jake-bh1hm 3 роки тому

    Sweet! Thanks

  • @rudrakshya1
    @rudrakshya1 2 роки тому +1

    Very good content. Thank you for your efforts.

    • @seanallen
      @seanallen  2 роки тому

      My pleasure

    • @rudrakshya1
      @rudrakshya1 2 роки тому

      @@seanallen Can you please make a video how to segue on button click in SwiftUI. I find it quite difficult.

  • @fadyyecob
    @fadyyecob 3 роки тому +1

    Nice video. A tip for automatically creating closures: you can just hit enter and Xcode should automatically create the closure. E.g. when creating a Button(LocalizedStringKey, () -> Void), when you click enter on () -> Void it will create the closure.

    • @seanallen
      @seanallen  3 роки тому +1

      Thanks for the tip, Fady! That always gets me.

  • @esraagamal2598
    @esraagamal2598 Рік тому

    Hey Sean, It would be great if u made a part2 video to show how to validate TextField inside a form so it shows if the content is valid like if it is a valid email or valid number of characters

  • @ssaguiar
    @ssaguiar 4 місяці тому +1

    Excellent.

    • @seanallen
      @seanallen  4 місяці тому

      Glad you liked it!

  • @faengelm
    @faengelm Рік тому +2

    Very useful.

    • @seanallen
      @seanallen  Рік тому

      Glad it was helpful, Frank.

  • @fredrigaudeau
    @fredrigaudeau 3 роки тому +2

    Nice video. Thing starts becoming tricky when we must deal with entering numbers in TextField. Could be great to have a lesson on this.

    • @seanallen
      @seanallen  3 роки тому +1

      Oh yeah, there are many variations in which you can take this form that presents all new topics to discuss. I wanted to keep this basic as a starting point for forms.

  • @a4advanture755
    @a4advanture755 3 роки тому

    super video

  • @samha1513
    @samha1513 3 роки тому +1

    Fire tuts

  • @mansapratapsingh417
    @mansapratapsingh417 3 роки тому +1

    You7good Sean. Keep doing good 👍 work 👏.

  • @danzeitman9319
    @danzeitman9319 3 роки тому +1

    Sean great video! So.. if less is more... how might you refactor this so the keyboard dismiss button only appears in the toolbar when the keyboard is actually displayed.

  • @drfalcoew8939
    @drfalcoew8939 2 роки тому

    Hi Sean, thanks for the video! Question: Do all of your videos follow the MVVM outline? I'm new to both SwiftUI and MVVM, so I'm trying to make sure I'm learning both simultaneously.

  • @argenistherose
    @argenistherose 3 роки тому

    hey man, would really like to see you post a file with the source code on it. much appreciated. keep on with the great content.

  • @michelcusson2673
    @michelcusson2673 2 роки тому

    why I don't see the file info.plist on my project . You are a great teacher. Thank you!

  • @matthewogiji6428
    @matthewogiji6428 3 роки тому

    Hi Sean Allen! Could you tell me how you capture yourself speaking on your screen while recording the screen?

  • @WilfriedJosset
    @WilfriedJosset 3 роки тому

    @seanallen amazing content like always!
    How can you go to next text field when tapping the return button?
    I had to create my own UIViewRepresentable UIKit text field for that.
    Also, the fact that we cannot decide which event should not be canceled by adding a tap gesture over it is really lacking to SwiftUI (setting a tap priority would be great). Hopefully next WWDC we will see that 🙏🏻😅

    • @w0mblemania
      @w0mblemania 3 роки тому

      Yeah, it's a complete oversight on Apple's part. Hopefully we'll see it fixed in SwiftUI 3.0 soon, but of course, that will require iOS 15.

  • @Iberousa
    @Iberousa 2 роки тому

    Hi Sean! first of all, Thank you for your Videos. I followed your steps on Xcode 13 and the very new macOS Big Sur 11.6 and neither on the preview of the Xcode nor in the simulator the keyboard pop up to use it. Any suggestions Allen, anyone?

  • @vaibhavagarwal170
    @vaibhavagarwal170 3 роки тому

    I want to design list of cards detail and after selecting any particular card want to display a textfeild inside that row. Can you please share any video for that

  • @maartenborsje
    @maartenborsje Рік тому

    How to make an edit text view? So for example you filled in this form but you want to edit it. It would be nice if the text you already wrote is there to be edited.

  • @MarvelousLXVII
    @MarvelousLXVII 3 роки тому

    Sean, can you have a blank value in the date field? You have it as a birthday but it defaults to "todays" date and if you don't know the person's bday, it will have it wrong.

  • @jwoodywoodward12
    @jwoodywoodward12 3 роки тому +1

    Great video! Just wondered if you were doing this with a firebase database, how would you save the details entered into the form? Thank you!

    • @seanallen
      @seanallen  3 роки тому

      I can't help much here as I've never used Firebase. All the apps I've worked on have had a custom built backend for them.

  • @mbarake9921
    @mbarake9921 3 роки тому

    How do you change the white background in the form. I was able to change the foreground but not the background

  • @HolographicKode
    @HolographicKode Рік тому

    Can rthe dismiss keyboard icon be added to the keyboard modal view itself? You only need to show this icon/button when the keyboard is shown.

  • @Wolckie
    @Wolckie 6 місяців тому

    Can you place the “if” from the toggle in another file so it’s showed in another view?

  • @olatunjigabriel2707
    @olatunjigabriel2707 2 роки тому

    what version of xcode and swift do you used for this tutorial

  • @techandbeauty22
    @techandbeauty22 2 роки тому

    how do you get the information put in this form sent to like a list in another view? I'm trying to create an inventory form. For example: I have 10 brown boots, 6 red heels, 2 sundresses, 3 black purses. How would I make the stepper count it and then send it to another screen that would show that information in a list style?

  • @rax7838
    @rax7838 Рік тому

    1:44 is it possible to create that 2 different textfield that in 1 group with UIKit or its just possible with SwiftUI?

  • @noobmaster3k
    @noobmaster3k 3 роки тому

    How can we archive the exact same result using swift?

  • @zanahid
    @zanahid 3 роки тому +2

    Code for the keyboard
    #if canImport(UIKit)
    extension View {
    func hideKeyboard() {
    UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
    }
    }
    #endif

  • @karljay7473
    @karljay7473 2 роки тому

    @9:30 update: the bug is still there. I'm fully updated Sep-2021 and the bug is still alive and well :D

  • @omarmehrez3363
    @omarmehrez3363 2 роки тому +1

    how can I send the input to an email by clicking on a button?

  • @nsmofficial_
    @nsmofficial_ Рік тому +1

    is there a way to save the data even after the application is closed

  • @razrbhr8888
    @razrbhr8888 3 роки тому

    Really awesome ! however i have one question i noticed that when the Datepicker is activated and i select a date on Simulator the datepicker does not dismiss unless i tap outside. Is it a default IOS Behaviour ? thanks

    • @seanallen
      @seanallen  3 роки тому

      That is the default behavior for the new datepicker in iOS 14.

  • @ivanc.5330
    @ivanc.5330 Рік тому

    What's that xcode theme?

  • @brandontyler9278
    @brandontyler9278 3 роки тому +1

    From zero programming knowledge to learning swift how long would it take? Assuming you have like an hour a day to learn?

    • @w0mblemania
      @w0mblemania 3 роки тому +1

      It's a tricky question, a bit like asking "how long until I can play the piano?".
      You could learn the C major scale in a day, but may not be able to play "Twinkle, Twinkle, Little Star" for a month. Or a year.
      You could learn to write a small, very simple app within a week. It will probably have bugs, and won't do much, but it will be a start.
      You then repeat the process, building on your skills each time, producing more advanced apps.
      In the meantime, the technology will change. Sometimes radically. e.g. SwiftUI. You will have to adapt.
      You will make any mistakes, big and small.
      Your job is to learn from those mistakes, and learn how to learn effectively.
      But there will never be a time where you don't make mistakes. Instead, you will learn how to overcome them and move on.
      Like playing the piano.
      Good luck. You can do it, if you apply yourself consistently.
      Like playing the piano.

    • @AZMerf
      @AZMerf 3 роки тому +1

      This is exactly where I am. I was a developer about 15 years ago. My plan is to spend 200 hours learning before I can evaluate how long this will take and my ability to pick it up. I am 100 hours in and not feeling confident yet. LOL

  • @muhammadsalih7133
    @muhammadsalih7133 2 роки тому

    Button - hideKeyboard doesn't work on mine for some reason :/

  • @tayamirai3400
    @tayamirai3400 Рік тому

    Hey Sean, how can i talk to you 1 to 1?

  • @prakashbist11
    @prakashbist11 3 роки тому

    Looks like "RED" is your fav colour Sean.

    • @seanallen
      @seanallen  3 роки тому +1

      It's the brand color... I don't really have a favorite color. But there are certain color combos I like, such as black/red.

  • @namelastname4077
    @namelastname4077 2 роки тому

    SwiftUi is such a p.o.s. technology. Sections especially is a nightmare to work with

  • @deanhansen9891
    @deanhansen9891 2 роки тому

    Why don't you guys ever explain what you are doing? None of this makes any sense and is impossible to follow.