Hi everyone,
I’m currently developing a SwiftUI app that uses SwiftData with CloudKit sharing enabled. The app works fine on my own Apple ID, and local syncing with iCloud is functioning correctly — but sharing with other Apple IDs consistently fails.
Setup:
SwiftUI + SwiftData using a ModelContainer with .shared configuration
Sharing UI is handled via UICloudSharingController
iCloud container: iCloud.com.de.SkerskiDev.FoodGuard
Proper entitlements enabled (com.apple.developer.icloud-services, CloudKit, com.apple.developer.coredata.cloudkit.containers, etc.)
Automatic provisioning profiles created by Xcode
Error:<CKError 0x1143a2be0: "Bad Container" (5/1014);
"Couldn't get container configuration from the server for container iCloud.com.de.SkerskiDev.FoodGuard">
What I’ve tried:
Verified the iCloud container is correctly created and enabled in the Apple Developer portal
Checked bundle identifier and container settings
Rebuilt and reinstalled the app
Ensured correct iCloud entitlements and signing capabilities
Questions:
Why does CloudKit reject the container for sharing while local syncing works fine?
Are there known issues with SwiftData .shared containers and multi-user sharing?
Are additional steps required (App Store Connect, privacy settings) to allow sharing with other Apple IDs?
Any advice, experience, or example projects would be greatly appreciated. 🙏
Thanks!
Sebastian
SwiftUI
RSS for tagProvide views, controls, and layout structures for declaring your app's user interface using SwiftUI.
Posts under SwiftUI tag
200 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
i am struggling to get my tab view to work, when i call views in the action part of my tab view, my background creates issue? does anyone know how to fix this?
struct ContentView: View {
@Environment(.colorScheme) var colorMode
let Color1: Color = .cyan
var Color2: Color {
colorMode == .dark ? .black : .white
}
var TextColor: Color{
colorMode == .dark ? .black : .black
}
let tax: Double = 0.0875
var OptionTypes: [String] = ["Breakfeast", "Lunch", "Dinner", "Dessert", "Drinks"]
var BreakfeastFoods: [Food] = [
Food(Name: "Eggs Benedict", Price: 9.50),
Food(Name: "Avocado Toast", Price: 5.75),
Food(Name: "French Toast", Price: 12.50),
Food(Name: "Waffles", Price: 7.25),
Food(Name: "Pancakes", Price: 8.60)
]
var LunchFoods: [Food] = [
Food(Name: "Tuna Salad", Price: 11.25),
Food(Name: "Pizza", Price: 22.50),
Food(Name: "Chicken Sandwitch", Price: 8.95),
Food(Name: "French Fries", Price: 5.15),
Food(Name: "Macaroni and Cheese", Price: 7.50)
]
var DinnerFoods: [Food] = [
Food(Name: "Ribeye Steak", Price: 18.99),
Food(Name: "Pork Ribs", Price: 21.75),
Food(Name: "Salmon", Price: 15.00),
Food(Name: "Burrito Bowl", Price: 13.99),
Food(Name: "Chicken Fajitas", Price: 20.50)
]
var DessertFoods: [Food] = [
Food(Name: "Ice Cream Sundae", Price: 10.00),
Food(Name: "Fudge Brownie", Price: 4.85),
Food(Name: "Chocolate Cake Slice", Price: 6.10),
Food(Name: "Pumpkin Pie", Price: 6.10),
Food(Name: "Ice Cream Float", Price: 3.50)
]
var Drinks: [Food] = [
Food(Name: "Water", Price: 0.00),
Food(Name: "Sparkling Water", Price: 2.15),
Food(Name: "Soda", Price: 3.00),
Food(Name: "Coffee", Price: 2.50),
Food(Name: "Hot Chocolate", Price: 3.50)
]
@State var MyCart: [Food] = []
var body: some View {
NavigationStack{
ZStack{
LinearGradient(colors: [Color1, Color2], startPoint: .top, endPoint: .bottom).ignoresSafeArea()
VStack(spacing: 40){
ForEach(OptionTypes, id: \.self){
OptionType in
NavigationLink(value: OptionType){
Text(OptionType)
}.frame(width: 250, height: 70).background(LinearGradient(colors: [.cyan, .white,.cyan], startPoint: .topLeading, endPoint: .bottom)).foregroundStyle(TextColor).cornerRadius(100).font(.system(size: 25, weight: .medium)).padding(.top, 16)
}
}.navigationDestination(for: String.self) {
OptionType in
switch OptionType{
case "Breakfeast":
BreakFeastView(BreakfeastList: BreakfeastFoods, Color1: Color1, Color2: Color2)
case "Lunch":
LunchView(LunchList: LunchFoods, Color1: Color1, Color2: Color2)
case "Dinner":
DinnerView(DinnerList: DinnerFoods, Color1: Color1, Color2: Color2)
case "Dessert":
DessertView(DessertList: DessertFoods, Color1: Color1, Color2: Color2)
case "Drinks":
DrinksView(DrinksList: Drinks, Color1: Color1, Color2: Color2)
// case "My Cart":
// MyCartView(MyCartList: MyCart, Color1: Color1, Color2: Color2)
default:
Text("Error")
}
}
} .navigationTitle("Choose Menu")
TabView{
Tab("Menu", systemImage: "fork.knife"){
}
Tab("My-Cart", systemImage: "cart.fill"){
}
Tab("Store Location", systemImage: "mappin"){
}
}
}
}
}
When using the fullScreenCover API in iOS 26, the content of the displayed view overlaps the content of the view that triggered the fullScreenCover. This issue is not present in iOS 18 and earlier versions.
Feedback ID: FB19165084
Hello,
I have a SwiftUI application that uses NavigationSplitView. It's working great on iOS, iPad, and macOS. I decided to give it a try on tvOS. After it builds, it will not allow user interaction on the NavigationSplitView's sidebar. I've tried various view focus modifiers without any success. I'd also expect this to "just work" as default behavior. I have filed FB13447961 on this issue. Here is a distillation of the code that demonstrates the problem. Any ideas? Thank you.
enum Category : String, CaseIterable {
case first
case second
case third
}
enum Detail : String, CaseIterable {
case one
case two
case three
}
struct DetailView : View {
let category : Category?
var body: some View {
if let category {
Text(category.rawValue)
List(Detail.allCases, id: \.self) { detail in
NavigationLink(value: detail) {
Text(detail.rawValue)
}
}
} else {
Text("Select Category")
}
}
}
struct ContentView: View {
// NOTE: If this category is set to something, it will show that category's detail.
// The problem is that the NavigationSplitView sidebar does not have, nor does not
// seem to be able to get focus.
@State var category: Category?
@State var path : [Detail] = []
var body: some View {
NavigationSplitView {
List(Category.allCases, id: \.self, selection: $category) { category in
Text(category.rawValue)
}
} detail: {
NavigationStack(path: $path) {
DetailView(category: category)
.navigationDestination(for: Detail.self) { detail in
Text("\(detail.rawValue)")
}
}
}
}
}
#wwdc2023-10162 #wwdc20-10042
I'm unable to find the right combination modifiers to get drag and drop to work using the new .draggable(containerItemID:) and dragContainer(for:in:selection:_:) modifiers. The drag is initiated with the item's ID, the item is requested from the .dragContainer modifier, but the drop closure is never triggered.
Minimal repro:
struct Item: Identifiable, Codable, Transferable {
var id = UUID()
var value: String
static var transferRepresentation: some TransferRepresentation {
CodableRepresentation(contentType: .tab)
}
}
struct DragDrop: View {
@State var items: [Item] = [
Item(value: "Hello"),
Item(value: "world"),
Item(value: "something"),
Item(value: "else")
]
var body: some View {
List(items) { item in
HStack {
Text(item.value)
Spacer()
}
.contentShape(Rectangle())
.draggable(containerItemID: item.id)
.dropDestination(for: Item.self) { items, session in
print("Drop: \(items)")
}
}
.dragContainer(for: Item.self) { itemID in
print("Drag: \(itemID)")
return items.filter { itemID == $0.id }
}
}
}
#Preview("Simple") {
DragDrop()
}
In my visionOS app, I'm seeing this error in the console dozens of times. Anyone know what it means, or how to troubleshoot it?
Searching these forums and the usual other places hasn't come up with anything that seems relevant.
Hey,
The new "soft" scroll edge effect is really cool! But it seems to only appear when you add toolbar items.
Is there a way to add it for "custom" views as well, that I place in a safe area inset?
For example, the messages app in iOS 26 does this. There's a text field as a safe area inset as well as a soft scroll edge effect.
Thanks!
The new WebView implementation in *OS 26 versions is a very valuable addition to the SwiftUI toolset. I was experimenting with it and was wondering how to implement a Pull To Refresh. While this was easily achievable with the "old" WKWebView I was not able to find an API to implement, for example, a page reload when the user uses a pull to refresh gesture.
I tried to attach to a .refreshable(_:) modifier to the WebView but without success.
Is there an official API for that or should maybe .refreshable(_:) already work and it's just a bug or is it simply not yet supported?
Here is a minimal example I was trying but didn't succeed:
struct ContentView: View {
@State private var page = WebPage()
var body: some View {
NavigationStack {
WebView(page)
.refreshable {
page.reload()
}
}
}
}
Any help is much appreciated. Thank you!
I have the following SwiftUI code for a draggable UI.
private var onTouchDownGesture: some Gesture {
DragGesture(minimumDistance: 0)
.onChanged { value in
isDragging = true
updateYTranslation(value.translation.height)
}
.onEnded { value in
isDragging = false
updateYTranslation(value.translation.height)
}
}
var body: some View {
VStack {
Image(systemName: "chevron.up")
Spacer()
.frame(height: 16)
Image(systemName: "chevron.down")
}
.padding()
.gesture(onTouchDownGesture)
.glassEffect(.regular.interactive(false))
}
}
I find that if I use glassEffect modifier, then the drag gesture will not work. However, if i change it glasseffectto other kinds of background like .background(Capsule()), then the drag gesture works as expected.
Is this a known issue of glassEffect or am I using it incorrectly?
Hi everyone,
I've noticed that on iOS 26 beta 1 through beta 4, when using a List with the .plain style, the section header overlaps with the cell content below it, as there is no background for the header. This creates a poor visual experience.
Additionally, when using NavigationSplitView on iPad, the second column's list always shows this issue.
Is this an intentional design change, or just a temporary issue? I haven't found a good workaround so far.
Thanks!
FB19066489
Hello,
Thank you for your time. I have a question regarding visionOS app development.
When placing a SwiftUI TextField inside RealityView.attachments, we found that focusing on the field does not bring up the virtual keyboard in front of the user. Instead, the keyboard appears around the user’s lower abdomen area.
However, when placing the same TextField in a regular SwiftUI layer outside of RealityView, the keyboard appears in the correct position as expected. This suggests that the issue is specific to RealityView.attachments.
We are currently exploring ways to have the virtual keyboard appear directly in front of the user when using TextField inside RealityViewAttachments. If there is any method to explicitly control the keyboard position or any known workarounds—including alternative UI approaches—we would greatly appreciate your guidance.
Best regards,
Sadao Tokuyama
Hello, I'm adding a CollisionComponent to an entity in RealityView. CollisionComponent requires that a Mesh must be provided as a reference for collision detection. However, in order to achieve more accurate detection, I hope that this Mesh resource is a geometric shape of a USDZ model. Is there any way to make it happen? Thank you!
iOS 26 Beta 3 finally introduced an API for the clear variant of Liquid Glass. But is there any way to switch system controls like the NavigationController back button or UIBarButtonItems to clear? They do not accept an effect like UIEffectView, and they do not have a configuration property like UIButton.
We are using a TabView as the TabBarController in our app for main navigation. On one of the tabs we have a view that consists of a TabView with .tabViewStyle(.page) in order to scroll horizontally between pages inside of that specific tab.
The .tabBarMinimizeBehavior(.onScrollDown) works on all the other TabItem views, but for this one it does not recognise any vertical scrolling in any of the pages, in order to minimize the TabBar.
I believe this is a bug? If we don't wrap the views inside the TabView with .page style, we are able to get the expected behaviour using the tabBarMinimizeBehavior.
Please let us know if this is going to be fixed in a future iOS 26 beta release.
Hello everyone. I'm getting an error in my code and I don't know why. Can someone explain it to me?
import SwiftUI
struct ContentView: View{
var body: some View{
VStack {
Button {} label: {
Text("Click Me")
}
.buttonStyle(.glass)
.frame(width: 200, height: 200)
}
}
}
The error is as follows:
Reference to member 'glass' cannot be resolved without a contextual type
Thanks for your help
The toolbar in the the Mail app uses seems to force a
.soft scrollEdgeEffectStyle, however I can't seem to reproduce this. Even when putting .scrollEdgeEffectStyle(.soft, for: .top) all over my code, a NavigationSplitView seems to force a "classic" toolbar.
Example, top is the mail app, bottom is my swiftUI app:
Hi everyone,
I’m testing our SwiftUI app on both Xcode simulator and a real iPhone. On the simulator, everything looks clean and aligned. But when I run it on an actual iPhone (same build, iOS 18), the layout looks broken—fonts overlap, spacing is off, and elements are misaligned.
Both screenshots are from the exact same screen and time. First is simulator, second is iPhone.
Any idea why this difference happens? Is there something I should check in terms of rendering or layout settings?
Thanks in advance!
Dear All,
Recent updates in SwiftUI allow to add scope bars just beneath the search bar. Those are limited in space, though.
How does one implement a scrollable filter as is seen in the Apple’s own Developer app?
I'm currently exploring ways to update a widget's display independently of the timeline mechanism.
While researching, I came across this thread and started experimenting with the approach:
https://developer.apple.com/forums/thread/720640
As part of the implementation, I'm attempting to render a 00:00-style time string using a single custom font glyph via .timer.
However, I noticed that the colon character used in .timer doesn't appear to be the standard Unicode 0x003A (colon). It seems to be a different character entirely.
Does anyone happen to know exactly which character this colon is?
Any insights would be appreciated.
H there!
I'm new to mergeable libraries, so sorry if I missed anything obvious. We have some really huge projects with mergeable libraries that started failing to build with Xcode 26 beta 3. After doing some research I managed to create a very small project where I was able to reproduce the issues. The project just contains a SwiftUI app and a framework. The framework includes just a class that is used from a SwiftUI view included in the app.
Problems
I found the following:
Default configuration (no mergeable libraries)
Everything works as expected
Automatic mergeable libraries
In this case I just set Create Merged Binary to Automatic. In this case:
the application can be properly built and run in the simulator
the SwiftUI preview stops working with the following report:
== PREVIEW UPDATE ERROR:
FailedToAnalyzeBuiltTargetDescription: Could not analyze the built target description for MLibTestCase to create the preview.
buildableName: MLibTestCase
==================================
| UnrecognizedLinkerArguments: Unrecognized linker arguments
|
| arguments: -no_merge_framework
|
Manual mergeable libraries
In this case I set:
Create Merged Binary to Automatic in the app target
Build Mergeable Library to Yes in the library target
and I get exactly the same result as above. But if in addition I set:
MAKE_MERGEABLE to YES as a User-Defined setting in the library target
now things gets really worse, as:
linking no longer works, failing with the following error:
duplicate symbol '_relinkableLibraryClassesCount' in:
[...]/Build/Products/Debug-iphonesimulator/MLib.framework/MLib
bundle-file
duplicate symbol '_relinkableLibraryClasses' in:
[...]/Build/Products/Debug-iphonesimulator/MLib.framework/MLib
bundle-file
ld: 2 duplicate symbols
the SwiftUI preview fails, but now due to the error mentioned above:
== PREVIEW UPDATE ERROR:
SchemeBuildError: Failed to build the scheme “MLibTestCase”
linker command failed with exit code 1 (use -v to see invocation)
Conclusions, thoughts and doubts
After watching the WWDC session on mergeable libraries and reading the corresponding Apple documentation I got the feeling that Xcode would automatically manage mergeable libraries in both Debug and Release configurations, doing different things, but after performing this experiment with Xcode 26 beta 3 I'm no longer convinced that this is the case.
Anyway, our projects seemed to be working properly until Xcode 26 beta 2, using the last mentioned settings, this is, manual merged binary, with frameworks including the build mergeable library and MAKE_MERGEABLE settings.
In addition, the symbols causing the duplication error seem to be synthesized by the linker in the case of mergeable libraries, so it's weird to get this error related with something that the linker is supposed to manage automatically. And don't forget that Unrecognized linker argument...
So:
Has Xcode 26 beta 3 changed the way mergeable libraries are treated and configured, or is this a bug?
In case this is not a bug, are we now supposed to provide different settings for Debug and Release builds? (I could create a merged binary only in the Release configuration, but again, we didn't have to do this before this Xcode version)