Xcode Playgrounds - Prototyping UI - Swift

Поделиться
HTML-код
  • Опубликовано: 4 сен 2024
  • *SPONSOR*
    Interested in a dev bootcamp? Check out Dev Mountain
    devmountain.co...
    Herman Kayy - Dev Mountain Experience Interview:
    • How to get your first ...
    In this video we walk through how to prototype user interface elements in Swift by using Xcode Playgrounds, and discuss the benefits of doing that. Rapid iteration on designs is very powerful. This tutorial was done in Swift 4.2 and Xcode 10.
    Source Code (Xcode 10, Swift 4.2):
    www.dropbox.co...
    If you like my teaching style, I've released my first iOS dev course which is all about the take-home project job interview for iOS developers.
    Course Info - seanallen.teac...
    If you want more... Check out my podcast, iOS Dev Discussions:
    itunes.apple.c...
    Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
    Paul Hudson's Hacking With Swift:
    gumroad.com/a/...
    Learn Advanced Swift Here:
    gumroad.com/a/...
    Links to my Developer & RUclips Setup
    www.amazon.com...
    Personal Links:
    Swift News Hoodies & iPhone Case:
    teespring.com/...
    Twitter:
    / seanallen_dev
    Instagram:
    @seanallen_dev
    Patreon:
    / seanallen
    Website:
    seanallen.co
    My inbox gets flooded with questions. If you want a guaranteed response, use this link:
    earn.com/seana...

