Post

Replies

Boosts

Views

Activity

Reply to Closure definition mismatch
Thanks. But fileprivate extension ContentEncryptionAlgorithm does not correspond to any base class. Nor KeyManagementAlgorithm. Did you try to get the frameworks compiled in Swift 5 (asking the developers) ? Without it you may face serious problems in the future.
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’21
Reply to NSTaggedPointerString
Could you please show the code and tell where exactly the crash occurs ? You probably passed an argument that was nil to some function which cannot accept it or apply to a nil String. Most likely when you call func replacingCharacters(in range: NSRange, with replacement: String) - String { }
Topic: UI Frameworks SubTopic: UIKit Tags:
Feb ’21
Reply to Best practice for storing repeating dates in CoreData
that is pretty straightforward (here is the logic, not the code itself) get startDate get endDate declare repeatArray : [NSDate] = [] set runningDate = startDate while runningDate = endDate { append runningDate to the repeatArray add increment to runningDate repeats 1 : add 1 repeats 2 : add 7 repeats 3 : you need to increment the month } That should be straightforward to code
Topic: App & System Services SubTopic: General Tags:
Feb ’21
Reply to Best practice for storing repeating dates in CoreData
Well, I'll make extra effort to help, but it would be much better for you to try, fail, retry and get it.You would learn much more. I did not test the code below, so there may be some points to correct. In addition, is not specifically written for SwiftUI syntax. // get startDate let repeats = 2 let startDate = Date() // Change with what you get from the picker // get endDate let endDate = Date() // Change with the second date you get from picker var repeatArray : [Date] = [] var runningDate = startDate let calendar = Calendar.current let dateComponents = calendar.dateComponents( [.calendar, .timeZone, .year, .month, .day], from: runningDate) // The repeat loop while runningDate = endDate { repeatArray.append(runningDate) // add increment to runningDate switch repeats { case 1 : runningDate = calendar.date(byAdding: .day, value: 1, to: runningDate)! // ?? endDate case 2 : runningDate = calendar.date(byAdding: .day, value: 7, to: runningDate)! case 3 : runningDate = calendar.date(byAdding: .month, value: 1, to: runningDate)! // you increment the month default: break } } Now, it is up to you to fine tune this. Wish you best. And don't forget to close the thread.
Topic: App & System Services SubTopic: General Tags:
Feb ’21
Reply to TableView relsoaddata from textField on the same viewController with TableView
You're new here, normal you have a few things to learn. To format, just select the code section and apply the tool: func addFeedbacks(message: String,taskId: String,atype: Int) { if currentUser != nil { let feed = PFObject(className: "Feedback") feed["TaskId"] = taskId feed["TaskFeedback"] = message feed["UserNameFrom"] = currentUser?.username! feed["AType"] = atype feed.saveInBackground() } } Please show saveInBackground() Maybe you could call reload() inside saveInBackground(), but I need to see what the func is to confirm.
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’21
Reply to Best practice for storing repeating dates in CoreData
To avoid the risk of infinite loop, you could adapt slightly: var stopNow = false // The repeat loop while runningDate = endDate && !stopNow { // If end == start, we have just one day repeatArray.append(runningDate) // add increment to runningDate switch repeats { case 1 : runningDate = calendar.date(byAdding: .day, value: 1, to: runningDate)! // ?? endDate case 2 : runningDate = calendar.date(byAdding: .day, value: 7, to: runningDate)! case 3 : runningDate = calendar.date(byAdding: .month, value: 1, to: runningDate)! // you increment the month default: stopNow = true } }
Topic: App & System Services SubTopic: General Tags:
Feb ’21