Post

Replies

Boosts

Views

Activity

No large titles margin on iOS 26
I need more time to adapt to the new iOS 26 UI, so I set the "UIDesignRequiresCompatibility" attribute to "Yes." This works, but now all large titles are not aligned with the content. Below you can see an example, but I have the issue with all large titles. All good on iOS 18. Does anyone have an idea why and how can i fix it?
4
2
262
Sep ’25
UITextField with isSecureTextEntry in Catalyst display an empty box
Hi, In a Mac Catalyst app, I need to allow the user insert a passcode using a UITextField. The field is used to insert a one time passcode and I want to keep the content hidden. For this reason I set the isSecureTextEntry property to true. passcodeTextField.isSecureTextEntry = true By doing this, a button to allow the user to pick a password from the keychain is displayed: This option in my case should not appear because the password is a one time password that change every time. For that reason I set the textContentType to oneTimeCode. passcodeTextField.textContentType = .oneTimeCode This actually removes the password button, but introduce something weird. If the user type something and then delete everything, a big empty box appear under the field: I have no idea what this box is and why it appears. Does anyone know why it appears and how I can remove it? Thank you
1
1
851
Apr ’25
supplementarySidebarTrackingSeparatorItemIdentifier
I'm developing an iOS 14 Catalyst app and I'm trying to setup the window toolbar. I created a NSToolbar and assigned to the scene window titlebar property. var toolbarDelegate = ToolbarDelegate() func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { #if targetEnvironment(macCatalyst) guard let windowScene = scene as? UIWindowScene else { return } let toolbar = NSToolbar(identifier: "main") toolbar.delegate = toolbarDelegate toolbar.displayMode = .iconOnly if let titlebar = windowScene.titlebar { titlebar.toolbar = toolbar titlebar.toolbarStyle = .unified titlebar.titleVisibility = .hidden } #endif } I then assigned some items to the toolbar via the toolbarDefaultItemIdentifiers delegate method. func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { let identifiers: [NSToolbarItem.Identifier] = [ .toggleSidebar, .print, .flexibleSpace, .print ] return identifiers } This work as expected. Now, let's say that I want to align some items with the edges of the supplementary column. I found that there is an NSToolbarItem named supplementarySidebarTrackingSeparatorItemIdentifier. This item appears to allow us to align items with the supplementary column. If I do this: func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { let identifiers: [NSToolbarItem.Identifier] = [ .toggleSidebar, .flexibleSpace, .print, .supplementarySidebarTrackingSeparatorItemIdentifier, .print, .flexibleSpace, .print ] return identifiers } I got the following result which is exactly what I want to achieve (the items are aligned with the supplementary column): But there are some issues. As you can see from the above image for some reason the background color of the toolbar on top of the supplementary column become white. But it's worse. If I resize the window the background instantly become gray: If I then scroll the content of the supplementary column the toolbar become white again. Another issue is that If I collapse the primary column the toolbar on top of the supplementary column loose the right separator line. Why? I tried to search some info online but if I try to search for supplementarySidebarTrackingSeparatorItemIdentifier I got only 5 results! One of these is Apple's official documentation page, which does not contain any info about the behaviour of this item: Apple documentation about supplementarySidebarTrackingSeparatorItemIdentifier At this point I wonder if this item is ready to be used in real apps. Someone has experience using the supplementarySidebarTrackingSeparatorItemIdentifier item? There is a way to align toolbar items with the supplementary column without having the above described issues? (different toolbar background color, missing toolbar separator line) Thank you
1
0
1.5k
Aug ’24
StoreKit 2: Transaction.updates don't emits refunds at app launch
If an in-app purchase is made when my app is not running, the next time the app launches Transaction.updates will emits a transaction for the purchase. That's great. But if an in-app purchase is refunded when my app is not running, the next time the app launches Transaction.updates will NOT emits a transaction for the refund. Is that the expected behaviour? If yes, in order to check for refunds at app launch, are we supposed to cycle trough Transaction.all and search for them? Thank you
0
0
694
May ’24
Popover from NSToolbarItem in Mac Catalyst app
Hi, Inside a Mac Catalyst app, I need to display a popover starting from an NSToolbarItem contained inside the app toolbar (like the Apple Maps Mac app does, see below image). In order to do that, when I press the button I need to find the toolbar item view and use it as popover anchor. How can I find the view or frame of an NSToolbarItem on Mac Catalyst? A property that could help me is the NSToolbarItem "view" property (NSView), but that property has been marked has unavailable in Mac Catalyst. Any idea? Thank you
3
3
1.9k
Feb ’24
Settings bundle with string catalog
Is it possible to use a string catalog to localize a settings bundle? Currently, to localize a Settings.bundle, we need to create a folder for each language with a single strings file inside. For example: Settings.bundle en.lproj > Root.strings fr.lproj > Root.strings de.lproj > Root.strings ... Any way to convert that to a string catalog? Thank you
2
2
2k
Jan ’24
String(localized:) return \' as thousands separator
Just found something weird with the String(localized:) method. Let's say that I have a "%lld apples" sentence inside a string catalog. If I call String(localized:"\(1000) apples") when on the device settings the number format is "1'234'567.89" and the device language is English, then the following string is returned: 1\'000 apples Any idea why the ' character has a backslash? It's a bug or I miss something? Thank you
1
0
821
Nov ’23
Localizer hint for object attributes
When using storyboards, string catalogs automatically grab translation comments from the "Localizer Hint" attribute of the objects in the storyboard. The problem is that we can only specify a single comment per object. What if we need to specify a specific comment for some of the attributes of the object? For example, I often need to provide a specific comment to each segment title of segmented control objects. Currently, I'm doing that by setting the managed property of each string to "Manual" and setting the comment directly from the string catalog. There is a better way to handle these cases?
0
0
582
Oct ’23
iOS 15 prewarming and didFinishLaunchingWithOptions
Hi, Just want to understand what is the current state of iOS 15 prewarming app delegate behaviour. There is a lot of confusion (and a lack of documentation) about which app delegate methods are called during prewarming. It's not clear if didFinishLaunchingWithOptions will be called or not during prewarming. A lot of applications are counting on UserDefaults and Keychain access in didFinishLaunchingWithOptions, but sadly these two features seems to be unavailable during prewarming causing issues. Some users say that this was the case before 15.4 and that from 15.4 the didFinishLaunchingWithOptions app delegate method is no more called during prewarming. Just want to know if we can have an official statement about this. It is safe, from iOS 15.4 onwards, to use UserDefaults and access Keychain in the didFinishLaunchingWithOptions app delegate method? Thank you
2
2
3k
Sep ’23
Clustering stop working after removing all annotations
Hi!I noticed a strange behavior on MapKit when using the iOS 11 clustering feature.If you add some annotations on a map (with same clusteringIdentifier and same displayPriority) MapKit will correctly merge together annotations that are close.The problem is that if you remove all the annotations and then you add them back the map will no more merge the annotation together. It’s like the clustering feature simply stop working.I don’t really know if it is a bug or if I miss something.Someone else have noticed this?Alan
6
0
5.5k
Sep ’23
Search bar in navigation bar displayed as icon
Hi, I have a controlled contained in a split view controller primary controller with a UISearchController assigned in navigationItem.searchController. On iPhone the search bar is directly displayed in the navigation bar. This is want I want. But on iPad, the search bar is hidden and a search button is displayed in the top right of the navigation bar. In order to display the search bar the user must click on the icon to display the search bar. I want the search bar to always be visible, like on iPhone. How can I achieve that? This is the code I use to include the UISearchController: let searchController = UISearchController(searchResultsController: nil) searchController.searchResultsUpdater = self searchController.obscuresBackgroundDuringPresentation = false searchController.hidesNavigationBarDuringPresentation = false navigationItem.searchController = searchController navigationItem.hidesSearchBarWhenScrolling = false And this is the result on both devices: Thank you
1
0
2.0k
Aug ’23
UITabBarController is unsupported as viewController
Hi, I'm testing one of my app on iOS 14 with Xcode 12 beta 3 (12A8169g) and I have a problem with my storyboards. Xcode give me this error for all the storyboards that contain a split view controller: An internal error occurred. Editing functionality may be limited. The log generated by the Xcode "Report a bug" button say: Exception name: NSInvalidArgumentException Exception reason: UITabBarController is unsupported as viewController for -[UISplitViewController setViewController:forColumn:] in Primary column It worked correctly on Xcode 12 beta 2. Has anyone encountered the same problem and found a way to fix it? Thank you
7
0
2.9k
Jul ’23
Loop through CoreData objects and memory issue
I have an entity named Image with a binary attribute named imageData. I need to cycle trough all Image objects and do something with the data contained inside the imageData attribute. This is the code: for image in managedObjectContext.allImages { autoreleasepool { var imageData = image.imageData } } I have a lot of objects and every imageData has something like 500KB of data for a total of 3GB of data. The problem is that each time the imageData attribute is used, the data go into memory and not released until the loop is done. This is causing the memory to grow up to 3GB crashing the app. I also tried to turn the object into a fault when I'm done with it by calling refresh(_:mergeChanges:) but nothing changes: for image in managedObjectContext.allImages { autoreleasepool { var imageData = image.imageData managedObjectContext.refresh(image, mergeChanges: false) } } How can I cycle trough all objects without filling up all the memory? Thank you
1
0
1.3k
Apr ’23
Files with "interim" extension inside _EXTERNAL_DATA
In a Core Data store I have a binary data attribute with “Allows External Storage” set to true. Everything work as expected, i.e. the data of this attribute is saved inside the _EXTERNAL_DATA folder. For every data stored into that attribute, a file is created inside _EXTERNAL_DATA with a UUID as file name and without extension. That's expected. For some reason the _EXTERNAL_DATA folder of a particular user was full of files with an “.interim” extension. Somebody know what are this files? In which cases files are saved with the ".interim" extension? Do we need to do anything with these files? Can they be deleted? Thank you
0
0
834
Mar ’23