Post

Replies

Boosts

Views

Activity

Reply to Unable to simultaneously satisfy constraints.
there is something we, developers, can do It happens deep within the implementation of SwiftUI, so there's nothing we can do. You can find some (many?) reports about the same warning in SwiftUI, but I cannot find any definite answers to solve them. Better ignore it (or just send a feedback to Apple) unless your code causes some broken layout.
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’21
Reply to Need Assistance with sending attachments for MFMessageComposeViewController
FreshImage1, FreshImage2, and FreshImage3 refer to the types of images As far as I see your code, freshImage1, freshImage2 and freshImage3 are UIImageView, not images. I strongly recommend you not to use UIImageView as a storage of image. if any less than three photos are available when "Submit Now" is pressed, then the app crashes You are using many crash my app operators (!) , and that why your app crashes. Stop using crash my app operators.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21
Reply to Core data Array and Conforming to NSSecureCoding
Sorry, not tested, but I would write something like this, if I want to store [CNLabeledValueCNPhoneNumber] (ArrayCNLabeledValueCNPhoneNumber): class PhoneNumbersToDataTransformer: NSSecureUnarchiveFromDataTransformer { override class func allowsReverseTransformation() - Bool { return true } override class func transformedValueClass() - AnyClass { return NSArray.self //- } override class var allowedTopLevelClasses: [AnyClass] { return [CNLabeledValueCNPhoneNumber.self, NSArray.self, CNPhoneNumber.self] //- } override func transformedValue(_ value: Any?) - Any? { guard let data = value as? Data else { fatalError("Wrong data type: value must be a Data object; received \(type(of: value))") } return super.transformedValue(data) } override func reverseTransformedValue(_ value: Any?) - Any? { guard let phone = value as? [CNLabeledValueCNPhoneNumber] else { fatalError("Wrong data type. Received \(type(of: value))") } return super.reverseTransformedValue(phone) } } (In transformable attribute, the Custom Class needs to be a descendant of NSObject, in your case, it would be NSArray.) Can you try and tell us what you get?
Feb ’21
Reply to How to handle URL Image if has non English characters SwiftUI
Thanks for the explanation and showing the result. Technically, non-ASCII characters like "ö" are not allowed in URLs and needs to be escaped using percent-encoding. (Unfortunately, some browsers do this conversion automatically and hidden from users.) You can try something like this: WebImage(url: URL(string: item.image?.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "")) Or, it would be better to set already percent-encoded string to the property image.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21
Reply to Button not dismissing Onboarding Modal
When I press the button in the modal view, it prints 123 but doesn't dismiss the modal. As far as I tried, when I press the button in the modal view, it does print 123 and does dismiss the modal. (Sorry, corrected.) Maybe something hidden in your code is affecting. Better show issue reproducible code.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21
Reply to Button not dismissing Onboarding Modal
I tried your project, (You should better create a simplified project and include all the code into your post. Not many readers will go into the links.) Notification alert appears Welcome to Meetings sheet is shown below the alert Whether I choose Allow or Don't Allow Welcome to Meetings sheet gets visible I tap Get started Sheet changes to What's New to Meetings I tap Continue Sheet dismissed, and a view with navigation title My Meetings appears Quite as expected. Is there any condition to reproduce the issue? Any specific iOS versions? Need actual device?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21
Reply to Button not dismissing Onboarding Modal
I have tested your project on my iPhone 7 plus (iOS 14.3)/iPhone 12 Max (iOS 14.4), and both work as expected as I wrote in my former post. I needed to change Bundle Identifier and remove Capabilities: iCloud and Push Notification to test the app on my testing account. And I needed to Trust my testing account, each time I deleted the app. Any of such things may be affecting. So, I think your code is well, just your testing environment or something other than code may be affecting. after that, the button stopped working, if you'll believe it.  If that is an observable fact, we should think based on it. But as for now, I have no clue what's causing the issue. I recommend you, again, to create another brand-new project. Move some code from your actual project to it one by one , until you can reproduce the issue. (You may need to modify your project settings and code to make it build and run with the limited resources for each step.) That may reveal what may be affecting.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21