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

  • @chezchezchezchez
    @chezchezchezchez Месяц назад

    I have drums in my computer room! HAHA

  • @tsbob7847
    @tsbob7847 Месяц назад

    Thanks for the video. I’m new to iOS programming. ForEach wants an ordered collection so the set has to be sorted. A number of other SwiftUI things seem to be oriented around arrays. Is this the case in general for SwiftUI? Set Vs Array is insignificant in my small app but curious about SwiftUI Vs data efficiency. Does @Observable mean no longer sorting for every screen update, only if the set changes? Is there a good article on this? Thanks again.

    • @DonnyWalsdev
      @DonnyWalsdev Месяц назад

      I’d say most UI related collection work should be done with array since you don’t want things jumping around in your UI due to Set being unsorted. I don’t know of an article covering the specifics here but @Observable would mean that your UI is stable until the next screen redraw and the Set is accessed again.
      I would recommend converting to an Array so you have guaranteed stable ordering.

    • @tsbob7847
      @tsbob7847 Месяц назад

      @@DonnyWalsdev Thanks for the response. Obvious from the UI perspective - head slap. Arrays planned for “normal usage” views of item subsets but no fundamental order to the underlying items themselves so I’m starting with a set and a “management/debug” view. Lots to learn. Very different perspective from real time microcontroller systems but I’m enjoying it. I appreciate the info people like yourself, Paul Hudson, Stewart Lynch and others make freely available. They are great learning tools and benefit so many.