It seems that when an entity has and ordered to-many relationship to the same entity, inserting an object into the ordered set causes other objects of the set to turn into faults during the next save of the managed object context.
I verified it with several applications.
For the sake of example, the entity will be called Folder and the ordered to-many relationship subfolders (an NSOrdereset), with a cascade delete rule. The reciprocal to-one relationship is called parent.
Assuming you have a Folder object with two subfolders, removing the last subfolder from the set (setting its parent to nil) and reinserting it at index 0 with insertObject:<>inSubfoldersAtIndex:0 will turn the other subfolder into a fault at the next save.
Now assuming that other folder has a name attribute (NSString) that is bound to a textfield in your UI, the name of that subfolder will disappear when the context saves, since it becomes nil while the subfolder is turned into a fault.
Is this expected behavior?
Note: I'm using Objective C, Xcode 15 and macOS sonoma, but I've seen this issue occur on previous macOS versions.
General
RSS for tagExplore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.
Post
Replies
Boosts
Views
Activity
On testing my app with tvOS 18, I have noticed the Siri Remote back button no longer provides system-provided behavior when interacting with tab bar controller pages. Instead of moving focus back to the tab bar when pressed, the back button will close the app, as if the Home button was pressed. This occurs both on device and in the Simulator.
Create tvOS project with a tab bar controller.
Create pages/tabs which contain focusable items (ie. buttons)
Scroll down to any focusable item (ie. a button or UICollectionView cell)
Hit the Siri Remote back button. See expect behavior below:
Expected behavior: System-provided behavior should move focus back to the tab bar at the top of the screen.
Actual results: App is closed and user is taken back to the Home Screen.
Has anyone else noticed this behavior?
I created a Radar for this FB14766095, but thought I would add it here for extra visibility, or if anyone else had any thoughts on the issue.
Basic Information
Please provide a descriptive title for your feedback:
iOS 18 hit testing functionality differs from iOS 17
What type of feedback are you reporting?
Incorrect/Unexpected Behavior
Description:
Please describe the issue and what steps we can take to reproduce it:
We have an issue in iOS 18 Beta 6 where hit testing functionality differs from the expected functionality in iOS 17.5.1 and previous versions of iOS.
iOS 17: When a sheet is presented, the hit-testing logic considers subviews of the root view, meaning the rootView itself is rarely the hit view.
iOS 18: When a sheet is presented, the hit-testing logic changes, sometimes considering the rootView itself as the hit view.
Code:
import SwiftUI
struct ContentView: View {
@State var isPresentingView: Bool = false
var body: some View {
VStack {
Text("View One")
Button {
isPresentingView.toggle()
} label: {
Text("Present View Two")
}
}
.padding()
.sheet(isPresented: $isPresentingView) {
ContentViewTwo()
}
}
}
#Preview {
ContentView()
}
struct ContentViewTwo: View {
@State var isPresentingView: Bool = false
var body: some View {
VStack {
Text("View Two")
}
.padding()
}
}
extension UIWindow {
public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
/// Get view from superclass.
guard let hitView = super.hitTest(point, with: event) else { return nil }
print("RPTEST rootViewController = ", rootViewController.hashValue)
print("RPTEST rootViewController?.view = ", rootViewController?.view.hashValue)
print("RPTEST hitView = ", hitView.hashValue)
if let rootView = rootViewController?.view {
print("RPTEST rootViewController's view memory address: \(Unmanaged.passUnretained(rootView).toOpaque())")
print("RPTEST hitView memory address: \(Unmanaged.passUnretained(hitView).toOpaque())")
print("RPTEST Are they equal? \(rootView == hitView)")
}
/// If the returned view is the `UIHostingController`'s view, ignore.
print("MTEST: hitTest rootViewController?.view == hitView", rootViewController?.view == hitView)
print("MTEST: -")
return hitView
}
}
Looking at the print statements from the provided sample project:
iOS 17 presenting a sheet from a button tap on the ContentView():
RPTEST rootViewController's view memory address: 0x0000000120009200
RPTEST hitView memory address: 0x000000011fd25000
RPTEST Are they equal? false
MTEST: hitTest rootViewController?.view == hitView false
RPTEST rootViewController's view memory address: 0x0000000120009200
RPTEST hitView memory address: 0x000000011fd25000
RPTEST Are they equal? false
MTEST: hitTest rootViewController?.view == hitView false
iOS 17 dismiss from presented view:
RPTEST rootViewController's view memory address: 0x0000000120009200
RPTEST hitView memory address: 0x000000011fe04080
RPTEST Are they equal? false
MTEST: hitTest rootViewController?.view == hitView false
RPTEST rootViewController's view memory address: 0x0000000120009200
RPTEST hitView memory address: 0x000000011fe04080
RPTEST Are they equal? false
MTEST: hitTest rootViewController?.view == hitView false
iOS 18 presenting a sheet from a button tap on the ContentView():
RPTEST rootViewController's view memory address: 0x000000010333e3c0
RPTEST hitView memory address: 0x0000000103342080
RPTEST Are they equal? false
MTEST: hitTest rootViewController?.view == hitView false
RPTEST rootViewController's view memory address: 0x000000010333e3c0
RPTEST hitView memory address: 0x000000010333e3c0
RPTEST Are they equal? true
MTEST: hitTest rootViewController?.view == hitView true
You can see here ☝️ that in iOS 18 the views have the same memory address on the second call and are evaluated to be the same. This differs from iOS 17.
iOS 18 dismiss
RPTEST rootViewController's view memory address: 0x000000010333e3c0
RPTEST hitView memory address: 0x0000000103e80000
RPTEST Are they equal? false
MTEST: hitTest rootViewController?.view == hitView false
RPTEST rootViewController's view memory address: 0x000000010333e3c0
RPTEST hitView memory address: 0x0000000103e80000
RPTEST Are they equal? false
MTEST: hitTest rootViewController?.view == hitView false
The question I want to ask:
Is this an intended change, meaning the current functionality in iOS 18 is expected?
Or is this a bug and it's something that needs to be fixed?
As a user, I would expect that the hit testing functionality would remain the same from iOS 17 to iOS 18.
Thank you for your time.
My app correctly applies the ShieldConfiguration template that I chose (icon, text, CTA, etc), but some users reported seeing the following default shield:
With the default shield text that reads, "You cannot use AppName because it is restricted."
Any idea why?
I've noticed the tab bar in tvOS 18 (beta) is positioned lower on the TV screen than in previous versions. Bug? I see no documentation on this important UI change...
If this is not a bug, is there any way to adjust the y coordinate of the tab bar location in tvOS 18? I would really like to restore this to the previous location for my app and avoid having to do OS-conditional constraints for all my views/pages.
My app exports a custom file type identifier for a file that it exports to share between other users of the same app. However in the list of apps in UIActivityViewController view, my app is listed far off screen. How can I make my app which owns the file type appear first in the list, instead of seeing many irrelevant apps that can't actually open my file?
Plist snippets:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>My Custom App File</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>abc.myapp.myextension</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.content</string>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>My Custom App File</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>abc.myapp.myextension</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>myextension</string>
</array>
<key>public.mime-type</key>
<array>
<string>application/octet-stream</string>
</array>
</dict>
</dict>
</array>
I'd like an effect similar to the iOS 18 Siri, with a border/stroke extending around the view including the corner radius of the screen.
This is challenging as "logically" the view is rectangular and those radii don't really exist.
I've seen some posts around the web about _displayCornerRadius which appears to be what would work but it is private and as far as I can tell never mentioned anywhere else.
Does anyone know of a way to achieve a border around a view that correctly wraps around the corners of the rounded screen?
Currently using SwiftUI but open to any solutions.
Hi everyone,
We have a user experiencing a display issue. Here's a screenshot they shared with us. Unlike in the simulator, where we see three icons, their display shows two buttons abbreviated with ellipses. The device is iPhone 12 mini with iOS 17.6.1.
The user isn't using any accessibility settings or large text size. Does anyone know what setting might be causing this? Any advice would be appreciated!
Thanks!
`struct OpenMainAppIntent: AppIntent {
static let title: LocalizedStringResource = "OpenMainAppIntent"
static var openAppWhenRun: Bool = true
init() {}
@MainActor
func perform() async throws -> some IntentResult & OpensIntent {
guard let url = URL(string: "myapp://open") else {
throw OpenURLError.invalidURL
}
return .result(opensIntent: OpenURLIntent(url))
}
}
`
This is an action in my custom control widget, and i want to use this deeplink open my application and get the link's info, but it won't perform onOpenURL
`@main
struct TestControlWidgetApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.onOpenURL { url in
print("url: \(url)")
}
}
}
}`
This code can open app, but the deep link is not send to the app.
It doesn't seem to call the UIApplicationDelegate's "application(_:open:options:)" method, so I can't read the link string that was passed in
func perform() async throws -> some IntentResult & OpensIntent {
guard let url = URL(string: "myapp://myappintent") else {
// throw an error of your choice here
}
return .result(opensIntent: OpenURLIntent(deepLink))
}
In my app I added an AppIcon in the Assets.xcassets folder. I added a any/dark/tinted version of the app icon, in 1024x1024 resolution as a HEIC file, specifying a "single size" iOS option.
When I build and run the app in xcode16 beta on iOS18 the icon works as expected, but when I run the same app on iOS17 the icon just shows up as a black rectangle.
How do I get the app icon to work correctly on both iOS18 and iOS17?
Hello everyone, I’m currently developing an app for the Apple Watch and am working on implementing a dimming feature that activates when the device is in Theater mode.
Is there any way to detect programmatically whether Theater mode is enabled or disabled? Thanks!
Hi,
is there any description/documentation about what can not be used as SwiftData attributes?
I do not mean things which cause issues at compile time, like having a type which is not Codeable. But rather I am looking for info which things to avoid, if you do not want to run into application crashes in modelContext.save(). Like for example having an enum which as an optional associated value as an attribute type (crashes on save is the associated value is nil).
Anybody seen any documentation about that? Or tech notes?
Thanks in advance for any hints :-).
Cheers, Michael
I have a .Net MAUI App.
As soon as i close the app or put in the background the app crashes instantly. It only happens on
OS version: iPad OS 17.5.1
Model:iPad mini (6th generation).
Below is the exception logged on firebase crashlytics
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}, scale=3.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.'
Any suggestions or ideas ?
XCode version: Version 14.2
Ios: 17.6.1
ios versions younger than 17 perform normally。
like this
As the new feature is launched I also want to make user experience smoother in my app using the AccessorySetupKit. But my peripheral is not discoverable. But another ios device with same advertisement data is discoverable by AccessorySetupKit. I didn't find much information on the documents related to the third party connection. I'm not sure if the third party peripheral should be MFI supported or anything else is required.
Is there anything I'm missing here to fullfill the requirement, please let me know.
Below is the code i"m using to discover the peripheral. Once again iOS to iOS discovery is working, facing issue with third party peripheral is not discovering.
private var session = ASAccessorySession()
var pickerDismissed = true
private static let perepheral: ASPickerDisplayItem = {
let descriptor = ASDiscoveryDescriptor()
descriptor.bluetoothServiceUUID = PublisherClass.serviceUUID
return ASPickerDisplayItem(
name: "Test_Name",
productImage: UIImage(named: "sample")!,
descriptor: descriptor
)
}()
override func viewDidLoad() {
super.viewDidLoad()
self.session.activate(on: DispatchQueue.main, eventHandler: handleSessionEvent(event:))
}
@IBAction func presentPicker() {
session.showPicker(for: [Self.perepheral]) { error in
if let error {
print("Failed to show picker due to: \(error.localizedDescription)")
}
}
}
private func handleSessionEvent(event: ASAccessoryEvent) {
switch event.eventType {
case .accessoryAdded, .accessoryChanged:
guard let accessory = event.accessory else { return }
print("\(accessory)")
case .activated:
guard let accessory = session.accessories.first else { return }
print("\(accessory)")
case .accessoryRemoved:
print("Received event type accessoryRemoved)")
case .pickerDidPresent:
pickerDismissed = false
case .pickerDidDismiss:
pickerDismissed = true
default:
print("Received event type \(event.eventType)")
}
}
}
I also added these details in plist
NSAccessorySetupKitSupports
Bluetooth
NSAccessorySetupBluetoothServices
Hi,
My iOS app shows more language with region codes than what I've selected in Xcode:
This is what I see in the language selection (simulator and device):
How can I remove all the language with region codes? I want to remove:
English (US)
Suomi (Suomi)
Deutsch (Deutschland)
Kalaallisut (Kalaallit Nunaat)
Norsk bokmål (Norge)
Thank you!
In my Swift app for MacOS, I used to set the app icon in status bar with following logic.
If dark mode is enabled, white colour template icon
If light mode is enabled, black colour template icon
Until BigSur with this configuration, if the background wallpaper color was changed being in the same display mode, the status bar icon color used to change dynamically.
From Ventura onwards, it does not depend on the background colour anymore with same configuration in the code.
Can someone please help here?
ERROR ITMS-90349: "Invalid Info.plist value. The value of the EXExtensionPointldentifier key, com.apple.contact.provider.extension, in the Info.plist of "MainApp.app/Extensions/ContactProviderExtension.appex" is invalid.
We were working on new iOS18 Contacts Provider extension and when try to test the feature in testflight we were unable to submit the build and getting the above error. The extensionPointldentifier 'com.apple.contact.provider.extension' was auto generated by xcode and apple doc mentioned the same value to use for Contacts Provider extension support. But it is not accepting in testflight.
https://developer.apple.com/documentation/contactprovider/contactproviderextension
Any help will be appreciated.
I am looking to use the iOS share sheet in my app where the user can send an invite link to friends, however I want to limit the number of times they can do this.
Is it possible to limit the number of recipients who you can share an item using the share sheet, or if there any sort of post-feedback sent from the share sheet back to the app once the share sheet is closed?