Комментарии • 89

  • @seanallen
    @seanallen  4 года назад

    Watch Next - iOS Take Home Project - Job Interview Practice - Free Preview - ruclips.net/video/MSIe2y6Fee8/видео.html

  • @w0mblemania
    @w0mblemania 5 лет назад +1

    That's a very good point about testing designs against the iPhone 5 this way.
    My practice is to design for the iPhone 5, and adapt upwards for the larger displays. I've found that it's so much harder to design for large phones and then work downwards.
    It also helps us avoid the perennial design mistake of only properly designing for the specific size of the device we own, or are comfortable with.

    • @seanallen
      @seanallen  5 лет назад

      In my opinion, this used to be the way to go. But now that the iPhone 5 size may be phased out, or at the very least is a small % of the user base, I prefer to design for the X form factor, and then adjust down. It's a bit more work, but I prefer to design for the majority, then make tweaks and compromises for the minority. I'd rather have it feel like my app was designed for the X family of iPhones.

  • @toastrecon
    @toastrecon 5 лет назад +1

    This is probably old news to most, and overkill in simple cases, but you can also add external code files to your playground. Let's say that you'd precoded some extensions to UIColor or UIView or whatever, you could put them into the playground and have access to them so you could prototype or experiment with code you'd already done. Just have to add them to the "Sources" folder. Also, "command - zero" brings up the navigator side menu, if anyone wants to use a shortcut.
    Great info, thanks Sean!

    • @seanallen
      @seanallen  5 лет назад

      Nice, didn’t know that. Thanks for sharing, David 😀

  • @user-eq1ki1ne8t
    @user-eq1ki1ne8t 5 лет назад +1

    The narrating really explains your thought process, thank you

    • @seanallen
      @seanallen  5 лет назад

      Glad you liked it, Huqiao 👍

  • @alexborges3604
    @alexborges3604 5 лет назад +6

    Amazing video, man! As a designer learning swift, it really comes in handy!

    • @seanallen
      @seanallen  5 лет назад +1

      Happy it helped, Alex 👍

  • @shivaskanthan6144
    @shivaskanthan6144 5 лет назад +1

    Kudos to you! I've been enjoying the new tutorials you are doing. It's a lot different to the tutorials out there.

    • @seanallen
      @seanallen  5 лет назад

      Happy to hear you like the new direction, Shiva 👍

  • @DesperadoAH
    @DesperadoAH 5 лет назад +1

    This will save a lot of time .. usually I create a new Xcode project to just create and test a UIView subclass but for now I will be using this .. Thank a lot Sean 👍

    • @seanallen
      @seanallen  5 лет назад

      Oh wow... this will certainly save you time then.

  • @gabrielros1
    @gabrielros1 5 лет назад +10

    If you haven't seen that video .... come on. what are you doing ?
    Made me smile :D

    • @seanallen
      @seanallen  5 лет назад +2

      Haha, glad you liked that 😀

  • @azerty1971
    @azerty1971 5 лет назад +1

    I follow your tutorials with pleasure all the way from Belgium. You do a great job and excellent documentation Sean !

    • @seanallen
      @seanallen  5 лет назад

      Thanks Bart! Glad you enjoy them 😀

  • @Eugene.Berezin
    @Eugene.Berezin 5 лет назад +1

    Awesome video man!
    I love working with the playground.
    And awesome tips on the constrains!

    • @seanallen
      @seanallen  5 лет назад

      Glad it helped, Eugene 😀

  • @Siniom_swe
    @Siniom_swe 5 лет назад

    I would really love to see a refactoring video of putting this in a subclass etc, as mentioned in 13:33. I haven't found good simple tutorials on how to do that effectively. Would be interesting to see how you do it!
    I would also like to see a video about the "Safe Area Insets", and how to use them , IF you use them, programatically.
    Thanks for the learning

  • @stabkauaiPALAMA
    @stabkauaiPALAMA 5 лет назад +2

    Recently Graduated from DevMountain!!!!!

  • @k4reemMoustafa
    @k4reemMoustafa 5 лет назад +1

    That was awesome. Never thought of prototyping on Playgrounds. Great video 👍

    • @seanallen
      @seanallen  5 лет назад

      Glad you got some value out of the video, Kareem!

  • @MpomartMedia
    @MpomartMedia 5 лет назад +1

    Great content with a smooth delivery style, well done Sean, keep up the great work. Henry

  • @arianakbari3251
    @arianakbari3251 5 лет назад

    Hello master thank you for video please talk about tableview pagination or load more thank you

  • @osmanmusse6223
    @osmanmusse6223 5 лет назад +1

    Cool video sean keep the good work up

  • @emin_ui
    @emin_ui 5 лет назад +1

    Even thought i don't like doing thing programatically, i really loved the video and i believe you are right when you said that we need to know both, no matter what feels better to us.
    It has it's "charms"....doing stuff programmatically, i might dig a bit more :)
    Tnx for sharing!

    • @seanallen
      @seanallen  5 лет назад +1

      Happy it was helpful, Emin. It’s best to know both because sometimes one method is clearly better in certain circumstances.

    • @emin_ui
      @emin_ui 5 лет назад +1

      I already tried your skeletal storyboards as a middle ground and it really makes a difference. Fast/easy and works for both worlds :)

    • @seanallen
      @seanallen  5 лет назад

      Nice!

    • @w0mblemania
      @w0mblemania 5 лет назад

      eniN, if there's one piece of advice I could give you it's this: get comfy with programmatic UI. It will help you out enormously over time. Storyboards and nibs have their place, but they also introduce many problems, particularly with navigation and application flow. And reliance on Storyboards can hinder understanding of what is really going on in an iOS app.
      Remember it's not a case of all-or-nothing. You can combine storyboards and code, but knowing how the code works is vital. Cheers.

  • @leonidasi8861
    @leonidasi8861 5 лет назад +1

    Jeez dude, keep up the great content. You're helping me a lot and based off the other comments its not just me. Do you plan on writing any books or is your focus mostly on video content?

    • @seanallen
      @seanallen  5 лет назад

      Happy to help, Leonidas! I have a lot in the works that I'll be releasing over the next few months. My first book will be out in a couple weeks (although not a terribly technical book), and I have courses planned for early 2019.

  • @JasonMitchellAZ
    @JasonMitchellAZ 5 лет назад +1

    I really need to do more of this

    • @seanallen
      @seanallen  5 лет назад

      It's pretty fun and good practice.

  • @americanyoyo2
    @americanyoyo2 5 лет назад +1

    Your tutorials are Awesome. Have you considered making a course and putting on your website. I think it may work.

    • @seanallen
      @seanallen  5 лет назад +1

      Coming early next year...

  • @rvamerongen
    @rvamerongen 5 лет назад

    Hi, nice video.Most of the time I am doing most tests, trials directly in a project. But as you show here playground is the ground to start with/from. I was thinking about the iPhone/iPad sizes, nice tip b.t.w from you. I would like to create an enum with all the iPhone sizes in there and have that enum in a separated file so that I can 'import' that file into my projects. Then with a chosen enum element with the values ( iDevice name ) and calculate what all other view elements should become. What are your suggestions to add that in a file and how to add that file in a playground project on an iPad?
    Oke, just starting with tuples and enum. I guess it could do some thing like this
    enum iDeviceType {
    case iPhone(String)
    case iPad(String)
    func screenSize(iDevice: iDeviceType)->(Int,Int){
    var myModel: (Int, Int)
    switch self {
    case .iPhone(let model):
    switch model {
    case "XR" : myModel = (width: 365, height: 512)
    case "6" : myModel = (width: 365, height: 512)
    ...
    default: myModel = (width: 365, height: 512)
    }
    case .iPad(let model):
    switch model {
    case "Air1" : myModel = (width: 365, height: 512)
    case "Air 2gen" : myModel = (width: 365, height: 512)
    ...}
    return myModel
    }
    }
    var myModel = iDeviceType.iPhone("XR").screenSize()
    print(myModel)

  • @gofudgeyourselves9024
    @gofudgeyourselves9024 5 лет назад +1

    Keep these tutorials coming

  • @JohnDoe-fe3zw
    @JohnDoe-fe3zw 5 лет назад +1

    Love this series, more please

  • @LohenYumnam
    @LohenYumnam 5 лет назад +2

    Man Awesome Video. I love this one. to be honest,​ my design process was to create a whole new project just for one ViewController prototype 😂 this is going to change now..

    • @seanallen
      @seanallen  5 лет назад +1

      Happy to hear that, Lohen 😀. Glad you found it useful.

    • @LohenYumnam
      @LohenYumnam 5 лет назад +1

      it's very very useful. Thanks, man hope to see more video like this. And I would love to see the video on refactoring the UI code that you were talking about in this video.

    • @seanallen
      @seanallen  5 лет назад +1

      I may do a part 2 that shows that.

  • @flashdjprm
    @flashdjprm 5 лет назад +3

    Thank you, Sean! Anybody know how to preview my playground prototype on real device (on my iPhone)?

    • @diegoortuondo7530
      @diegoortuondo7530 5 лет назад +1

      Yes, you can use TestFlight, an app for that specific purpose. However, you could also use the build simulators built into Xcode itself...

  • @josemiguelchouriogonzalez6096
    @josemiguelchouriogonzalez6096 5 лет назад +1

    Hi Sean, thanks for the tutorial I always wondered if I could do this, and when I saw the title of the video I was like ok you just got your answer lol. Pretty helpful brodaaaa.

    • @seanallen
      @seanallen  5 лет назад

      Happy to help, Jose. Give it a try 👍

  • @w0mblemania
    @w0mblemania 5 лет назад +1

    Another excellent video Sean, thank you.

  • @cold8655
    @cold8655 4 года назад

    Hey just wanting to try something a bit different with this and make the card view animate in from the right side would I need to change the...let ViewBottomAnchorConstraints : NSLayoutConstraints part? and if so what could I change would it be the trailing anchor?

  • @brandtarmls3303
    @brandtarmls3303 5 лет назад

    That downloaded file opens in Xcode but not as a Playground?

  • @gjermundification
    @gjermundification 5 лет назад

    14:14 on the other hand if you design for the smallest screen the others will follow.

    • @seanallen
      @seanallen  5 лет назад

      In my opinion, this used to be the way to go. But now that the iPhone 5 size may be phased out, or at the very least is a small % of the user base, I prefer to design for the X form factor, and then adjust down. It's a bit more work, but I prefer to not compromise an amazing iPhone X design, just to make it fit for the SE. I would rather do the extra work to tweak the SE, than make sacrifices on the X

    • @gjermundification
      @gjermundification 5 лет назад

      Especially for touch areas.

  • @gakkieNL
    @gakkieNL 5 лет назад +1

    Another great video! Thanks!

  • @karljay7473
    @karljay7473 5 лет назад +1

    How about giving us a rundown on the equipment you use for your podcasts? I've seen a number of people that wanted to do some tutorials and they were wondering what software/hardware to get and how to set things up. I hear that the video stuff comes free with some video games, which one do you use?

    • @seanallen
      @seanallen  5 лет назад

      For my podcasts? I have a Blue Yeti mic and record my audio using QuickTime.

  • @glennmiller394
    @glennmiller394 5 лет назад +1

    Thanks, Sean. Really helpful.

    • @seanallen
      @seanallen  5 лет назад

      God you enjoyed it, Glenn!

  • @JacksMacintosh
    @JacksMacintosh 5 лет назад +1

    That logo at the end! Why am I just seeing that now

    • @seanallen
      @seanallen  5 лет назад

      Haha, soft launch. Still tweaking it a bit, but you’ll be seeing a lot more of it soon 😎

    • @seanallen
      @seanallen  5 лет назад

      I know... I slipped up. It's forever the "ex". 😂

  • @girishadapa90
    @girishadapa90 5 лет назад +1

    Hi Sean ... NYC tute

    • @seanallen
      @seanallen  5 лет назад

      Thanks. Glad you liked it!

  • @johnnyl7818
    @johnnyl7818 5 лет назад +1

    Thanks for this amazing video!

    • @seanallen
      @seanallen  5 лет назад

      Glad you liked it, Dayday!

  • @Coinsandtokenz
    @Coinsandtokenz 4 года назад

    DOPE TUT AS ALWAYS.
    HEY SEAN, im in xcode 11 playgroud.. exploring it.. its not allowing me to run my code.. and i dont even have the assistant editor button on mine. do you know how i can fix this? please help if you can, thank you!

  • @aliakkawi4759
    @aliakkawi4759 5 лет назад +1

    Amazing tutorial, thanks a lot

    • @seanallen
      @seanallen  5 лет назад

      Happy to help, Ali 👍

  • @fadyyecob
    @fadyyecob 5 лет назад +1

    Nice video. I think computed properties (varget shortcut in Xcode) would have been nicer instead of having a separate function for each view.

    • @seanallen
      @seanallen  5 лет назад

      I’m not aware of any performance differences, so this may be just stylistic preference. I’m not a fan of having a ton of UI code in the “variables” section of my file, which is usually at the top. I like that to be minimal. I like to have a list of variables, then my view life cycle functions, and then the rest of the logic. Just my organizational preference.

    • @fadyyecob
      @fadyyecob 5 лет назад +1

      Sean Allen I think it’s the same performance wise. But I personally like to use computer properties when possible so I don’t need a separate function that can get lost in a large view controller file.

    • @seanallen
      @seanallen  5 лет назад

      I see what your saying. I do by best to keep my ViewController to around 200 lines of code, so things don’t get lost for me too often. But again, all this is stylistic preference.

  • @AndresSantibanez
    @AndresSantibanez 5 лет назад +2

    Sweet video. Amazing content. 👍

    • @seanallen
      @seanallen  5 лет назад

      Thanks Andres. I appreciate the kind words 😀

  • @MrJoeYellow
    @MrJoeYellow 5 лет назад +1

    Great tutorial!!!

    • @seanallen
      @seanallen  5 лет назад

      Thanks! Glad you liked it 👍

  • @cameronmonks1561
    @cameronmonks1561 5 лет назад +1

    Nice video. Has anyone ever told you that you looked like Timmy Howard?

    • @seanallen
      @seanallen  5 лет назад +1

      Thanks. I've gotten Bill Burr, Tyson Chandler... but this is the first Tim Howard, lol.

  • @bhargavkumar
    @bhargavkumar 5 лет назад +1

    How can i make money with ios development part time....?

    • @seanallen
      @seanallen  5 лет назад

      It’s tough, because more often than not, people are looking to hire full-time...but some development agencies will hire part time devs to help out. Or you could build your own app on the side.

    • @simrandotdev
      @simrandotdev 5 лет назад

      Start bidding for projects on Freelance or Upwork or Fiver. Initially you would have to bid low as you do not have reviews and portfolio. Once you get few projects done and get good reviews that you can start charging a little more. But it's a tough market specially with many small shitty indian companies bidding at very low prices to get the project.