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
Comment on .disabled() doesn't VISUALLY disable buttons inside ToolbarItem on iOS 26 devices
Label() works. Image() does not. Hopefully fixed soon with 26.0.1
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’25
Comment on iOS 18 beta bug: NavigationStack pushes the same view twice
Nice work! But did you really encounter performance issues with the workaround?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’25
Comment on Debug Memory Graph not work
Update: Xcode 18.4 beta 1 does not fix the issue
Replies
Boosts
Views
Activity
Apr ’25
Comment on iOS 18 beta bug: NavigationStack pushes the same view twice
Works for me, thanks a lot! I have the same setup here.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’24
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:
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
Sep ’22