Post not yet marked as solved
1.7k
Views
I am working a lot with SwiftUI recently and encountered a problem when controlling NavigationLinks from outside the NavigationView with a @State.
Error Message: [Assert] displayModeButtonItem is internally managed and not exposed for DoubleColumn style. Returning an empty, disconnected UIBarButtonItem to fulfill the non-null contract What Do I do? I am using a Button outside a NavigationView to control a hierarchy of NavigationLinks inside the NavigationView via @State Properties which the Button is manipulating.
struct OnboardingRoot: View {
		@State var didCompletFirstView: Bool = false
		@State var didCompleteSecondView: Bool = false
		@State var didCompleteThirdView: Bool = false
		var body: some View {
				ZStack {
						
						NavigationView {
								Text("View 1")
										.background(
												NavigationLink(destination: Text("View 2"), isActive: $didCompleteFirstView) { EmptyView() }
										)
								/* This Hierarchy contains a Total of 4 Screens !!! */
						}
						
						VStack {
								Spacer()
								Button(action: { print("Calls a Function that updates the States accordingly.") }) { CustomButton(text: "Start") }
						}
				}
		}
}
The Problem: As soon as I move to the Third Screen, I get the Error Message above. And also when moving between the Third and Fourth Screen, thee behavior is changing more or less to Random. *For example when finishing Screen 3, it comes again instead of Screen 4 and more.*
My Solution for this Problem: I was browsing for possible Solutions and found one Solution that seems to does the Job
.navigationViewStyle(StackNavigationViewStyle())
My Question: Although this Line of Code does the Job, removes the Error Messages and prevents this Random Behavior, I could't find an Explanation of what causes the Error and why this is able to solve it. So if you have an Idea, please share it with me.
Thanks for your Help.
Post not yet marked as solved
109
Views
I am developing an App using CoreData & CloudKit (NSPersistentCloudKitContainer).
I am working on an App Update which includes an Update to the CoreData Model. I have created a new Model Version and applied the Changes (including new Properties & Relationships as well as Renaming of Entities & Properties). For Renaming I set the Renaming ID to the old Entity- / Property-Name. These Changes should be supported by Lightweight-Migration.
Questions Is there anything else I have to consider when updating a CoreData Model or did I cover all?
What about the CloudKit Synchronization? How does CloudKit handle the CoreData Model Update?
I read about adding this Method *(initializeCloudKitSchemaWithOptions)* during Development and removing it when deploying to Production. What does this Method do exactly?
Thanks a lot for your help in Advance. This is quiet a huge Update and the App does have an existing Userbase, so Migration-Problems are no Option;)
Post marked as solved
3.4k
Views
I updated to Xcode 12.3 on my MacBook Pro 2018 13" yesterday and face a strange Issue now.
Problem: Every Time I open Xcode, it will first work fine. However, after a few Actions / Seconds, the Screen is freezing and the Circle Loading Indicator is displayed. The App is not responding anymore and I have to force close it.
More Information: The Freezing is Xcode specific. I can use all other Programs while Xcode is frozen and the Circle is spinning. It doesn't seem like a Ressource Problem
This not only happens with existing Projects, I created a new one and encountered the same Problem
I alredy reinstalled Xcode, does not solve the Problem
I already deleted the ~/Library/Developer Folder *(like a few other posts recommended)* and Installed the Components on Xcode Start again. Still the same Problem.
Has anyone an Idea on how to solve this Problem?
Thanks for your help.
Post not yet marked as solved
86
Views
I am developing an App that supports multiple Profiles.
I really like the way Apple displays the Profile Icon next to the Large Navigation Bar Title in all their Apps.
Check out this Example - https://www.apple.com/newsroom/images/product/services/standard/Apple-services-apple-app-store-screen-01072020_inline.jpg.large.jpg
My Question is the following: 1. Is it possible to achieve this in SwiftUI? And if so, how?
If it's not possible in pure SwiftUI, how can I achieve it including UIKit Code?
Thank you for your help.
Post not yet marked as solved
144
Views
I have found a strange problem with iCloud Sync.
Situation: I have developed an iOS, iPadOS & macOS App using SwiftUI. All three Versions share the same Codebase *(macOS Version is a Catalyst iPad Version)*. The Project does support iCloud Sync via the NSPersistenceCloudKitContainer to sync data between all 3 devices.
Problem: iCloud Sync works perfectly between my iPhone and my Mac, but when using it with my iPad, I face a really strange problem. When creating a new CoreData Object on my iPad, it will appear on my other devices after a few Seconds, which is totally fine. However, when creating the CoreData Object on my iPhone or Mac, it will not appear on the iPad *(I waited 10min)*. Only when closing and reopening the App, the Object will appear.
Details: I not even have to fully exit the App. It is enough to just swipe up to Application Picker and select the App again.
Question: Does anyone has an idea or something what could cause this strange error? And remember: All three devices are using the same codebase.
Thanks a lot for your help!
Post not yet marked as solved
174
Views
I enabled Mac Catalyst for an iPad App and encountered an strange Display Problem of the Sidebar.
Here is the Link to an Screenshot of the Mac App: https://i.stack.imgur.com/ZnMQ0.png
Code:
@State private var selection: NavigationItem? = .start
NavigationView {
		List(selection: $selection) {
				NavigationLink(destination: StartView(), tag: NavigationItem.start, selection: $selection) {
								Label("Start", systemImage: "square.grid.2x2.fill")
										.accessibility(label: Text("Start"))
						}
						.tag(NavigationItem.start)
				// 4 more Items
		}
		.listStyle(SidebarListStyle())
		.navigationBarTitle("Impfpass+")
				
		StartView()
}
Question: This Code produces a Standard Sidebar on the iPad, however, as you can see, the Mac Version is looking strange with this angular design. How can I achieve the Standard macOS Sidebar Design?