Post

Replies

Boosts

Views

Activity

Reply to iOS Share Extension Warning: Passing argument of non-sendable type outside of main actor-isolated context may introduce data races
I can't provide you with a full, completely working solution, but this doesn't cause any errors: class ShareViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } override func loadView() { super.loadView() if let inputItem = extensionContext!.inputItems.first as? NSExtensionItem { if let itemProvider = inputItem.attachments?.first { itemProvider.loadItem(forTypeIdentifier: UTType.url.identifier as String) { [unowned self] (item, error) in let contentView = ShareView(extensionContext: extensionContext, url: item as! URL) DispatchQueue.main.async { let hostingView = UIHostingController(rootView: contentView) hostingView.view.frame = self.view.frame self.view.addSubview(hostingView.view) } } } } } } struct ShareView: View { var extensionContext: NSExtensionContext? var url: URL var body: some View { VStack{} .task{ await extractItems() } } func extractItems() async { try await downloadAndSaveMedia(reelURL: url.absoluteString) extensionContext?.completeRequest(returningItems: []) } } In your code you get all the attachments here: if let itemProviders = (extensionContext?.inputItems.first as? NSExtensionItem)?.attachments { and you send that array of NSItemProvider to ShareView(), but you then get just the first attachment here (first line of extractItems()): guard let itemProvider = itemProviders.first else { return }, so in my code I'm just using the first attachment. The distinction is that I do all that stuff in the loadView() method rather than in ShareView(). Might work for you, might not, but I don't think you've tried this. You can probably tidy it up a little.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’25
Reply to EU distribution
You need to confirm whether you're a trader under the EU's Digital Service Act (DSA) rules. Traders are those who make any money from their apps in the EU, i.e. paid apps, or free ones with in-app purchases. If you don't make any money from your apps, then you are not a trader and can confirm that you aren't. That would be all you need to do. There should be an option in App Store Connect to confirm your status. If you are a trader, you need to provide an address, email and phone number. But please note, those details will be displayed on your App Store pages so everyone in the EU can see them.
Mar ’25
Reply to UITextView crash on iOS 18.4 beta
You should probably raise this as a bug in the usual way. It won't really get progressed if it's only posted in these Developer Forums. You need to raise each issue you find separately at https://feedbackassistant.apple.com/ You can post the FB numbers here if you want, so that others can link to them.
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’25
Reply to New emoji size is too big!
Well, thanks for popping onto the Developer Forums and sharing your rant. But, you're in the wrong place. The Developer Forums are for developers of apps for Apple's platforms to talk about, and ask for help with their code. We aren't Apple employees. We're random people from around the world. If you have a suggestion, you can raise it here: https://feedbackassistant.apple.com/ If you just want to rant, you should probably do it on one of the Mac forums.
Topic: Design SubTopic: General
Mar ’25
Reply to Ongoing Device Setup ios 18.4 beta
You wiped and restored your iPhone. When you backup an iPhone it doesn't save indexes and caches, so when you restore from a backup the iPhone has to recreate those caches and indexes. I honestly don't understand why people think a few operations on their iPhone are going to kill their battery. Just let it do what it needs to do. If you have an issue with the betas possibly using up battery, don't install the betas, especially not on your primary device. Install it on a secondary device, or not at all.
Mar ’25
Reply to Worried that I downloaded malware from a disk image
Sorry, but this is utterly irrelevant to these Developer Forums. You're in the wrong place. These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. We aren't Apple employees. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Topic: Community SubTopic: Apple Developers Tags:
Mar ’25
Reply to Family downtime crash
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks. If you feel that it's a bug, you can raise it here: https://feedbackassistant.apple.com/
Mar ’25
Reply to iOS Share Extension Warning: Passing argument of non-sendable type outside of main actor-isolated context may introduce data races
I can't provide you with a full, completely working solution, but this doesn't cause any errors: class ShareViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } override func loadView() { super.loadView() if let inputItem = extensionContext!.inputItems.first as? NSExtensionItem { if let itemProvider = inputItem.attachments?.first { itemProvider.loadItem(forTypeIdentifier: UTType.url.identifier as String) { [unowned self] (item, error) in let contentView = ShareView(extensionContext: extensionContext, url: item as! URL) DispatchQueue.main.async { let hostingView = UIHostingController(rootView: contentView) hostingView.view.frame = self.view.frame self.view.addSubview(hostingView.view) } } } } } } struct ShareView: View { var extensionContext: NSExtensionContext? var url: URL var body: some View { VStack{} .task{ await extractItems() } } func extractItems() async { try await downloadAndSaveMedia(reelURL: url.absoluteString) extensionContext?.completeRequest(returningItems: []) } } In your code you get all the attachments here: if let itemProviders = (extensionContext?.inputItems.first as? NSExtensionItem)?.attachments { and you send that array of NSItemProvider to ShareView(), but you then get just the first attachment here (first line of extractItems()): guard let itemProvider = itemProviders.first else { return }, so in my code I'm just using the first attachment. The distinction is that I do all that stuff in the loadView() method rather than in ShareView(). Might work for you, might not, but I don't think you've tried this. You can probably tidy it up a little.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to EU distribution
You need to confirm whether you're a trader under the EU's Digital Service Act (DSA) rules. Traders are those who make any money from their apps in the EU, i.e. paid apps, or free ones with in-app purchases. If you don't make any money from your apps, then you are not a trader and can confirm that you aren't. That would be all you need to do. There should be an option in App Store Connect to confirm your status. If you are a trader, you need to provide an address, email and phone number. But please note, those details will be displayed on your App Store pages so everyone in the EU can see them.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Dark mode on Apple Developer Forum
That's not gonna happen. Just raise a suggestion in the usual way, at: https://feedbackassistant.apple.com/
Replies
Boosts
Views
Activity
Mar ’25
Reply to Switching my App from UserDefaults to CoreData and CloudKit
If you're very new to coding, I don't think using AI for the entire app is the way to go. When are you going to learn anything? Do a search for how to implement SwiftData in your app (rather than CoreData). There is Apple Developer documentation that will help you with this. It also explains how to use CloudKit.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Mar ’25
Reply to UITextView crash on iOS 18.4 beta
You should probably raise this as a bug in the usual way. It won't really get progressed if it's only posted in these Developer Forums. You need to raise each issue you find separately at https://feedbackassistant.apple.com/ You can post the FB numbers here if you want, so that others can link to them.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to New emoji size is too big!
Well, thanks for popping onto the Developer Forums and sharing your rant. But, you're in the wrong place. The Developer Forums are for developers of apps for Apple's platforms to talk about, and ask for help with their code. We aren't Apple employees. We're random people from around the world. If you have a suggestion, you can raise it here: https://feedbackassistant.apple.com/ If you just want to rant, you should probably do it on one of the Mac forums.
Topic: Design SubTopic: General
Replies
Boosts
Views
Activity
Mar ’25
Reply to Selection of Xcord
Assuming you mean Xcode, you can run Xcode on a Mac but not on an iPhone. There is no Xcode app for iPhone. You can develop apps inside Xcode and deploy them to an iPhone.
Replies
Boosts
Views
Activity
Mar ’25
Reply to SwiftUI NavigationView background
Code? Let us see your code so we can figure out what is causing it, and provide you a fix.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Mar ’25
Reply to Ongoing Device Setup ios 18.4 beta
You wiped and restored your iPhone. When you backup an iPhone it doesn't save indexes and caches, so when you restore from a backup the iPhone has to recreate those caches and indexes. I honestly don't understand why people think a few operations on their iPhone are going to kill their battery. Just let it do what it needs to do. If you have an issue with the betas possibly using up battery, don't install the betas, especially not on your primary device. Install it on a secondary device, or not at all.
Replies
Boosts
Views
Activity
Mar ’25
Reply to How to let DriverKit driver auto scan the RAID when connect with the Thunderbolt
I've reported the post as "Other" - it doesn't fit spam, dup[licate, abusive etc. Let's hope an Apple employee sees this and deletes it.
Replies
Boosts
Views
Activity
Mar ’25
Reply to appstoreconnect.apple.com jump to developer.apple.com/programs
Just tried it myself, and it doesn't do that. It correctly goes to https://appstoreconnect.apple.com/access/users Maybe fire up a private browsing session and login there? Clear caches etc.?
Replies
Boosts
Views
Activity
Mar ’25
Reply to Signing in to Outlook
18.4 is in beta, right? Something has likely changed in 18.4 that Microsoft need to handle in their app. You should probably get in touch with Microsoft about this.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Still possible to use XCode for local MacOS development without a bundle identifier?
You can do most things without a Developer account, and I can't see why you would need to pay $99/year to run code locally. Can you show us where it says you have to have a bundle identifier?
Replies
Boosts
Views
Activity
Mar ’25
Reply to Worried that I downloaded malware from a disk image
Sorry, but this is utterly irrelevant to these Developer Forums. You're in the wrong place. These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. We aren't Apple employees. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Family downtime crash
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks. If you feel that it's a bug, you can raise it here: https://feedbackassistant.apple.com/
Replies
Boosts
Views
Activity
Mar ’25