Post

Replies

Boosts

Views

Activity

Comment on SwiftUI: @StateObject never deinitialized
@muratcankok Use @State properties in your view to store data for display. If it's a lot make a struct with @State, similar like a view model. Then in the view use .onAppear {...}, or .task{...} to run code to fetch your data. The business logic can be in Service classes/structs which you can inject via init() or however you like.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Comment on How load Video with New(iOS 16) PhotosPicker? loadTransferable(type:)
So when importing, it creates a copy of my video in the caches directory, then I have to make another copy of it. What if I'm importing a big video file. In line 8 of your example, do we then have 3 instances of the same video file on the hard disk wasting space (original, copy 1, copy 2)? Or is it no problem thanks to copy-on-write capabilities of the file system?
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’22