Post

Replies

Boosts

Views

Activity

Reply to What would be the best logic for updating a file periodically after an app has been released
You could use a stored lastUpdated date and compare it on each launch: @main struct SwifUIPlayGroundApp: App {     @AppStorage("lastUpdated") var lastUpdated = Date()     private var shouldUpdate: Bool {         let now = Date()         let hoursInYear = 8760         guard let hoursPassed = Calendar.current.dateComponents([.hour], from: lastUpdated, to: now).hour else { return false }         return hoursPassed >= hoursInYear     }     init() {         if shouldUpdate {             lastUpdated = Date() // Set it to now             print("Loading...")         } else {             print("No need to relaod...")         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
Reply to iOS 16 prefering to use DoH/DoT even if VPN has specified it does not support DoH/DoT in DNS Settings
Hi, did you ever manage to solve this issue? I am currently facing it too, but I can't seem to find any solution.
Replies
Boosts
Views
Activity
Jan ’23
Reply to What would be the best logic for updating a file periodically after an app has been released
You could use a stored lastUpdated date and compare it on each launch: @main struct SwifUIPlayGroundApp: App {     @AppStorage("lastUpdated") var lastUpdated = Date()     private var shouldUpdate: Bool {         let now = Date()         let hoursInYear = 8760         guard let hoursPassed = Calendar.current.dateComponents([.hour], from: lastUpdated, to: now).hour else { return false }         return hoursPassed >= hoursInYear     }     init() {         if shouldUpdate {             lastUpdated = Date() // Set it to now             print("Loading...")         } else {             print("No need to relaod...")         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to NEPacketTunnelProvider doesn't keep the DNS packets flowing on iOS
If you want to capture DNS traffic, use a DNS proxy provider. But isn't using the DNS proxy provider requires a special permission from Apple? I'm developing an SDK that will be used as by 3rd party clients. This is why I decided to go with the Packet Tunnel provider instead.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’23