iOS 13 Swift Tutorial: Understand Swift UI, Property Wrapper & More (@State & @EnvironmentObject)

Поделиться
HTML-код
  • Опубликовано: 1 ноя 2024

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

  • @jorgesegundorojas6119
    @jorgesegundorojas6119 4 года назад +1

    Dude, this tutorial it's a treasure !

  • @daLuftie
    @daLuftie 5 лет назад +9

    Just for information:
    BindableObject is changed to ObservableObject.
    ObjectBinding is now ObservedObject.

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

      Also in UserDefault.swift I had to change var value to var wrappedValue. Great Tut, thanks!

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

    so, now in iOS we have "native Rx" and "native flutter". Nice tutorial, thank you! =)

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

    Mind blown around 22:00 🤯🤯
    thank you for great example

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

    Wow! That was a lot of information! Thanks for the great tutorial!!

  • @JunaidKhan-ny8tu
    @JunaidKhan-ny8tu 5 лет назад +1

    nice and clean Explanantion

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

    This is great Brian. Can you share how you can use the environment object in multiple views. On a presentation view I’m not getting access to the environment object.

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

      That's strange. If you set the environment object at the start of a view hierarchy, all descendants are supposed to have access to that object. Possible a bug?

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

    Good video, thanks Brian.

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

    Great. Thank you, Brian. Can you also please make videos to explain another Swift feature that backed the SwiftUI implementation? Like for example: Function builder, Opaque return type

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

    Niiiice, these tutorials are great. They are binding (wink, wink) all of the frameworks together, the SwiftUI, combine etc

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

    Another amazing tutorial. Thank you so much🙏

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

    Thanks Brian

  • @АлексейПархоменко-х9ы

    I have got this problem: Property wrapper type 'UserDefault' does not contain a non-static property named 'wrappedValue'. I have got the latest version of Xcode 11 beta 7. Could you please say we how to fix it?

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

      I had this error too. Just replace 'var value' with 'var wrappedValue' :)

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

    Wow, thanks man

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

    has anyone got a link for the swift evolution proposal? i had a look but im not really sure what is it is that i am looking fior

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

    Nice Tutorial, if i will Build a todo app, should i Store the Information inside the userdefaults or is the use of Core Data better?

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

      The more complex your data structure and data model get the more you should think about using core data. Once you need relationships I would definitely use core data. If you just want to store some to do items User Defaults could do the job.

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

      Also consider just saving your data to a json file, using Codable. It's a LOT easier than using CoreData for simple-to-medium sized data sets. Use CoreData as a last resort, IMO.

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

    Nice!

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

    Greaet Tutorial ;)!

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

    @propertyWrapper
    struct UserDefault {
    let key: String
    let defaultValue:T
    var value:T {
    get{
    return UserDefaults.standard.object(forKey: key) as? T ?? defaultValue
    }
    set{
    UserDefaults.standard.set(newValue, forKey: key)
    }
    }
    }
    gives error: Property wrapper type 'UserDefault' does not contain a non-static property named 'wrappedValue'

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

    How would you use frameworks like AV Foundation with Swift UI Only? I know this framework is new and you might not know, and it is annoying for people to ask you these kind of questions when this framework literally just came out, but I just hope this makes you explore swift UI more!

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

      As to the specifics of AV Foundation, I don't know, but any UIView subclass can be used in SwiftUI (at least in theory) by using UIViewControllerRepresentable. This is a wrapper around your non-SwiftUI views, that SwiftUI can handle.

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

      @@w0mblemania Yeah I get that, but I really want to know If it is possible just using SwiftUI and nothing else,

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

      @@arinasawa2638 In that case, no. SwiftUI is extremely bare-bones (and extremely rough) at this point. Even the most common things aren't supported.

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

    How to count the number of rows after filtered by favorite?

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

      I would not count the rows but the elements in the array that are faved. You can do that with the result of the swift filter function.

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

    ⭐️

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

    Who else think they making Swift more difficult with every update. Swift 3 was comfortable for me but this getting harder and harder.

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

      That’s an interest opinion. I can definitely understand if you are confused about the declarative style of SwiftUI but what changed between Swift 3 and 5 that you feel uncomfortable with?

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

      @@BrianAdventMore closures and protocols, swift was meant to be easy to read and expressive. Actually I've watched some Apple videos and starting to like SwiftUI. Dragging from menu and Xcode automatically writes code is pretty cool.

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

    Love from india 1

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

      MUKUL BAKSHI Can you please stop commenting shit just because you want your comments to get a few likes?

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

      Vishrut Vatsa so why u have problem. I dont ask u to judge. Grow up. I dont need ur approval to comment.

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

    nope. That didn't make any sense.

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

      You'll also need to watch the WWDC videos. They are required viewing at this point.