iOS is the operating system for iPhone.

Posts under iOS tag

200 Posts

Post

Replies

Boosts

Views

Activity

iOS 18 SwiftData Bug: Codable Models Cause Relationship Mapping Error
Here we have yet another bug, I suppose, in SwiftData that happens on iOS18 but it is not an issue on iOS17. There are 2 models defined as follows @Model final public class Note: Identifiable, Codable, Hashable { public private(set) var uuid = UUID().uuidString var heading: String = "" var tags: [Tag]? init(heading: String = "") { self.heading = heading } required public init(from decoder: Decoder) throws { ... } public func encode(to encoder: Encoder) throws { ... } } @Model final public class Tag: Identifiable, Codable { var name: String = "" @Relationship(deleteRule: .nullify, inverse: \Note.tags) var notes: [Note]? init(_ name: String) { self.name = name } required public init(from decoder: Decoder) throws { … } public func encode(to encoder: Encoder) throws { ... } } and a function o add new tags as follows private func addTags(note: Note, tagNames: [String]) { if note.tags == nil { note.tags = [] } for tagName in tagNames { if let tag = fetchTag(tagName) { if !note.tags!.contains(where: {$0.name == tagName}) { note.tags!.append(tag) } } else { // The following line throws the exception on iOS18 when Tag conforms to Codable: // Illegal attempt to map a relationship containing temporary objects to its identifiers. note.tags!.append(Tag(tagName)) } } } This code works perfectly well on iOS17 but on iOS18 I get the exception “Illegal attempt to map a relationship containing temporary objects to its identifiers.” What I noticed that this happens only when Tag model conforms to Codable protocol. Is it a bug? It looks like, otherwise we've got some undocumented changes have been made. In my previous post I mentioned about the other issue about ModelContext that is broken too on iOS18 - I mean it works perfectly well on iOS17. Demo app with an example how to workaround this problem is available here on GitHub. Repro steps: Add a note with some tags (separated by space) Edit this note and add a new tag (tag that does not exists in database) and tap Save. You should noticed that the tag hasn't been added. It works occasionally but hardly to be seen.
3
5
1.1k
Oct ’24
onDrag "lagging" issue in iOS 18
I've seen an earlier post on this with no response. Has anyone else gotten a response from Apple or have run across a solution to onDrag lagging when released to drop on iOS 18? I've been chasing this for a week thinking it was me and then I woke up and started testing it on older iOS versions and the issue goes away. I happens on simulators and real phones. A little more digging and I'm seeing occasional chatter about this .5 to 1 second delay. Here's a code example that reproduces it: import SwiftUI import UniformTypeIdentifiers struct ContentView: View { @State private var draggableText: String = "Move this" var body: some View { VStack(spacing: 80) { DraggableItem(content: $draggableText) DropZone { Text("Place Here!") .font(.headline) .foregroundColor(.white) } .frame(width: 150, height: 150) .background(Color.green) .cornerRadius(12) } .padding() } } struct DraggableItem: View { @Binding var content: String var body: some View { Text(content) .frame(width: 120, height: 120) .background(Color.red) .foregroundColor(.white) .cornerRadius(8) .onDrag { NSItemProvider(object: NSString(string: content)) } } } struct DropZone<Content: View>: View { var content: () -> Content var body: some View { ZStack { content() } .onDrop(of: [UTType.text], delegate: DropHandler()) } } struct DropHandler: DropDelegate { func performDrop(info: DropInfo) -> Bool { // Add logic to handle the drop print("Item dropped!") return true } } #Preview { ContentView() }
4
2
547
Oct ’24
crash while open UIActivityViewController only in iOS 15
let activityViewController = UIActivityViewController(activityItems: items, applicationActivities: []) activityViewController.popoverPresentationController?.barButtonItem = navigationController.topViewController?.navigationItem.rightBarButtonItem navigationController.present(activityViewController, animated: true, completion: nil) Crash logs ===================================================== *** Assertion failure in -[_UIActivityContentCollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:], UICollectionView.m:7588 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempted to dequeue a cell for a different registration or reuse identifier than the existing cell when reconfiguring an item, which is not allowed. You must dequeue a cell using the same registration or reuse identifier that was used to dequeue the cell originally to obtain the existing cell. Dequeued reuse identifier: UIActivityContentActionCellIdentifier; Original reuse identifier: UIActivityActionGroupCell; Existing cell: <UIActivityActionGroupCell: 0x10f19f220; baseClass = _UICollectionViewListCell; frame = (16 354; 358 30); clipsToBounds = YES; layer = <CALayer: 0x600000781740>>'
0
0
441
Oct ’24
iOS18 SwiftUI Bug: Theme Change Issue
Yet another bug, I suppose, on iOS 18. This time it relates to the SwiftUI framework, and to be precise, it's about the theme change functionality. It no longer works properly on iOS 18, while it’s not an issue on iOS 17. Demo app available at: https://github.com/m4rqs/iOS18ThemeIssue Steps to reproduce: Assume the system is set to use the light theme. Go to the Settings tab. Switch the colour scheme to Dark. Switch the colour scheme to System (this no longer works). Switch the colour scheme to Light (the tab bar is not updated if the content page is long enough and go beyond current view). Switch between tabs (tab bar icons are greyed) enum Theme: Int { case system case light case dark } struct SettingsView: View { @State private var theme: Theme = .system @State private var colorScheme: ColorScheme? = nil var body: some View { Form { Section(header: Text("General")) { Picker("Colour Scheme", selection: $theme) { Text("System").tag(Theme.system) Text("Light").tag(Theme.light) Text("Dark").tag(Theme.dark) } .preferredColorScheme(colorScheme) .onChange(of: theme) { switch theme { case .light: colorScheme = .light case .dark: colorScheme = .dark default: colorScheme = nil } } } } } }
3
4
1.1k
Oct ’24
Siri with apple intelligence is not working IOS 18.2 Beta
After I updated Siri doesn't work. If I try to use it by typing I get no feedback or response. If I say 'Siri' or hold down the side button the 'animation' on the screen starts but stops immediately and again I have no response or feedback. When turning off Apple Intelligence and just using Siri, it works perfectly. But in conjunction with Apple Intelligence, it is not possible to use Siri. IOS 18.2 Beta IPhone 15 pro Max
6
5
2.5k
Oct ’24
Not getting crash logs for TestFlight builds
Hello, We haven't been getting crash logs for internal TestFlight builds. I've tried intentionally causing a crash by calling fatalError() directly. The TestFlight feedback dialog appears and crash logs appear on the iPhone device itself, but they never appear in App Store Connect or Xcode Organizer. The builds are all created by an Xcode cloud workflow and the Share analytics with App Developers setting is on. I filed a radar ticket at FB15453505, but I wonder if others might have run into the same thing. Has anyone else had this issue and figured out how to resolve it?
2
1
539
Oct ’24
Xcode Canvas preview connected to iPhone error
"Can not preview in this file" Xcode 16.0 iPhone 14 Pro , iOS 18.0 When I choose to start Preview on my iPhone, the canvas screen keeps showing loading circle animation. The iPhone enters the Xcode Previews App but only displays the default screen (Xcode icon& 'Preview from Xcode') I uploaded the some of diagnostics files previews_diagnostics_summary.txt remote_injection.json
7
0
771
Oct ’24
iOS universal links: excluded path opens in my app
Hello. Here is my AASA file (my appID changed): { "applinks": { "apps": [], "details": [ { "appIDs": [ "A123B4567C.app.myapp.tool" ], "components": [ { "/": "/en", "exclude": true }, { "/": "/en/*", "exclude": true }, { "/": "/workspace/*", "exclude": true }, { "/": "*" } ], "paths": [ "NOT /en", "NOT /en/*", "NOT /workspace/*", "*" ] } ] } } I need to open all links with my app except those with excluded flag. When I open 'right' links, my app opens them (that's great). When I open excluded link (e.g. https://myapp.app/workspace/personal) Safari opens it (that's great) but then the app is launched (that's what not expected). What I already checked: added the old "paths" property (it wasn't there originally) rebooted my device reinstalled my app from the TestFlight then from the AppStore asked ChatGPT used AASA validator (branch.io one) cleared Safari cache checked my links for redirects What else can I check? Thanks.
2
0
1.8k
Oct ’24
SSL Pinning : Info.plist based SSL Certificate Pinning way of implementation in iOS is not working
I have implemented SSL pinning by following this article https://developer.apple.com/news/?id=g9ejcf8y , however pen testing team was able to bypass SSL pinning using Objection &amp; Frida tools. I am using URLSession for API calls. I used Xcode 16. My app's minimum iOS deployment version is 16 onwards. &lt;key&gt;NSAppTransportSecurity&lt;/key&gt; &lt;dict&gt; &lt;key&gt;NSPinnedDomains&lt;/key&gt; &lt;dict&gt; &lt;key&gt;*.mydomain.com&lt;/key&gt; &lt;dict&gt; &lt;key&gt;NSIncludesSubdomains&lt;/key&gt; &lt;true/&gt; &lt;key&gt;NSPinnedCAIdentities&lt;/key&gt; &lt;array&gt; &lt;dict&gt; &lt;key&gt;SPKI-SHA256-BASE64&lt;/key&gt; &lt;string&gt;my SHA256 key&lt;/string&gt; &lt;/dict&gt; &lt;/array&gt; &lt;/dict&gt; &lt;/dict&gt; &lt;/dict&gt; Could anyone suggest how to mitigate this bypass mechanism?
1
0
780
Oct ’24
BLE Device Discovery Inconsistent Across iPhone Models with Same iOS Version
I'm encountering an issue where a specific BLE device (a Telematics Control Unit) is being discovered by some iPhone models but not others, all running the same iOS version (18.0.1). Here's the breakdown: Successful discovery: iPhone 11, iPhone 14 Plus, iPhone 6s No discovery: iPhone 13, iPhone 12 mini Firmware: The TCU firmware is up-to-date. BLE: Bluetooth is enabled on all devices. I've tried basic troubleshooting like restarting devices and resetting network settings, but the issue persists. Could this be related to differences in Bluetooth chipsets or antenna designs between iPhone models, even with the same iOS version? Are there any known compatibility issues between this TCU and specific iPhone models? Any insights or suggestions for further debugging issue would be greatly appreciated!
3
0
670
Oct ’24
3rd party OSS license string in settings.bundle could not been displayed in iOS 18
Hello, Dear Developers Problem Description My team is working on functionality test in iOS18. Basically, application functionality works as expected without any modification. However, We found a small issue in settings application. iOS 17 In iOS17, 3rd party OSS license string in settings application would been displayed if the license button is been clicked. Model: iPhone SE 3 OS Version: 17.6.1 iOS 18 However, in iOS18, nothing but a blank page. Model: iPhone SE 3 OS Version: 18.0.1 Settings.bundle Below are files in settings.bundle. What I've searched Using XCode 16 makes no change Nothing about settings.bundle in iOS 18 release note A similar post: https://forums.developer.apple.com/forums/thread/764519 The solution in the post doesn't solve my problem. If you know the solution, please let me know. Best wishes.
0
0
410
Oct ’24
Security and privacy
Yesterday I upgraded to IOS 18.1 RC, after the update, I went to the privacy and security section, then went back out and then back in, and a gray background appeared on the selected item, all the items in privacy Privacy and security are all grayed out when I go back in and then click back in. I've updated and reinstalled, but the problem still persists. Does anyone else have the same problem? I use Iphone 15PM, Thanks All!
1
0
347
Oct ’24
Use the AVPictureInPictureController caused the UI disorder
My app supports only iPhone mode, and when it runs on an iPad device, it normally displays compatible iPhone mode. But my code as long as you use the AVPictureInPictureController, open the picture in picture, will lead to get [UIScreen mainScreen] bounds became the real width and height, so the UI disorder; How should my application be compatible with this?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
305
Oct ’24
Apple Intelligence missing Image features released in 18.2 today
I'm using an iPhone 15 Pro Max and running developer beta 18.2 released today. I've already been an 'Apple Intelligence' user and now have been able to link it with my PAID ChatGPT account. HOWEVER; I'm searching for these Image features everyone seems to be posting about and cannot find them anywhere. I'm apparently supposed to sign up for beta access to the Image features through some new Apple natively released app that was supposedly included in this build update, which I cannot find. What gives??!!
4
2
1.5k
Oct ’24
iOS Eye Tracking Accessibility Feature API
Hi, is there any way to interact with the eye tracking accessibility feature in iOS and iPadOS? I want to be able to trigger an eye tracker recalibration programmatically. Also if possible, I would like to be able to retrieve gaze location data. These are not intended to be features on an app being published to the app store but rather a custom made accessibility app.
2
0
867
Oct ’24