Post

Replies

Boosts

Views

Activity

Opening file from main bundle in Xcode 16
I've just upgraded to Xcode 16 and my app now fails when attempting to read a text file from the main bundle. It finds the path but can't open the file so this snippet prints: "File read error for path: /private/var/containers/Bundle/Application/AABAD428-96BC-4B34-80B4-97FA80B77E58/Test.app/csvfile.csv" This worked fine up to 15.4. Has something changed? Thanks. class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let bundle = Bundle.main let path = bundle.path(forResource: "csvfile", ofType: "csv")! do { let content = try String(contentsOfFile: path, encoding: String.Encoding.ascii) } catch { print("File read error for path: \(String(describing: path))") } } }
5
0
352
Oct ’24
App Clip Card in Messages
My App Clip has been active for a few years with no problems and the App Clip or the full app opens and behaves as expected when opened from a custom url with a query via the Smart Banner in Safari. However, the App Clip card is also now displayed when the url is sent via Messages (not sure if this new - I used to just see a small link icon?). The problem is that users get different results depending on whether they tap on the card itself or instead tap the Open button. For example, if a simple text message is sent with the text url: http://domain.com/path/?abc the AppClip card is displayed for the recipient in messages. When the recipient taps the card's image, SceneWillContinue receives the full url with its query and the app behaves as expected. But if the card's Open button is tapped SceneWillContinue instead receives the url without the query component (ie. just http://domain.com/path/) and the App Clip action is consequently not activated. is this normal behaviour or is it a bug? Or am I doing something wrong? Thanks.
1
0
500
Jan ’24
AR Grounding Shadows missing in iOS 15
I have a plane AnchorEntity with a child raycast AnchorEntity and my ObjectEntities (USDZ & Mesh) as children of that. On devices up to iOS 14 I get grounding shadows, but on iOS 15 these don't appear. My testing shows that grounding shadows will only appear on iOS 15 if I add ObjectEntities directly as children of the plane? Is there some way in iOS 15 to get grounding shadows to pass through the intermediate raycast AnchorEntity to the plane underneath as they do in iOS14? Thanks. Here's my test code: let query = arView.makeRaycastQuery(from: arView.center, allowing: .estimatedPlane, alignment: .horizontal) let result = arView.session.raycast(query).first let raycastAnchor = AnchorEntity(raycastResult: result) let planeAnchor = AnchorEntity(plane: .horizontal, classification: .any, minimumBounds: [0.2, 0.2]) let robot = (try? AnchorEntity.loadModel(named: "robot", in: nil)) // ** This gives Grounding Shadow on iOS 14 but not iOS 15 planeAnchor.addChild(raycastAnchor) raycastAnchor.addChild(robot!) arView.scene.anchors.append(planeAnchor)  // ** This gives Grounding Shadow on both iOS 14 and 15 raycastAnchor.addChild(planeAnchor) planeAnchor.addChild(robot!) arView.scene.anchors.append(raycastAnchor)
1
0
920
Feb ’22
App Clip Scene Delegate URLs
I have an app clip set up and working properly with my website’s smart banner successfully directing urls either to open in my app clip or in my full app. But I have a problem with the NSUserActivity object received by my SceneDelegate. If I send it a url I’ve used previously, it does not update and instead reports the last “different” url it received. For example, if I send it these urls in order: mysite.com/?txt=abc mysite.com/?txt=def mysite.com/?txt=ghi mysite.com/?txt=jkl it receives each new url as expected. But if I then try to send it one of the first three again (abc, def, ghi) it opens the app, but SceneDelegate reports that it still has jkl. It looks like they’re being cached somewhere and ignored if they’re previously cached? func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { let incomingURL = userActivity.webpageURL print("Scene received: \(incomingURL!.absoluteString)") respondTo(userActivity) } I’m a bit new to this, so probably missing something obvious? Thanks.
2
0
1.1k
Sep ’20