Construct and manage graphical, event-driven user interfaces for iOS or tvOS apps using UIKit.

Posts under UIKit tag

200 Posts

Post

Replies

Boosts

Views

Activity

What are the requirements of isSIMInserted api newly introduced from iOS 18 onwards
Hello Folks, I recently came through a new API introduced from iOS 18 onwards isSIMInserted and according to the document it is A Boolean property that indicates whether a SIM is present. I really appreciate Apple for introducing such an useful API but there are few queries on what are the requirements for using this API. Query 1: Do we need any special entitlements for making use of this API. ? If yes then what are those entitlements and are these entitlements available openly or we have to raise special request to apple for such entitlements? Query 2: What are the entries required to be added in info.plist for supporting the isSIMInserted api to work. Query 3: Is isSIMInserted api available for all type of apps because mine is a financial stock related app and i am looking forward to use this API for providing more security to the end user while registering through sms. As per the below link this api is only available for mobile Carrier apps but in official document there is no such mention. https://forums.developer.apple.com/forums/thread/760991 Please kindly help me on these queries ? Regards, Carol
4
0
641
Jan ’25
Regarding the issue of navigation bar hierarchy in iOS 18
I have discovered a strange phenomenon about iOS18.1.1. I set a logo as the titleView in my navigationBar, and then when I added a view to the navigationBar and pushed it to another page before popping it back up, I found that the view hierarchy of the navigationBar would change in a very short time. In this short time, the logo would cover the view. I did not find this phenomenon on devices below iOS18.1.1. I would like to know what changes have occurred in iOS18.1.1 that caused the view hierarchy to change during the pop process. I hope someone can help me. Thank you very much
3
0
647
Jan ’25
Adopt UIFindInteraction across multiple views
We are currently trying to adopt the newly introduced find bar in our app. The app: The app is a text editor with a main text view. However it includes nested views (for text like footnotes) that are presented as modal sheets. So you tap on the footnote within the main text, a form sheet is presented with the contents of the footnote ready to be edited. We have an existing search implementation, but are eager to move to the system-provided UI. Connecting the find bar through a custom UIFindSession with our existing implementation is working without any issues. The Problem: Searching for text does not only work in the main text view, but also nested text (like footnotes). Let's say I have a text containing the word "iPhone" both in the main text and the footnote. In our existing implementation, stepping from the search match to the next one would open the modal and highlight the match in the nested text. The keyboard would stay open. With the new UIFindInteraction this is not working however. As soon as a modal form sheet is presented, the find interaction closes. By looking at the stack trace I can see a private class called UIInputWindowController that cleans up input accessory views after the modal gets presented. I believe it is causing the find panel to give up its first responder state. I noticed that opening popovers appears to be working fine. Is there a way to alter the presentation of the nested text so that the view is either not modal or able to preserve the current find session? Or is this unsupported behavior and we should try and look for a different way? The thing that really confuses me is that this appears to work without issue in Notes.app. There the find bar is implemented as well. There are multiple views that can be presented while the find bar is open. Move Note is one of them. The view appears as a modal sheet. It keeps the find bar open and active, though its tint color matches the deactivated one of the main Notes view. The find bar is still functional with the text field being active and the overlay updating in the background. This behavior appears to be a bug in the Notes app, but is exactly what we want for our use case. I attached some images: Two are from the Notes app, two from a test project demonstrating the problem. Opening a modal view closes the find bar there.
2
0
1.3k
Jan ’25
iOS18 UIPinchGestureRecognizer finger change
Before ios18, when two fingers are switched to single fingers, the printing scale value will not change. When switching to two fingers again, the pinch and zoom printing scale will change. The same operation is performed after ios18, and two fingers are switched to single fingers. Switch back to two fingers, and the scale printing will not change. code here: - (void)pinchGesture:(UIPinchGestureRecognizer *)recognizer { NSSet <UIEvent*> *events = [recognizer valueForKey:@"_activeEvents"]; UIEvent *event = [events anyObject]; if (recognizer.state == UIGestureRecognizerStateBegan) { NSLog(@"---- begin finger count: %d scale: %f",event.allTouches.count,recognizer.scale); recognizer.scale = 1.0; } else if (recognizer.state == UIGestureRecognizerStateChanged) { NSLog(@"---- change finger count: %d scale: %f",event.allTouches.count,recognizer.scale); // recognizer.scale = 1.0; } log image for iOS 17.7 log image for ios18.0.2
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
273
Jan ’25
MacCatalyst Scene Frame needs adjustment
I don't know why, but for my MacCatalyst target, I have to make my view controller Y orgin 36 and the subtract the view height by 36 points, or the view is clipped. The following works in my main UIViewController, but feels super hacky. I'd feel better if I understood the issue and addressed it properly. override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() #if targetEnvironment(macCatalyst) if view.frame.origin.y < 1 { let f = UIApplication.shared.sceneBounds let newFrame = CGRect(x: 0.0, y: 36, width: f.size.width, height: f.size.height - 36) self.view.frame = newFrame } #endif } My guess is it starts the view under the title bar, but I have these set in the view controller: self.extendedLayoutIncludesOpaqueBars = false self.edgesForExtendedLayout = []
1
0
421
Jan ’25
iOS 18.1 crash UIHostingView.layoutSubviews() / swift_unknownObjectWeakAssign / objc_storeWeak
We're seeing sporadic crashes on devices running iOS 18.1 - both beta and release builds (22B83). The stack trace is always identical, a snippet of it below. As you can tell from the trace, it's happening in places we embed SwiftUI into UIKit via UIHostingController. Anyone else seeing this? 4 libobjc.A.dylib 0xbe2c _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 30 5 libobjc.A.dylib 0xb040 weak_register_no_lock + 396 6 libobjc.A.dylib 0xac50 objc_storeWeak + 472 7 libswiftCore.dylib 0x43ac34 swift_unknownObjectWeakAssign + 24 8 SwiftUI 0xeb74c8 _UIHostingView.base.getter + 160 9 SwiftUI 0x92124 _UIHostingView.layoutSubviews() + 112 10 SwiftUI 0x47860 @objc _UIHostingView.layoutSubviews() + 36
8
1
1.1k
Jan ’25
How to suppress the prohibition mark (🚫) in UITableView drag-and-drop operations?
Question How can I suppress this prohibition mark during this operation? Background I am implementing drag-and-drop functionality in a UITableView to allow users to reorder cells. During the drag operation, when a cell is dragged back to its original position, a prohibition mark (🚫) appears over the cell. I have reviewed the API documentation for UITableViewDragDelegate and UITableViewDropDelegate, but I could not find any clear way to suppress this mark. The behavior does not impact functionality but is visually unappealing. What I Tried Customizing UITableViewDropProposal: I ensured that operation is set to .move and intent to .insertAtDestinationIndexPath. This did not resolve the issue. Customizing drag preview: Using dragPreviewParametersForRowAt to set a clear background. The prohibition mark still appeared. Verifying drop session: Checked the UIDropSession state in dropSessionDidUpdate to ensure valid drop handling. Environment Xcode Version: Version 16.2 Testing Device: iPhone 16 pro + iOS 18.2 Steps to Reproduce Code Example Create new app with this ViewController import UIKit class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UITableViewDragDelegate, UITableViewDropDelegate { let tableView = UITableView() var items = ["Item 1", "Item 2", "Item 3", "Item 4"] override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .white tableView.delegate = self tableView.dataSource = self tableView.dragDelegate = self tableView.dropDelegate = self tableView.dragInteractionEnabled = true tableView.translatesAutoresizingMaskIntoConstraints = false tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell") tableView.separatorStyle = .none tableView.layer.cornerRadius = 10 tableView.backgroundColor = UIColor.systemGray6 view.addSubview(tableView) NSLayoutConstraint.activate([ tableView.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.5), tableView.centerXAnchor.constraint(equalTo: view.centerXAnchor), tableView.topAnchor.constraint(equalTo: view.topAnchor, constant: 50), tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -50) ]) } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return items.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) cell.textLabel?.text = items[indexPath.row] cell.textLabel?.textAlignment = .center cell.backgroundColor = UIColor.systemBlue.withAlphaComponent(0.2) cell.layer.cornerRadius = 10 cell.clipsToBounds = true return cell } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 60 } func tableView(_ tableView: UITableView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) -> [UIDragItem] { let dragItem = UIDragItem(itemProvider: NSItemProvider(object: items[indexPath.row] as NSString)) dragItem.localObject = items[indexPath.row] return [dragItem] } func tableView(_ tableView: UITableView, dropSessionDidUpdate session: UIDropSession, withDestinationIndexPath destinationIndexPath: IndexPath?) -> UITableViewDropProposal { guard destinationIndexPath != nil else { return UITableViewDropProposal(operation: .cancel) } return UITableViewDropProposal(operation: .move, intent: .insertAtDestinationIndexPath) } func tableView(_ tableView: UITableView, performDropWith coordinator: UITableViewDropCoordinator) { guard let destinationIndexPath = coordinator.destinationIndexPath, let dragItem = coordinator.items.first?.dragItem.localObject as? String else { return } if let sourceIndex = items.firstIndex(of: dragItem) { tableView.performBatchUpdates { items.remove(at: sourceIndex) items.insert(dragItem, at: destinationIndexPath.row) tableView.moveRow(at: IndexPath(row: sourceIndex, section: 0), to: destinationIndexPath) } coordinator.drop(coordinator.items.first!.dragItem, toRowAt: destinationIndexPath) } } } Run simulator and start dragging a cell without moving it to a different position. Observe that a prohibition mark appears at the upper right of the cell Any guidance would be greatly appreciated. Thank you in advance!
1
0
352
Jan ’25
view controller life cycle bug in xcode 16 ios 18
hi does any one know if there changes in lifecycle in xcode 16 ios 18 cause i notice that my view will appear does what view didappear use to do in older version and it kind of a problem cause all the rest of ios work diffrently does anyone else found a problem with it? or does anyone know if there was a known change to life cycles
0
0
409
Jan ’25
Converting iPad app to an iPhone app
I have an iPad developed using UIKit and storyboards now I have to develop UI for iPhone. Designs for iPhone app are completely new from iPad app also navigation is different. I have question regarding should I make different view controllers for iPhone and iPad and different storyboard
Topic: Design SubTopic: General Tags:
2
0
472
Jan ’25
Could someone test if Settings in iOS 18.2 are broken ?
Apparently, settings do not show anymore the apps settings in iOS 18.2. I tested on simulators (Xcode 16.2) both on iOS 18.1 and iOS 18.2 and got very different results: In iOS 18.1 simulator, I see the settings of a lot of apps. In iOS 18.2 simulator, not a single app setting. That is a really serious issue in simulator for development (I filed a bug report FB16175635), but would be really critical on device as it would make it impossible to adjust setting of many apps. Unless I missed something (meta setting ?) in iOS 18.2 ? I have not upgraded to 18.2 notably for this reason. So I would appreciate if someone who has upgraded could make the test and report ? select Settings on Home page scroll to Apps category tap here to access the list Does the list show anything ? Thanks for your help.
1
1
1.1k
Jan ’25
About the button arrangement of AlertController
I encountered an issue while using the AlertController. When I added two buttons (cancel, confirm), they were arranged left and right. When the word count of the two buttons was high, they became arranged vertically. I would like to know what changes this adaptive arrangement is based on? Or, when the word count of a button exceeds a certain limit, it will become arranged in a top and bottom sequence? I did not find any explanation about this in the development documentation. I hope someone can help me. Thank you very much.
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
316
Jan ’25
Foundation _userInfoForFileAndLine crash
Could anyone give some insights to identify the root cause for this crash? Fatal Exception: NSInternalInconsistencyException Layout requested for visible navigation bar, <UINavigationBar: 0x120e74280; frame = (0 0; 430 56); autoresize = W; tintColor = <UIDynamicProviderColor: 0x300488b20; provider = <__NSMallocBlock__: 0x300a60900>>; layer = <CALayer: 0x3000f0380>> delegate=0x1277a4600 standardAppearance=0x302d5c770 scrollEdgeAppearance=0x302d5d500, when the top item belongs to a different navigation bar. topItem = <UINavigationItem: 0x10a7d8500> title='Transfers' style=navigator leftBarButtonItems=0x300690020 rightBarButtonItems=0x300613ff0, navigation bar = <UINavigationBar: 0x11a8ef200; frame = (0 0; 430 44); opaque = NO; autoresize = W; layer = <CALayer: 0x3002a44c0>> delegate=0x1277a0c00, possibly from a client attempt to nest wrapped navigation controllers. ==== Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x827cc __exceptionPreprocess 1 libobjc.A.dylib 0x172e4 objc_exception_throw 2 Foundation 0x80f8d8 _userInfoForFileAndLine 3 UIKitCore 0x2b63e8 -[UINavigationBar layoutSubviews] 4 UIKitCore 0xd688 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] 5 UIKitCore 0x14dc14 -[UINavigationBar layoutSublayersOfLayer:] 6 QuartzCore 0x78c28 CA::Layer::layout_if_needed(CA::Transaction*) 7 QuartzCore 0x787b4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) 8 QuartzCore 0xcf914 CA::Context::commit_transaction(CA::Transaction*, double, double*) 9 QuartzCore 0x4e7c4 CA::Transaction::commit() 10 QuartzCore 0x91a0c CA::Transaction::flush_as_runloop_observer(bool) 11 UIKitCore 0xa3568 _UIApplicationFlushCATransaction 12 UIKitCore 0xa0b64 __setupUpdateSequence_block_invoke_2 13 UIKitCore 0xa09d8 _UIUpdateSequenceRun 14 UIKitCore 0xa0628 schedulerStepScheduledMainSection 15 UIKitCore 0xa159c runloopSourceCallback 16 CoreFoundation 0x56328 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 17 CoreFoundation 0x562bc __CFRunLoopDoSource0 18 CoreFoundation 0x53dc0 __CFRunLoopDoSources0 19 CoreFoundation 0x52fbc __CFRunLoopRun 20 CoreFoundation 0x52830 CFRunLoopRunSpecific 21 GraphicsServices 0x11c4 GSEventRunModal 22 UIKitCore 0x3d2eb0 -[UIApplication _run] 23 UIKitCore 0x4815b4 UIApplicationMain 24 XX 0xa0f64 main + 7 (main.m:7) 25 ??? 0x1abb6eec8 (Missing)
1
0
967
Jan ’25
UIViewController.view.backgroundColor auto changed when present
This is easy to reproduce,in dark mode, 2 UIViewControllers A and B, A present B. code: class AAA: UIViewController { override func viewDidLoad() { super.viewDidLoad() navigationItem.title = "AAA" view.backgroundColor = .systemBackground } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { present(UINavigationController(rootViewController: BBB()), animated: true) } } class BBB: UIViewController { override func viewDidLoad() { super.viewDidLoad() navigationItem.title = "BBB" view.backgroundColor = .systemBackground } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { dismiss(animated: true) } } before present: after present: Obviously, the backgroundColor of the view has changed. I guess it's because view's backgroundColor is the same as the the window, so changed the color to distinguish between the controller and the background, but this brought unexpected changes which is confusing. I want to know how this happened and how I can manually control it
1
0
281
Jan ’25
LazyVGrid inside a List Crashes on iPhone 15 Pro Max (iOS 18.x) Simulator
We've seen an issue when using a LazyVGrid inside a List. The app crashes with: Thread 1: Fatal error: <UpdateCoalescingCollectionView 0x600000ca0d20> is stuck in a recursive layout loop When debugging the issue, we were able to narrow down the issue to a minimum reproducible example below: struct ContentView: View { let columns = [ GridItem(.adaptive(minimum: 43)) ] var body: some View { List { LazyVGrid(columns: columns) { ForEach(0..<15) { value in if value == 0 { Text("a") } else { Color.clear } } } } } } The issue can be reproduced on iPhone 15 Pro Max and iOS 18.x specifically. In a production app we have a similar layout, but instead of GridItem(.adaptive) we use GridItem(.flexible).
3
2
547
Jan ’25
UICollectionView Move Item Method Not Called in iOS 18
Summary In iOS 18, the UICollectionViewDelegate method collectionView(_:targetIndexPathForMoveOfItemFromOriginalIndexPath:atCurrentIndexPath:toProposedIndexPath:) is not being called when moving items in a UICollectionView. This method works as expected in iOS 17.5 and earlier versions. Steps to Reproduce Create a UICollectionView with drag and drop enabled. Implement the UICollectionViewDelegate method: func collectionView(_ collectionView: UICollectionView, targetIndexPathForMoveOfItemFromOriginalIndexPath originalIndexPath: IndexPath, atCurrentIndexPath currentIndexPath: IndexPath, toProposedIndexPath proposedIndexPath: IndexPath) -> IndexPath { print("🐸 Move") return proposedIndexPath } Run the app on iOS 18. Attempt to drag and drop items within the collection view. Expected Behavior The method should be called during the drag and drop operation, and "🐸 Move" should be printed to the console. Actual Behavior The method is not called, and nothing is printed to the console. The drag and drop operation still occurs, but without invoking this delegate method. Configuration iOS Version: 18 Xcode Version: Xcode 16.0.0
Topic: UI Frameworks SubTopic: UIKit Tags:
3
3
594
Dec ’24
iOS app crash at -[UIView _wrappedProcessTraitChanges:withBehavior:] + 1288 (UIView.m:0)
Hello Apple engineers, could you help me understand whether this crash is a UIKit bug or something in our code that causes it. Based on the documentation it is an invalid fetch instruction, that's why I suspect UIKit. I've found a similar crash here on the forums reported a year ago, it seemed to be a UIKit bug - https://forums.developer.apple.com/forums/thread/729448. I've attached the full crash report (the app name was replaced with ): Thread 0 Crashed: 0 libobjc.A.dylib 0x000000019daf7c20 objc_msgSend + 32 (:-1) 1 UIKitCore 0x00000001a3020c50 -[UIView _wrappedProcessTraitChanges:withBehavior:] + 1288 (UIView.m:0) 2 UIKitCore 0x00000001a3020720 -[UIView _processChangesFromOldTraits:toCurrentTraits:withBehavior:] + 196 (UIView.m:7840) 3 UIKitCore 0x00000001a3020618 -[UIView _updateTraitCollectionAndProcessChangesWithBehavior:previousCollection:] + 112 (UIView.m:7831) 4 UIKitCore 0x00000001a2fa90c0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 944 (UIView.m:19850) 5 QuartzCore 0x00000001a22dfc28 CA::Layer::layout_if_needed(CA::Transaction*) + 496 (CALayer.mm:10944) 6 QuartzCore 0x00000001a22df7b4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148 (CALayer.mm:2638) 7 QuartzCore 0x00000001a2336914 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 472 (CAContextInternal.mm:2613) 8 QuartzCore 0x00000001a22b57c4 CA::Transaction::commit() + 648 (CATransactionInternal.mm:420) 9 QuartzCore 0x00000001a22f8a0c CA::Transaction::flush_as_runloop_observer(bool) + 88 (CATransactionInternal.mm:928) 10 UIKitCore 0x00000001a303f568 _UIApplicationFlushCATransaction + 52 (UIApplication.m:3326) 11 UIKitCore 0x00000001a303cb64 __setupUpdateSequence_block_invoke_2 + 332 (_UIUpdateScheduler.m:1652) 12 UIKitCore 0x00000001a303c9d8 _UIUpdateSequenceRun + 84 (_UIUpdateSequence.mm:136) 13 UIKitCore 0x00000001a303c628 schedulerStepScheduledMainSection + 172 (_UIUpdateScheduler.m:1171) 14 UIKitCore 0x00000001a303d59c runloopSourceCallback + 92 (_UIUpdateScheduler.m:1334) 15 CoreFoundation 0x00000001a080c328 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1970) 16 CoreFoundation 0x00000001a080c2bc __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2014) 17 CoreFoundation 0x00000001a0809dc0 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2051) 18 CoreFoundation 0x00000001a0808fbc __CFRunLoopRun + 840 (CFRunLoop.c:2969) 19 CoreFoundation 0x00000001a0808830 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434) 20 GraphicsServices 0x00000001ec7e81c4 GSEventRunModal + 164 (GSEvent.c:2196) 21 UIKitCore 0x00000001a336eeb0 -[UIApplication _run] + 816 (UIApplication.m:3844) 22 UIKitCore 0x00000001a341d5b4 UIApplicationMain + 340 (UIApplication.m:5496) 23 UIKitCore 0x00000001a3757fa8 UIApplicationMain(_:_:_:_:) + 104 (UIKit.swift:565) 24 <Redacted> 0x00000001028bde64 specialized static UIApplicationDelegate.main() + 28 (/<compiler-generated>:16) 25 <Redacted> 0x00000001028bde64 static AppDelegate.$main() + 28 (AppDelegate.swift:0) 26 <Redacted> 0x00000001028bde64 main + 116 27 dyld 0x00000001c61f6ec8 start + 2724 (dyldMain.cpp:1334) 2024-12-27_20-53-28.2129_-0500-353aaa194e6232c0d1fae767296bdb8c47c30498.crash
2
1
513
Dec ’24
otential Optimization or Bug in UINavigationController Push Operation in iOS 18
Issue Description: In iOS 18, when setting the root view controller of a UINavigationController and immediately pushing another view controller, the root view controller's lifecycle methods, such as viewDidLoad(), are not called as expected. This issue does not occur in previous iOS versions. There is no mention of this behavior in the iOS 18 release notes, and it is causing significant issues in our application. Steps to Reproduce: Set the root view controller of a UINavigationController. Immediately push another view controller. Observe that the root view controller's lifecycle methods, such as viewDidLoad(), are not called. Example Code: Swift import UIKit class HomeViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() print("HomeViewController viewDidLoad") } } class SecondViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() print("SecondViewController viewDidLoad") } } @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { window = UIWindow(frame: UIScreen.main.bounds) let home = HomeViewController() let rootNav = UINavigationController(rootViewController: home) window?.rootViewController = rootNav window?.makeKeyAndVisible() let secondViewController = SecondViewController() home.navigationController?.pushViewController(secondViewController, animated: true) return true } } Expected Behavior: The root view controller's lifecycle methods, such as viewDidLoad(), should be called when setting it as the root view controller of a UINavigationController. Actual Behavior: In iOS 18, the root view controller's lifecycle methods are not called when it is set as the root view controller and another view controller is immediately pushed. Impact: This issue affects the proper initialization and setup of the root view controller, causing significant disruptions in our application's workflow. Device Information: iOS Version: iOS 18 Test Devices: iPhone 15, iPhone 16 Additional Information: We would appreciate any insights or updates on whether this is an intended optimization or a potential bug. This issue is causing significant disruption to our application, and a timely resolution would be greatly appreciated.
3
0
435
Dec ’24
UIColor labelColor in macOS made-for-iPad app is not solid black
When my iOS app runs on macOS in "designed for iPad" mode, the system foreground colour RGBA values seem strange. Looking at [UIColor labelColor], [UIColor secondaryLabelColor] etc. on iOS, I see values like these: (Light Mode) // R G B A fg0 = 0 0 0 255 fg1 = 10 10 13 153 fg2 = 10 10 13 76 fg3 = 10 10 13 45 Note in particular that fg0, aka labelColor, is solid black. When I run it on my Mac, the values I see are: // R G B A fg0 = 0 0 0 216 fg1 = 0 0 0 127 fg2 = 0 0 0 66 fg3 = 0 0 0 25 Here, fg0 has alpha = 216. The result is that it looks like a dark grey, on a white background. Of course it's reasonable for macOS to have a different colour palette than iOS - but native macOS apps seem to have solid 100% black as their foreground colour. Do others see this? What should I be doing? Note that I'm getting colour values using UIColor's getRed: blue: green: alpha: method and then using these colour values for some custom GPU drawing. Previously I was using solid black and white, but at some point I updated it to use UIColor in order to respond to light/dark-mode changes.
0
0
406
Dec ’24
Critical Issue in iOS 18 Beta: UITabBarController Child View Controller Incorrectly Added as UITabBarItem, Leading to Application Crash
I am writing to report an issue I encountered with iOS 18 beta that affects my application, which has been available on the App Store for over two years and currently has over 60,000 active users. My application utilizes a UITabBarController to manage multiple tabs, where each tab hosts a UIViewController embedded within a UINavigationController. The application operates in two different states, where users may have either 5, 4, or 3 tabBarItems depending on their configuration. The issue arises when fewer than 5 tabs are present. In these cases, I add child view controllers to the UITabBarController to ensure they are displayed above the tab bar, rather than below it. The relevant code snippet is as follows: tabBarController.addChild(childController) tabBarController.view.addSubview(childController.view) Prior to iOS 18, this implementation functioned as expected. However, with the release of iOS 18, adding a child view controller to the UITabBarController results in the child being incorrectly added as a UITabBarItem. This misbehavior leads to an application crash when the unintended tab is selected. The crash trace is as follows: "Inconsistency in UITabBar items and view controllers detected. No view controller matches the UITabBarItem '<UITabBarItem: 0x142d9c480> selected'." I have attached screenshots from iOS 18 and previous versions to illustrate the issue, which compares the expected behavior in earlier iOS versions with the problematic behavior in iOS 18. I appreciate your attention to this matter and look forward to any guidance or resolution you can provide.
6
0
2.4k
Dec ’24