Post

Replies

Boosts

Views

Activity

Reply to Empty callStackRootFrames on MXCrashDiagnostic
@BringSupersonicsBack What are the other fields of the crash? Have you converted the exception code, type, and signal to the mach exception codes and BSD signals? That might give us some hints--though I expect all types to generate a stack frame. Also, have you noticed any consistency when this happens in terms of either device type or os version? Look at the metadata. This would be helpful to identify if it smells like a bug introduced in X OS version on Y device models. Smells like a bug to me. I'd suggest making a defect with the MetricKit team via Feedback Assistant. I'm building a MetricKit analysis app for iPad and Mac and I'm curious about your findings too as it is a data scenario I haven't considered. The strange thing that I have found in the past is call stack frames, but none of them marked as attributed. - FB12739927
Sep ’23
Reply to Public Database Cloud Kit Missing Queryables
Make sure that you first create an index for the timestamp. Add the queryable index if you plan to use it in your predicate, such as 'created|modified after Tuesday'. Add the sortable index if you plan to use the property as a sort descriptor. Finally, if you're testing in production, make sure that your indices were pushed to production! This is never a fun thing to debug. Been there done that. I'm doing a manual synchronization where I 'fetch modified since last cursor'. Regarding the name of the properties, if you're fetching all properties, you can use the debugger to inspect the system field names.
Topic: Programming Languages SubTopic: Swift Tags:
May ’23
Reply to I installed the TestFlight version of my app and apparently that nuked CoreData + CloudKit. Help me understand this
When you run your CloudKit app via Xcode, on simulator or device, the container being used is 'development'. When ever I detect a change of deployment type (i.e. #if DEBUG), I nuke my local core data database and let it rebuild from CloudKit. While you can replicate the data in both development and production containers, it probably won't be 'auto-magic' like you're hoping. When you install the app via TestFlight, can you first delete your local app? I would assume this would get you past the synchronization error you've shared above. Another thing to check is to make sure your schema is deployed. NOTE: Schema can only add fields, so once you deploy to production, you're stuck with them.
Apr ’23
Reply to Previewing Live Activity Views in SwiftUI Previews
@brandonK212, The ActivityViewContext is the context object passed inside the ActivityConfiguration for building your view bodies. The preview for a live activity is very different from previewing a widget. You have to create your attributes set and then request a preview on that instead. Here is a minimally required code snip to get you started. Create custom Attributes Create a widget that uses an ActivityConfiguration of your custom attributes In your preview, instantiate an instance of your attributes and call .preview on it As a note, you need your widget defined as main, or use a widget bundle. I originally missed this and nothing happened. Presumably, under the hood it will lookup which ActivityConfiguration to invoke, and thus which 'View' to finally instantiate for the preview. https://developer.apple.com/documentation/widgetkit/activitypreviewviewkind https://developer.apple.com/documentation/activitykit/activityattributes/previewcontext(_:isstale:viewkind:) P.S. This is brand new with Xcode 14.2 and requires iOS 16.2 :) @available(iOSApplicationExtension 16.1, *) @main struct LocationWidget: Widget {     var body: some WidgetConfiguration {         ActivityConfiguration(for: LocationAttributes.self) { context in             Text("You're at \(context.attributes.name)")         } dynamicIsland: { context in             DynamicIsland {                 DynamicIslandExpandedRegion(.leading) {                     Image(systemName: "mappin.circle")                         .resizable()                         .scaledToFit()                         .frame(width: 32, height: 32)                 }                                  DynamicIslandExpandedRegion(.center) {                     VStack(alignment: .center) {                         Text("You're visiting \(context.attributes.name)")                         HStack {                             Text("\(context.state.location.latitude), \(context.state.location.longitude)")                         }                     }                 }                                  DynamicIslandExpandedRegion(.trailing) {                     HStack {                         Image(systemName: "hand.thumbsup.fill")                             .resizable()                             .scaledToFit()                             .frame(width: 32, height: 32)                                                  Image(systemName: "hand.thumbsdown")                             .resizable()                             .scaledToFit()                             .frame(width: 32, height: 32)                     }                 }                                  DynamicIslandExpandedRegion(.bottom) {                     Text("Enjoy your visit!")                 }             } compactLeading: {                 Text("Compact Leading")             } compactTrailing: {                 Text("Compact Trailing")             } minimal: {                 Text("Minimal")             }         }     } } struct LocationActivityView: View {     var body: some View {         Text("Hello Location")     } } struct LocationAttributes: ActivityAttributes {     struct ContentState: Codable, Hashable {         var location: Location     }          let name: String } struct Location: Codable, Hashable {     let latitude: Double     let longitude: Double } #if DEBUG @available(iOSApplicationExtension 16.2, *) struct LocationActivityView_Previews: PreviewProvider {          static var previews: some View {         Group {             LocationAttributes(name: "London Eye")                 .previewContext(                     LocationAttributes.ContentState(location: Location(latitude: 51.503351, longitude: -0.119623)),                     viewKind: .content                 )                          LocationAttributes(name: "London Eye")                 .previewContext(                     LocationAttributes.ContentState(location: Location(latitude: 51.503351, longitude: -0.119623)),                     viewKind: .dynamicIsland(.expanded)                 )         }     } } #endif I'm getting an error trying to attach the resulting preview screenshot but give it a run and check it out for yourself!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’22
Reply to App Clip Experience URL problem
@ricardo.sms, Likely what you're running into is the length of your domain. I have two domains that are identical except one prefixes with "the", "thecxxxxxxxxxxxxe.app" and "cxxxxxxxxxxxxe.app". The visual App Clip Code can only encode so much. I brought this up during WWDC 2021 lab with App Clip team; they know we want more space. What to do for now? #filefeedback for future OS releases and App Clip Code embedded data size. Okay fine, hope for more in the future, but what to do about iOS 14-16? Here is my implementation: Through experimentation, I found that I only have 6 characters to work with when I use my shorter domain (cxxxxxxxxxxxxe.app). The "the" in my domain really restricts me and I wish I could have a fancy short/OG top level domain, but domain squatters make them so expensive... So I'm stuck with cxxxxxxxxxxxxe.app/id/123456 for my clip urls.
Topic: App & System Services SubTopic: General Tags:
Aug ’22
Reply to AppClip not launching on Installation
@InfogenLabsPvtLtd, when you created your app clip, did you rename the bundle identifier of either the clip or your parent app? I ran into stuff similar to this because I'm OCD about my bundle identifier naming conventions (I changed .Clip to .clip). Do a search in your project for all of your bundle identifiers and look for any inconsistencies including case sensitive differences. Since you blurred out everything, it is quite hard to help or make suggestions.
Topic: Code Signing SubTopic: Entitlements Tags:
Aug ’22
Reply to Are WatchOS storyboards forbidden now ?
@Claude31, I'm also curious what you've encountered. I have yet to convert my watch apps over to SwiftUI but plan on doing so due to some WatchKit defects that surfaced the last two years that are quite annoying--though I just checked watchOS 9 beta 2 and they appear to be fixed. In any case, if you post your feedbacks here with a quick description and they apply to my apps too, I'd be happy to write matching ones up on my side and reference yours as duplicate to help upvote what you found. For other devs finding their way to this post, here are some defects that I've filed against watchOS 7 / 8: FB9972047 - WatchKit: awakeWithContext not invoked on page 2 and 3 in multipage layout until after swiping [watchOS 8] In short, three "page" layout in WatchKit, the second and third pages don't receive an init until the user swipes. Previously, in the init of the second interface controller, I was having it become the active page upon initialization. I can't do this anymore so programatic navigation is totally busted. FB8965949 - WKInterfacePicker text baseline clips with y and g [watchOS 7.2/8] In short, I added a picker that has "kayaking" and "canoeing" in my watch app. The letters are being clipped when using the WKInterfacePicker control, but when I rewrote in SwiftUI this was not the case.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22
Reply to SwiftUI .searchable's new "scope" feature behavior
Update: Xcode 14 beta 3 deprecated the above code using scope within searchable and now there is a new modifier .searchScopes. The behaviors described in my feedbacks still apply. I'd expect the scopes to be visible before typing in the search and the selected scope to respect the binding. These are still open issues. A visibility param now makes a ton of sense. The new API is here: https://developer.apple.com/documentation/swiftui/anyview/searchscopes(_:scopes:)?changes=latest_minor
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22
Reply to Is cryptocurrencies in-app purchases allowed in the App Store?
Check out the App Store Review Guidelines: https://developer.apple.com/app-store/review/guidelines/ Specifically sections: 3.1.1 In-App Purchase 3.1.5 Cryptocurrencies 5.3 Gaming, Gambling, and Lotteries I think this is the line you're looking for from 5.3.3 that states "Apps may not use in-app purchase to purchase credit or currency for use in conjunction with real money gaming of any kind."
Topic: App & System Services SubTopic: StoreKit Tags:
Jun ’22
Reply to Embed SwiftUI View in UITabBarController
There are still a handful of things you can do in UIKit for UITabViewController that you can't in SwiftUI (even with iOS 16). If you want to mix and match, you can use a UIHostingController and shove your SwiftUI view inside one then add the hosting controller as a child of the UITabViewController.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’22
Reply to iOS 16 Live Activities Lock Screen widget
I asked the same thing during WWDC22 Labs and the API behavior and design is pretty much on lock down. Taking hints from the system and the use cases that Apple has demonstrated, a package delivery, a sports event score change, a ride share service, these are all things that seem to be remote server updated. Meaning the phone can't do them on their own. Maybe you could do a conference planner/scheduler Live Activity that is all locally cached, but the use cases were telling to me. I have to imagine it will look like WidgetKit but have some aspect of content-available push that maybe goes right to your widget / live activity extension. Or to your app and then reload timeline if truly like widget kit. I'd also bet that just like widgets on home and Lock Screen, Live Activities will be 100% SwiftUI for visuals. So my vote goes to learning "systemMedium" widget family, and SwiftUI. If you make a systemMedium Home Screen widget visually, hopefully it would be reusable for your live activity view. Out of curiosity, what is your use case? How often would you want to refresh the live activity? This was also something I talked about in my lab, trying to get info on refresh policies--nothing :) Guess we will have to wait. I was encourage to #filefeedback on my ideas for Live Activities so Apple can see what we want to build.
Topic: App & System Services SubTopic: General Tags:
Jun ’22
Reply to How to open specific app clip settings in Swift?
@JJY, did you #filefeedback for this? The documentation for the openSettingsURLString describes "app" so my guess is that the behavior is expected. That having been said, I agree it would be nice to direct the user to correct permission issues if they want to access a feature they previously denied authorization for. I just filed mine requesting app clip settings url: FB10346783
Topic: App & System Services SubTopic: General Tags:
Jun ’22