Post

Replies

Boosts

Views

Activity

Reply to Playground CGContext nil
Is there for playground some memory limits or etc? Not clearly documented, but there might have been. As far as I tried your code on Xcode Playground of 12.4, it showed non nil result. The issue may be fixed in 12.4, or some other things may be affecting.
Feb ’21
Reply to Schedule start of notification requests
You may register a notification with specifying the start date, no repeating. You can re-register the everyday notification when processing the date specified notification. Or you can register a next notification at each time you received a date specific notification.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21
Reply to Loop over two arrays with different length
When will the loop finish? When arrayOfItems is finished? Or a longer Array finished? Or else you want an infinite loop? In case When arrayOfItems is finished: for i in arrayOfItems.indices { let elt1 = arrayOfItems[i] let elt2 = arrayOfFive[i % arrayOfFive.count] print(elt1) print(elt2) print() } (Assuming arrayOfFive is not empty.)
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’21
Reply to Type of expression is ambiguous without more context - Error Swift
Please make a better formatting to your code, start with ``` only line and end with ``` only line. You declare the type of your first property id as ObjectIdentifier (which is rarely used), but passing an instance of UUID to it. Try changing the definition of DoseModel as follows: struct DoseModel: Identifiable { var id: UUID //- var date: String var medicine: String var units: Double //- You use `doubleValue` for `value` var value: String } By the way, what is JSON? I guess you are using an old third party framework which once was popular in ancient Swift developers. But currently, it is considered to be a ruins of old era. You should better move to Codable.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21