Post

Replies

Boosts

Views

Activity

Comment on SwiftUI's onAppear() and onDisappear() called multiple times and inconsistently on iOS 14.1
State variable does not work. it actually seems to fail a the end. by guarding against boolean state before executing code such as a print statement .onDisappear { if canExecuteOnDisappear { print("CDM onDisappear") canExecuteOnDisappear = false } } The most of the time it works. two times now I observed that the very last time this is called in succession , lets say after 2 times previously, it will print multiple times.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’23
Comment on ForEach Breaks Data Binding
This was not the solution, my view is already inside of a HStack, what did the solution to me was the ForEach not using a range. I think when you use a range, where its 0..<(some bindingvar).count) the range is not updated on struct, however the other constructor of ForEach that you used.. ForEach([Hashable]), it will update.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Comment on SwiftUI's onAppear() and onDisappear() called multiple times and inconsistently on iOS 14.1
State variable does not work. it actually seems to fail a the end. by guarding against boolean state before executing code such as a print statement .onDisappear { if canExecuteOnDisappear { print("CDM onDisappear") canExecuteOnDisappear = false } } The most of the time it works. two times now I observed that the very last time this is called in succession , lets say after 2 times previously, it will print multiple times.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on Programmatically detect if iOS app is running on a Mac.
simulator /Users/USER/Library/Developer/CoreSimulator/Devices/C065C350-8DC0-4CA5-AF63-A19D998B41DF/data/Containers/Data/Application/5A45A272-AD16-4F1C-939F-BCED22E4A7B4/Documents Mac apple silicon /Users/USER/Library/Containers/43B15322-8173-4D40-BE9A-D7539EFC41A7/Data/Documents"
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’23
Comment on Programmatically detect if iOS app is running on a Mac.
These paths are subject to change at a moments notice on iOS Id think. but Debian file directorys probably won't change for a long time. but this is a clever solution. I might consider this a hack, because reasons. like I said, im not sure if they ever change this FS tree.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’23
Comment on Generating Tokens for API requests
Thanks this is a great answer. I had no idea I had to create an identifier AND a key. this solution will also work with music kit api since they share the same JWT I believe.
Replies
Boosts
Views
Activity
Mar ’23
Comment on Xcode "Issue Navigator" shows stale errors and warnings
try the /Users/cmadd254/Desktop/Screen Shot 2023-01-30 at 16.42.19.png report navigator. it works better than that panel for me. always shows the correct error. I keep getting incorrect red errors in my IDE.
Replies
Boosts
Views
Activity
Jan ’23
Comment on Ipad UIAlertAction does not darken the surrounding color
on iPad I can accidentally click a details view navigation link while alert action sheet is present when I wanted to cancel. I dont really like that. QA logged a defect lol
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on SwiftUI Preview fail with Core Data: "Error Domain=NSCocoaErrorDomain Code=516"
thanks for the sweet code snipped. this fixed my error where previews didn't seem to be updating when our json-to-coredata database was updated, we assumed core data wasn't persisted in the swiftui previews
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Comment on can't sign into App Store
sign into iTunes first on laptop. review payment there. than it gets fixed on app https://discussions.apple.com/thread/251338775
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’22
Comment on SwiftUI Navigation link issue
Very strange how rerendering the component using @State lead to inaccurate rendering the navlink. something about mid pre-render issues or something. this fixed my problem though
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Comment on ForEach Breaks Data Binding
This was not the solution, my view is already inside of a HStack, what did the solution to me was the ForEach not using a range. I think when you use a range, where its 0..<(some bindingvar).count) the range is not updated on struct, however the other constructor of ForEach that you used.. ForEach([Hashable]), it will update.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21