Post

Replies

Boosts

Views

Activity

Reply to .bottomBar toolbar item missing after rotation in NavigationSplitView on iOS 26 (Regular width / compact height)
I hit this too (iOS 27, NavigationSplitView with .bottomBar items in the sidebar, on a device that changes size class - I tested on an iPhone Duo) and tracked down what’s happening. When the split view collapses or expands, UIKit moves the column’s hosting controller between two different navigation controllers: the column’s own one, and a separate compact one. The toolbar items move with the hosting controller, but the bar’s visibility (isToolbarHidden) belongs to each navigation controller, and SwiftUI doesn’t re-apply it after the move. So you can end up in a navigation controller whose bar is still hidden, even though your items are there. That’s why hiding/showing the sidebar or pushing/popping brings it back: those make it get set up again. SwiftUI seems to only re-send toolbar state when its value changes, so a workaround is to make the visibility depend on the horizontal size class: .toolbarVisibility(horizontalSizeClass == .compact ? .automatic : .visible, for: .bottomBar) The value changes on every collapse/expand, so it gets sent to whichever navigation controller is showing the column at that moment. The same thing breaks .matchedTransitionSource on a bottom-bar item (“Starting a zoom transition from a nil view…”). Each navigation controller builds its own bar button, and the source isn’t registered again on the one you move back to. Making the source ID depend on the size class fixes that too.
Topic: UI Frameworks SubTopic: SwiftUI
2w
Reply to Why does CloudKit data field (bytes) take up more (~10 times) iCloud storage than asset field?
Just wanted to clarify something on my post above. After running some tests and reading @DTS Engineer’s post again, I realized .externalStorage isn't related to whether an attribute is exported to CloudKit as an asset. This behavior also isn’t limited to the Data type. NSPersistentCloudKitContainer can convert variable-length attributes (Data, String, Transformable) into a CKAsset when exported to CloudKit. We don’t have direct control over when this occurs, but the documentation describes automatic conversion as needed to fit within CloudKit’s 1 MB record-size limit. Otherwise, Binary Data and Transformable values can be stored inline as BYTES, while Strings can remain String fields. So I can see why @DTS Engineer’s suggestion of adding a configuration option would help here. I submitted FB25290802, including a small sample project comparing three cases. 300 KB stored in a SwiftData Data attribute, exported as inline Bytes: 2.9 MB reported iCloud usage ❌. 300 KB uploaded directly as a CKAsset, leaving SwiftData empty: 300.4 KB reported iCloud usage ✅. 1 MB stored in a SwiftData Data attribute, automatically exported as an asset: 1 MB reported iCloud usage ✅. In this test, storing approximately 1 MB through SwiftData used less reported iCloud storage than storing 300 KB through the same attribute, which is completely unexpected. The feedback requests one or both of these changes: Add explicit asset-storage control to SwiftData and NSPersistentCloudKitContainer. Allow developers to request CKAsset storage for an attribute, or configure the automatic conversion threshold, while retaining managed synchronization. Reduce the storage cost of inline Bytes, or prefer assets where they materially reduce user quota usage. If inline storage provides necessary performance benefits, document those tradeoffs and let developers choose. I understand there may be technical reasons for the different representations, but the additional user storage cost is significant.
Topic: App & System Services SubTopic: iCloud Tags:
Oct ’26
Reply to Why does CloudKit data field (bytes) take up more (~10 times) iCloud storage than asset field?
Also running into this issue, where small chunks of externalStorage data are taking up ~10x the amount of iCloud storage space than the original file. Thank you for providing some clarity here @DTS Engineer. I personally don't think another API is the right fix for this. The truth is that we expect externalStorage to use the most efficient means of storing that data. Why would it not? I don't want to be the one deciding if data should be stored as a CKAsset or BYTES (how would I know which format is smallest?). What I want is for externalStorage to automatically use whatever field type is most efficient on my behalf. Is this a fix Apple can make on their end?
Topic: App & System Services SubTopic: iCloud Tags:
Oct ’26
Reply to .bottomBar toolbar item missing after rotation in NavigationSplitView on iOS 26 (Regular width / compact height)
I hit this too (iOS 27, NavigationSplitView with .bottomBar items in the sidebar, on a device that changes size class - I tested on an iPhone Duo) and tracked down what’s happening. When the split view collapses or expands, UIKit moves the column’s hosting controller between two different navigation controllers: the column’s own one, and a separate compact one. The toolbar items move with the hosting controller, but the bar’s visibility (isToolbarHidden) belongs to each navigation controller, and SwiftUI doesn’t re-apply it after the move. So you can end up in a navigation controller whose bar is still hidden, even though your items are there. That’s why hiding/showing the sidebar or pushing/popping brings it back: those make it get set up again. SwiftUI seems to only re-send toolbar state when its value changes, so a workaround is to make the visibility depend on the horizontal size class: .toolbarVisibility(horizontalSizeClass == .compact ? .automatic : .visible, for: .bottomBar) The value changes on every collapse/expand, so it gets sent to whichever navigation controller is showing the column at that moment. The same thing breaks .matchedTransitionSource on a bottom-bar item (“Starting a zoom transition from a nil view…”). Each navigation controller builds its own bar button, and the source isn’t registered again on the one you move back to. Making the source ID depend on the size class fixes that too.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
2w
Reply to Why does CloudKit data field (bytes) take up more (~10 times) iCloud storage than asset field?
Just wanted to clarify something on my post above. After running some tests and reading @DTS Engineer’s post again, I realized .externalStorage isn't related to whether an attribute is exported to CloudKit as an asset. This behavior also isn’t limited to the Data type. NSPersistentCloudKitContainer can convert variable-length attributes (Data, String, Transformable) into a CKAsset when exported to CloudKit. We don’t have direct control over when this occurs, but the documentation describes automatic conversion as needed to fit within CloudKit’s 1 MB record-size limit. Otherwise, Binary Data and Transformable values can be stored inline as BYTES, while Strings can remain String fields. So I can see why @DTS Engineer’s suggestion of adding a configuration option would help here. I submitted FB25290802, including a small sample project comparing three cases. 300 KB stored in a SwiftData Data attribute, exported as inline Bytes: 2.9 MB reported iCloud usage ❌. 300 KB uploaded directly as a CKAsset, leaving SwiftData empty: 300.4 KB reported iCloud usage ✅. 1 MB stored in a SwiftData Data attribute, automatically exported as an asset: 1 MB reported iCloud usage ✅. In this test, storing approximately 1 MB through SwiftData used less reported iCloud storage than storing 300 KB through the same attribute, which is completely unexpected. The feedback requests one or both of these changes: Add explicit asset-storage control to SwiftData and NSPersistentCloudKitContainer. Allow developers to request CKAsset storage for an attribute, or configure the automatic conversion threshold, while retaining managed synchronization. Reduce the storage cost of inline Bytes, or prefer assets where they materially reduce user quota usage. If inline storage provides necessary performance benefits, document those tradeoffs and let developers choose. I understand there may be technical reasons for the different representations, but the additional user storage cost is significant.
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Oct ’26
Reply to Why does CloudKit data field (bytes) take up more (~10 times) iCloud storage than asset field?
Also running into this issue, where small chunks of externalStorage data are taking up ~10x the amount of iCloud storage space than the original file. Thank you for providing some clarity here @DTS Engineer. I personally don't think another API is the right fix for this. The truth is that we expect externalStorage to use the most efficient means of storing that data. Why would it not? I don't want to be the one deciding if data should be stored as a CKAsset or BYTES (how would I know which format is smallest?). What I want is for externalStorage to automatically use whatever field type is most efficient on my behalf. Is this a fix Apple can make on their end?
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Oct ’26