Apple Developers

RSS for tag

This is a dedicated space for developers to connect, share ideas, collaborate, and ask questions. Introduce yourself, network with other developers, and foster a supportive community.

Learn More

Post

Replies

Boosts

Views

Activity

Is property `id` forbidden for @Model?
I'm currently working on SwiftData, and having trouble with id properties. I was constantly getting this error with my @Model. error: Row (pk = 1) for entity 'AnalyzedMessage' is missing mandatory text data for property 'id' Timestamp: 2024-05-31 14:13:24.483647+09:00 | Library: CoreData | Subsystem: com.apple.coredata | Category: error \ @Model final class AnalyzedMessage { var id: String var user: User var createdAt: Date var text: String var attachments: [Attachment] var recording: Recording? var replyMessage: ReplyMessage? } As I remove all properties named id (including custom Value types), error just disappeared and app works as I intended with no issue . @Model final class AnalyzedMessage { var messageID: String var user: User var createdAt: Date var text: String var recording: Recording? } I thought using property named id causes problem only when fetching some data like this: context.model(for: myModel.id). So, is property id taken by @Model and forbidden to use? If so, I think there should be a safe-guard for miss-usage just like in my case. +) However, lots of open-source libraries use property id for their models. Do we have to handle all of these models to bypass not to use it? I think it's pretty disturbing..
0
0
478
May ’24
How can I enable HTTP exceptions in Xcode 15?
Before Xcode 15, when I could access the info.plist file, I was able to add exceptions to the App Transport Security Settings so I could connect with my home server, which has no HTTPS, just HTTP. But in Xcode 15 I have no idea, not can I buy a clue with google, on how to do this. Please help! Thanks p.s. I should probably add that one site mentioned going to the Target section of your project allows easy access to info.plist. Yet for some strange reason, there is no item in Targets, which is odd, as I can debug my. project.
0
0
550
Jun ’24
How to read APS Environment entitlement
Is there a simple way to get the value of the APS Environment setting in the Entitlements file from within a SwiftUI app? As others have noted, when the app is run from Xcode, this value is set to "development" but when run from Archive'd TestFlight version, it is set to something else (presumably "production"). I need to know which environment the app should use for registering its device token for notifications.
1
0
502
Jun ’24
Safari App Extension remove toolbar item - Mac
Hi, I have built a Safari App Extension for Mac. However, I want to remove the toolbar item from the extension. I have tried the following approach: Remove SFSafariToolbarItem dictionary from Info.plist Remove the toolbar icon pdf from the project Remove validateToolbarItem and popoverViewController from the extension handler. This does not remove the toolbar item. Instead I have a toolbar item that shows my App Icon just greyed out. On clicking that item, it show an option to "Manage Extension". What should I do to remove the toolbar item from my extension?
1
0
517
Jun ’24
Is there a simple way to adding files to iPhone simulator, for use with Xcode?
Correct me if I'm wrong, but with the latest version of Xcode (15.x) you can no longer add files to the iPhone simulator by dragging them into the the Files app. I also tried to share the files from my Mac desktop to the simulator. But after selecting the simulator, absolutely nothing happened. So I had to do it the long way: Add a folder to the simulator with a unique name, in the Files app Get the document path, print(URL.documentsDirectory.path()) Back track into the folder structure till I find that folder cp the files to that folder Please tell me that there is a way that I haven't found on Google, or that I somehow was doing what the Apple dox suggested, but missed a step.
3
3
1.3k
Jun ’24
Are there In-Person Sessions during the week at WWDC24?
I heard rumors from a local Apple biz rep that they have some developers traveling out to Cupertino for WWDC24 ... however, it has been my understanding, that other than the keynote (which you have to register to win a pass)... is the only in-person event and all other events are online events. Are there "in-person" sessions (i.e., conference classes) that developers can attend throughout the week? and if so, where one would register to attend those classes? i.e., Apple site currently only mentions video classes. NOTE: I already understand that they have labs available for you to meet with Apple experts in-person... i.e., if they choose to meet with you, to discuss your app development questions.
1
0
749
Jun ’24
iPadOS 18 compatibility
Was it a typo on the Website or why is the 2017 10.5 inch iPad Pro (A10X + 4GB of ram) not supported? Because the 7th generation iPad which has an A10 processor + 3GB of ram is supported! It’s weird because the A10X is a more powerful processor so why does it not make the cut?
2
1
1.4k
Jun ’24
FB13847127 (macOS 15 REGRESSION: No longer able to put dock at bottom of external display placed above laptop display (M2 Macbook Air))
macOS 15 (beta) has borked my desktop, changing a longstanding Dock behavior (for the worse); Apple says it’s expected behavior. :( I wonder if anyone else is affected by this change. I have my displays positioned as shown in the attached Screenshot, with a 4K BENQ Thunderbolt Display positioned above the internal display of an M2 MacBook Air. Prior to macOS 15, I was able to place the dock at the bottom of the upper display using the technique described here https://apple.stackexchange.com/a/208750 This allows taking advantage of the much greater real estate on the external display. As of macOS 15 (WWDC developer beta), this no longer works, and I can find no way to move the dock to the upper external display, and my dock remains squeezed into the tiny space available on my internal display (see attached photo).
1
1
441
Jun ’24
NYTimes News App doesn’t run
I know this isn’t the place to report this, but I’m in a Catch 22 situation. You meed to access the app to send a bug report to developers, but I can’t load the app on IOS 18, so I’m reporting it here. The NY Times News App does not open under IOS 18 or iPadOS 18. The subsidiary apps, Games, Cooking, and Audio do.
2
1
665
Jun ’24
Showing Recent Errors Only Command PhaseScriptExecution failed with a nonzero exit code
I updated Xcode to 15.4 version. I keep facing build error: Command PhaseScriptExecution failed with a nonzero exit code. I deleted DerivedData and clean Project, etc.. but nothing works. PhaseScriptExecution Run\ Script /Users/hayat/Library/Developer/Xcode/DerivedData/Runner-bazfaecuwmifkmalxhomfexvwejn/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/Runner.build/Script-5691DA932C169C0C00404F23.sh (in target 'Runner' from project 'Runner') ... /bin/sh -c /Users/hayat/Library/Developer/Xcode/DerivedData/Runner-bazfaecuwmifkmalxhomfexvwejn/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/Runner.build/Script-5691DA932C169C0C00404F23.sh /bin/sh: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory /Users/hayat/Library/Developer/Xcode/DerivedData/Runner-bazfaecuwmifkmalxhomfexvwejn/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/Runner.build/Script-5691DA932C169C0C00404F23.sh: line 3: build: command not found Command PhaseScriptExecution failed with a nonzero exit code Please help me.
1
0
487
Jun ’24
Saving custom fonts to XCode 14 issue
Sorry for repeating this post, but an answer is desperately needed. Whenever I add custom fonts to "Fonts provided by application" the fonts are not retained and the "Fonts provided by application" setting disappears. This happens when I leave the Custom IOS Target Properties/Info tab. I have attempted this with numerous otf/ttf fonts. Using macOS Monterey 12.7.5 and X Code 14.2. See before and after screenshots.
5
0
540
Jun ’24
Effective of way of payout for creators through Apple and third parties
Hello. I have a mobile iOS app Im connecting with Stripe currently. Ideally to have content creators get paid based off their content. My question is, is this best approach to getting creators paid and are able to do this with Apple. If my iOS app allows for creators to create content and lock it for their audience. their subscribers can pay a onetime or an ongoing subscription to unlock their content like articles for example. I give them an 8% platform fee. However we are using apple pay for their supporters to also pay with to unlock their content. This means we need to abide by the 30% Apple cut. These creators are based in different countries, as well as their supporters are also based in different countries. We use Stripe to connect these dots. Allowing the creator to signup through Stripe as a business. Their supporters pay with Stripe (Apple Pay and / or Card) We then allow them to get paid out what they earned from the supporter. All through Stripe. Question: Is this a good way of going about it? Would we get rejected? **Payout question ** Is there another way of handling this? Outside of Stripe? **Sales Tax ** I would love to understand this and find a process I can follow to be successful. I'm pretty new to sales tax world. Has there been a successful process that anybody else follows and can share? To calculate sales tax and do this on a yearly basis? For not only the US, but if your product is also in different countries. Again I don't really know this sales tax stuff and I'm trying to learn it as I go. All the best
0
0
389
Jun ’24
When a refund of subscription is processed by App Store customer support, would the customer's subscription-to-refund canceled from Apple side?
I'm implement the app store notification handling on Refund case, but there is one point that i'm not sure and there seems little evidence from the notification doc. So if a customer requested for a refund for its current active subscription, and App store processed the refund and refund the customer. Now what would be the status of this subscription? still active, set to cancel at period end, or canceled already? If the answer to 1. is "set to cancel" or "canceled already", would there still be notifications to my webhook endpoint just like these lifecycle events went through "normal" customer action to cancel the subscription? Any details would be much appreciated, Thanks!
1
0
408
Jun ’24
UIPrintPageRenderer hangs app after iPhone update
After updating iPhone from 17.4 to 17.5.1 UIPrintPageRenderer completely hangs app when getting NumberOfPages from Renderer. var render = new UIPrintPageRenderer(); if (webViewPages != null && reportIndex < webViewPages.Length) { render.AddPrintFormatter( webViewPages[reportIndex].ViewPrintFormatter, 0); } else { render.AddPrintFormatter( new UIMarkupTextPrintFormatter(reportContent), 0); } var printable = CoreGraphics.CGRectExtensions.Inset(page, 0, 0); render.SetValueForKey(NSValue.FromCGRect(page), new NSString("paperRect")); render.SetValueForKey(NSValue.FromCGRect(printable), new NSString("printableRect")); var pdfData = new NSMutableData(); UIGraphics.BeginPDFContext(pdfData, page, null); int pageNum = 0; for (pageNum = 0; pageNum < render.NumberOfPages; pageNum++) { UIGraphics.BeginPDFPage(); var bounds = UIGraphics.PDFContextBounds; render.DrawPage(pageNum, bounds); } UIGraphics.EndPDFContext();
0
1
359
Jun ’24
Developer Lab no show?
My WWDC24 Developer Lab confirmation email said to come here if there are questions or issues. Well I was on the Webex at the appointed time and no one showed up. What is my next course of action?
1
0
593
Jun ’24
ios18 - Battery draining and phone heating
Hi, After upgrading my iPhone 15 pro max to ios18 beta, i am facing serious heating issues and battery draining very fast. Also, i can see the mobile charging speed is very low. any recommendations to fix the issue ? I can't downgrade the mobile since there are high chances that i may loose currently configured esims after downgrade.
5
6
5.1k
Jun ’24