I am working with a simple SwiftUI List and I want to enable functionality that allows files and images to be dropped onto the List from outside the app. There is an onInsert modifier with List that allows for this, but I found that it works on macOS, but not when running the same view on iOS.
I have sample code that I can't seem to post on this forum because it keeps giving me a validation error about "This post contains sensitive language". Maybe this will work:
Code to reproduce issue
Is there anything I can do to make this work on iOS?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
With iPadOS26, if I create a UITabBar, and use that to switch between views, the selected state never updates. I created this simple UIViewController to demonstrate the issue:
class SimpleTabBarController: UIViewController, UITabBarDelegate {
let tabBar = UITabBar()
let redItem = UITabBarItem(title: "Red", image: nil, tag: 0)
let blueItem = UITabBarItem(title: "Blue", image: nil, tag: 1)
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
tabBar.items = [redItem, blueItem]
tabBar.selectedItem = redItem
tabBar.delegate = self
tabBar.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(tabBar)
NSLayoutConstraint.activate([
tabBar.leadingAnchor.constraint(equalTo: view.leadingAnchor),
tabBar.trailingAnchor.constraint(equalTo: view.trailingAnchor),
tabBar.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor)
])
updateBackground(for: redItem)
}
func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
updateBackground(for: item)
}
private func updateBackground(for item: UITabBarItem) {
switch item.tag {
case 0: view.backgroundColor = .systemRed
case 1: view.backgroundColor = .systemBlue
default: view.backgroundColor = .white
}
}
}
The tabBar didSelect item method is called, and the background color gets updated as expected, but the selected state of the UITabBar stays the same.
I files a feedback for a related issue: FB17841678
Hi,
I have an app that uses Core Data to store user information and display it in various views. I want to know if it's possible to easily integrate this setup with FoundationModels to make it easier for the user to query and manipulate the information, and if so, how would I go about it? Can the model be pointed to the database schema file and the SQLite file sitting in the user's app group container to parse out the information needed? And/or should the NSManagedObjects be made @Generable for better output? Any guidance about this would be useful.
Hi,
I am testing a situation with shared CKRecords where the data in the CKRecord syncs fine, but the creatorUserRecordID.recordName and lastModifiedUserRecordID.recordName shows "defaultOwner" (which maps to the CKCurrentUserDefaultName constant) even though I made sure I edit the CKRecord value from a different iCloud account. In fact, on the CloudKit dashboard, it shows the correct user recordIDs in the metadata for the 'Created' and 'Modified' fields, but not in the CKRecord.
I am mostly testing this on the iPhone simulator with the debugger attached. Is that a possible reason for this, or is there some other reason the lastModifiedUserRecordID is showing the value for 'CKCurrentUserDefaultName'? It would be pretty difficult to build in functionality to look up changes by a different userID if this is the case.
I'm using the #Playground macro in Xcode 26.0, running on macOS 26.0. I can get the basics working, but I don't understand how it hooks into the rest of the app, like the App Delete or the Core Data stack. Do we have to create a new Core Data stack, like for SwiftUI Previews, or can it hook into the stack from the main app (if so, how)?
Hi,
I am trying to implement the UIMainMenuSystem for showing the menu bar in my iPad app in iOS26. I would like to be able to disable some elements when a particular UIViewController is displayed on the screen, and I can't figure out the best way to do this. I tried overriding the 'validateCommand' method in my view controller, but it doesn't seem to invoke the validation for menu items that are in the main menu.
Any tips on how to do this?
Hi,
Is it possible to use the iOS26 Liquid Glass icon on iOS 26 (built with Icon Composer), and use the old icon on iOS18 devices? I imported the icon file into my Xcode project and it seems to use the new icon on iOS18 (and earlier) devices as well.
Thanks.
In my UIKit app, in my view controller, I have a toolbar at the bottom of the screen and a UITextView, and I need to get the size of the toolbar to calculate the correct keyboard intersection, and change my text view layout so that the text doesn't get obscured when the keyboard is shown on screen. It's been working fine till now, but with iOS26, I am running into an issue, because the toolbar size is completely different.
For this code:
NSInteger offset = (self.navigationController.isToolbarHidden == NO)? (self.navigationController.toolbar.frame.size.height): 0;
iOS18 returns '49'
iOS26 returns ''812'.
This obviously throws off the calculations for keyboard avoidance.
Is there a way to overcome this, other than ignoring or hard-coding toolbar height?
Topic:
UI Frameworks
SubTopic:
UIKit
Hi,
I'm running Xcode version 26.0.1 (17A400). Every time I restart Xcode, it seems to not recognize my Claude login anymore, and I have to go through the whole authentication flow again. It's quite annoying. Does anyone have a solution for it?
Topic:
Developer Tools & Services
SubTopic:
Xcode
I'm deliberating on whether to use CloudKit for an app that requires sharing data amongst self-created groups of users (for e.g. sharing company-wide directories). I would use a public database for this, but I had a couple of questions:- if I create a subscription to listen to record changes for a partcular record type, will all the users get a notification when data changes, or only the logged-in iCloud user amongst his/her multiple devices? can there by 'group' notifications that cross iCloud users?- if there's no way for a 'group' of users to get notifications, I guess polling from the app to CloudKit would work, with the groupID part of the predicate? Or is there another options?Thanks.
Hi,I saw the WWDC talk on the new Contacts framework, and I had a couple of questions about the identifier property:When users upgrade from iOS8 to iOS9, will their old AddressBook recordIDs still work if we are using the AddressBook framework in the app (i.e. haven't upgraded to using Contacts framework)?Are the new CNContact identifiers consistent across iOS and Mac devices? i.e. if we have the identifier on one device, we can lookup the contact on another device with the same identifier?Can these identifiers change in the lifetime of that contact? This was a problem with AddressBook recordIDs ... if you removed the account and then synced it back again, all the contacts would get a different identifier. Same with restoring the device. Will the CNGroup and CNContainer identifiers also be consistent across devices?Hope someone in the Apple Contacts frameworks team can answer. Thanks.
HiI'm trying to use Xcode's "Build With Timing Summary" feature. It kicks off a build, and I can see the new build in the Build Reports navigator, but when I look through All Messages in the build results, there is "Timing Summary" information. It just says "Build Success - <date> - 75 seconds", but there isn't a breakdown of the timing results.My target builds an iOS app with many extensions, so I can't post the whole logs here. But is there any reason why I can't find the timing results? I do have that older Xcode flag 'ShowBuildOperationDuration' which still works, but only gives the same overall build summary time, not a breakdown.
Hi,
My app is free-to-download but with an in-app purchase to unlock all the features. A user wants to buy 15 copies of the "unlock" IAP and distribute it to his team, using MDM to distribute it easily.
I don't believe there is a way to do this through business purchases, is that right? You can only download apps through MDM but not in-app purchases. So what's the best way to do this? Are there any standard solutions?
Can I upload a new version of the app that's "paid up-front" but not available through the regular App Store, but only through MDM?
Hi,
I have an NSOutlineView, and each cell within that has an NSCollectionView (a horizontal one), setup using autolayout with the 'height' of the collectionView driving the height of the OutlineView cell. Each item in the collectionView can have a dynamic width, and I use a 'dummy' collectionView to size each item from it's contents, then getting the height of the collectionView and using a 'height constraint' to make each collectionView get the height it needs (and hence the cell have a dynamic height.
It works fine for the most part, but I get this warning multiple times in the console:
"The behavior of the UICollectionViewFlowLayout is not defined because: the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values.
The relevant UICollectionViewFlowLayout instance is <NSCollectionViewFlowLayout: 0x10e3b7f80>, and it is attached to <MacTagsCustomCollectionView: 0x10e3b7840>.
Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger."
I've tried Googling this, but I can't find a good explanation for this issue. Also, I'm not sure why it references 'UICollectionViewFlowLayout' when it's an AppKit app and uses NSCollectionView. Also, setting the 'UICollectionViewFlowLayoutBreakForInvalidSizes' symbolic breakpoint doesn't help since it never gets triggered.
Here is some code from my outlineView's viewForTableColumn, where I get the height of the collectionView and hence the height of the cell:
result = [outlineView makeViewWithIdentifier:@"DataWithTags" owner:self];
if (result.tagListCollectionView.delegate == nil) {
result.tagListCollectionView.delegate = self;
result.tagListCollectionView.dataSource = self;
result.tagsCollectionViewScrollView.automaticallyAdjustsContentInsets = NO;
result.tagListCollectionView
NSNib *cellNib = [[NSNib alloc] initWithNibNamed:@"MacTagsForPersonItem" bundle:nil];
[result.tagListCollectionView registerNib: cellNib forItemWithIdentifier:@"PersonTagsCollectionViewItemID"];
if (self.tagsSizingItem == nil) {
NSArray *topLevelObjects;
[cellNib instantiateWithOwner:self.tagsSizingItem topLevelObjects: &topLevelObjects];
for (id topLevelObject in topLevelObjects) {
if ([topLevelObject isKindOfClass:[MacPersonTagsCollectionViewItem class]]) {
self.tagsSizingItem = topLevelObject;
break;
}
}
}
result.tagListCollectionView.backgroundColors = @[[NSColor clearColor]];
result.tagListCollectionView.enclosingScrollView.backgroundColor = [NSColor clearColor];
result.tagsCollectionViewScrollView.verticalScroller.hidden = YES;
}
result.tagListCollectionView.tagsPerson = person;
[result.tagListCollectionView reloadData];
result.frame = outlineView.bounds;
[result layoutSubtreeIfNeeded];
[result.tagListCollectionView layoutSubtreeIfNeeded];
if (person.tagsCacheHeight == 0) {
	 person.tagsCacheHeight = result.tagListCollectionView.collectionViewLayout.collectionViewContentSize.height;
}
result.collectionViewHeightConstraint.constant = person.tagsCacheHeight;
Anyone with any idea on how to overcome this? I feel that it's responsible for some layout issues that I'm having in the view.
I am having a hard time uploading data to my CloudKit container in a series of operations. I have an 'uploader' function in my app that can populate the CloudKit private database with a lot of user data. I batch the records into multiple CKModifyRecordsOperations (with 300 records in each operation as a maximum), before I upload them. When I do this with a lot of data (less than 50MB even), I get CKErrorRequestRateLimited errors for some of the operations, with a value for CKErrorRetryAfterKey specified in the CKError. I respond by creating new operations for the same records, delaying them by the specified CKErrorRetryAfterKey key, and then retrying the operations. But those operations end up getting more CKErrorRequestRateLimited errors again. Usually one or two operations go through at a time, and all others have the same error, and then I have to retry again after 90 seconds or whatever the retry-key says. Doing all of this can take dozens of minutes to do a simple upload.
I checked the CloudKit dashboard, and for the container's 'developer' telemetry section, the 'server latency' seems very very high (over 100,000 for 95% percentile). It also suggests the 'average request size' is 150KB on average across the last few days as I've been testing this, which doesn't seem like a lot.
I've tried throttling the requests so only 20 modify operations are sent at a time, but it doesn't seem to help. I'm not sure what else I can try to improve this. I have 'query' indexes for 'recordName' field for each recordType, and 'query, searchable, sortable' on some of the custom fields on the recordTypes (though not all). The CKModifyRecordsOperations' configurations have 'qualityOfService' set to 'userInitiated'.
Is there anything else I can try to improve the upload speeds? Or is it out of my control?