Post

Replies

Boosts

Views

Activity

SwiftUI View cannot conform custom Equatable protocol in Swift 6.
In Swift 6, stricter concurrency rules can lead to challenges when making SwiftUI views conform to Equatable. Specifically, the == operator required for Equatable must be nonisolated, which means it cannot access @MainActor-isolated properties. This creates an error when trying to compare views with such properties: Error Example: struct MyView: View, Equatable { let title: String let count: Int static func ==(lhs: MyView, rhs: MyView) -> Bool { // Accessing `title` here would trigger an error due to actor isolation. return lhs.count == rhs.count } var body: some View { Text(title) } } Error Message: Main actor-isolated operator function '==' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode. Any suggestions? Thanks FB: FB15753655 (SwiftUI View cannot conform custom Equatable protocol in Swift 6.)
5
0
163
1w
App Store app size vs real one
Hello: I was checking the app size on the AppStore and seems like it is randomly different from one app to others. For example one app shows 27.6MB in the App Store and then when you download the size is 51.9 MB and 2.5MB of documents and data whereas another marks 88.8MB and then when you download the size is 86.3 MB and 2.5MB How the AppStore calculate these sizes?
2
0
344
Sep ’24
Extensions and Widget localizations
Hi community: I'm experiencing an issue in iOS 17 where the Widgets and Extensions use the local device language instead of the app language (preferred languages displayed on the app settings). This issue was reproducible in iOS 16.1, but then was solved. Now it is back on iOS 17 and iOS 17.1 In terms of code, Locale.current in the app returns the language preference selection, even you can use bundle.main.preferredlanguages and get the first one (because there's a repetition from 2 to 3 times the same value) But in whatever extension, the app's preferred language cannot be got, it always returns the system's preferred language. @eskimo, Is it a known issue? Also, Xcode 15.3 shows 0 files localized when you use the strings catalog. I appreciate any help you can provide.
2
0
729
Jun ’24
Xcode assets name conventions.
Hi community: I'm trying to replace it with drag-and-drop images in assets. I know for example that by adding a suffix @2 and @3, you can drag and drop and Xcode knows where they must be. Also, I remember that it could be possible to add a suffix like ~dark or ~light. There's no official documentation about it but I'm looking a way to drag and drop and autodetect assets per language. I've tried: image_es@fr.png image_fr@2x.png image_fr@3x.png But doesn't work. Any ideas where I can find the docs? Or can someone provide documentation about it? Thanks in advance.
0
0
467
May ’24
PDFKIT, Static Text, on MacOS
Hi community: I'm trying to create a form PDF form a script in swift on Mac First approach was trying to add a simple and static text not collapsible. But I tried multiple options. And all ends on something that is not a static text. The best approach was to create a textfield not editable with widget PDFKit, but when you go to the preview app on Mac and pass the the mouse over the field, it is highlighted in blue ... Thanks for the support.
0
0
460
Apr ’24
onOpenURL(perform:) vs application(_:open:options:)
Hi, community: I was trying to move from application(_:open:options:) (UIKit) to onOpenURL(perform:) (SwiftUI). Maybe there's something that I'm missing. In UIKit you can say to the system that you won't handle the URL then the app is not opened, but when I use onOpenURL(perform:) it is always opened. Is there any way to achieve the same behavior? Thanks in advance.
4
0
1.1k
Mar ’24
Swiftui solutions that really syncs text editor and keyboard to make a chat input box
Hi there: I was testing many different ways to sync text editor and keyboard movement, but always I obtain a delay or not exacting the same keyboard movement. How can I get it? The best way that I got is using a safe area inset, but always start later and ends before the keyboard movement. Thanks in advance. (Any solution including bridge between swiftui and UIKit will be much appreciated if the movement sync is right)
0
0
393
Mar ’24
PrivacyInfo.xcprivacy
Hello community: I have some questions about xcprivacy and third parties. I was talking to a third party owner and he told me that in PrivacyInfo.xcprivacy you only need to declare the minimum things to use the third party. For example, the third party uses the user's default value to save data about the application, but also if he has extensions, he uses it to communicate data between the application and the extension. Just declare the first one. Also, it retrieves purchase history and there's a way to use it anonymously (although in my opinion it is not the most used feature by this third party) so the data is not linked to anyone, but if you use a user identified with Apple ID, purchase history is linked to it. So if the third party only declares the minimal things that he uses, how can we know the rest of the data/api uses? Is this approach correct?
0
0
833
Mar ’24
Content Filter iOS
Hi Community: I want to know (if someone knows) why content filters are only available for: Supervised devices Apps with Screen time, but only for children. Is that make any sense while in Mac is supervision is not needed? Why adults cannot decide to use a built in content filter instead of using screen time pre-filter by them selves? Are they no conscious about what are they doing? Are there any UX question to not open this powerful tool to improve an iOS user experience guided by third parties? Thanks in advance.
2
0
517
Feb ’24