Posts

Post not yet marked as solved
1 Replies
1k Views
Hello there, I am running an Apple Search Ads campaign and am wondering whether these anorganic downloads generated from this campaign are included on App Store Connect. You have two different places in App Store Connect where you can find Download / App Unit informations: Analytics and Trends. Question: Are Search Ads campaign downloads included in these two spots, or just in one of them or in none of them? Thanks a lot for your help!
Posted Last updated
.
Post not yet marked as solved
0 Replies
763 Views
Context When adding an Advertising Graphic to an In-App Purchase in App Store Connect, a new option called Visibility on the App Store pops up, however, I am not quite sure what this means. The two available options are the following: This promotion will be shown to all App Store users, including those who have not installed your app. This promotion will be shown only to users who meet your conditions in the app. Question What is the difference between these two options and which should be used for basically just displaying In-App Purchases on the App Store?
Posted Last updated
.
Post not yet marked as solved
0 Replies
617 Views
Context I have an Enum where one of its Cases has an ObservableObject as an Associated Value. I also have a SwiftUI View with a Property of this Enum. This View displays Data of the associated ObservableObject, if applicable. However, since I can't define the Enum itself as an ObservedObject, the UI does not change when the associated ObservableObject changes. Code // This is actually a CoreData NSManagedObject. class CustomComponent: ObservableObject { ... } enum Component { case componentA case componentB case custom(_ customComponent: CustomComponent) static func getComponents(with customComponents: FetchedResults<CustomComponent>) -> [Component] { var components = [.componentA, .componentB] for customComponent in customComponents { components.append(.custom(customComponent)) } return components } var name: String { switch self { case .componentA: return "Component A" case .componentB: return "Component B" case .custom(let customComponent): return customComponent.name } } } struct ComponentsView: View { @FetchRequest(sortDescriptors: [SortDescriptor(\.name)]) private var customComponents: FetchedResults<CustomComponent> var body: some View { ForEach(Component.getComponents(with: customComponents)) { component in ComponentView(with: component) } } } struct ComponentView: View { // I can't define this as ObservedObject, however, this View should update when the associated ObservableObject updates. let component: Component var body: some View { Text(component.name) } } Question How can I achieve my goal, that, even though the ObservableObject is hidden as an Associated Value of an Enum, the ComponentView updates when the Associated Value changes?
Posted Last updated
.
Post marked as solved
1 Replies
698 Views
Context I have a Generic Swift Class containing a component Property of the Generic Type. A few other Variables with different Data Types are passed through the Initializer, however, all of them are conforming to the Generic Protocol. However, I get the following Compiler Error in Line 11: 'ComponentA' is not convertible to 'C' Code protocol Component { ... } struct ComponentA: Component { ... } struct ComponentB: Component { ... } class Main&lt;C: Component&gt; { var component: C init(componentA: ComponentA, componentB: ComponentB) { // I am trying to check, whether componentA equals the Generic Data Type and assign it to the component Property if true. if case let safeComponent = componentA as C { self.component = safeComponent } } } Question How can I achieve my goal of checking whether a Data Type equals the Generic Data Type and assign it to the component Property if true?
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.3k Views
Context I am working with Generic SwiftUI Views and encountered a problem. I have a Generic SwiftUI View and when calling it, I need to specify the Type. However, I get this Type only as a return parameter from a method in an any format. The following Code produces the following Compiler Error: Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project Cannot find type 'componentType' in scope Code protocol Component { var name: String { get } } struct GenericView<C: Component>: View { var component: C? var body: some View { Text(component.name) } } struct MainView: View { var body: some View { GenericView<componentType>() } private var componentType: any Component.Type { // This returns a specific Component Type, e.g. ComponentA.self } } Question How can I achieve my goal of adjusting the Generic Type of GenericView depending on a Parameter / Method Return Value?
Posted Last updated
.
Post marked as solved
1 Replies
1.7k Views
Context Hey there, I am currently working with Protocols in SwiftUI and encountered a Problem. I have an Array of a Protocol Type and would like to use it to populate a SwiftUI ForEach View. However, this throws the following error: Type 'any Component' cannot conform to 'Identifiable' Code protocol Component: ObservableObject, Identifiable { var name: String { get } } struct ComponentsView: View { var body: some View { ForEach(components) { component in // Error in this Line Text(component.name) } } private var components: [any Component] { return [] } } Question How can I populate my SwiftUI ForEach View with the Array of Components?
Posted Last updated
.
Post marked as solved
1 Replies
1.5k Views
Context I have a problem with the new SwiftUI SideBar / NavigationLink concept. I have created a simple 2 Column NavigationSplitView with a SideBar and a DetailView. Once the App is launched, the preselected Timeline RootView appears as the DetailView. However, when I select a different SideBar Item, the DetailView does not change accordingly. Code struct SideBar: View { @State private var navigationItem: NavigationItem? = .timeline var body: some View { NavigationSplitView { List(NavigationItem.allCases, id: \.self, selection: $navigationItem) { navigationItem in NavigationLink(value: navigationItem) { Label(navigationItem.name, systemImage: navigationItem.symbol) } } } detail: { if let safeNavigationItem = navigationItem { safeNavigationItem.rootView } else { Text(String(localized: "select.an.option", defaultValue: "Select an Option")) } } } } Question Do you have any idea how I can solve this issue? Thanks a lot for your support in advance. Note: Just ran it on macOS, it is working there. However, still not working on iPadOS.
Posted Last updated
.
Post not yet marked as solved
5 Replies
4.4k 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 { &#9;&#9;@State var didCompletFirstView: Bool = false &#9;&#9;@State var didCompleteSecondView: Bool = false &#9;&#9;@State var didCompleteThirdView: Bool = false &#9;&#9;var body: some View { &#9;&#9;&#9;&#9;ZStack { &#9;&#9;&#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;&#9;&#9;NavigationView { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Text("View 1") &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;.background( &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;NavigationLink(destination: Text("View 2"), isActive: $didCompleteFirstView) { EmptyView() } &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;/* This Hierarchy contains a Total of 4 Screens !!! */ &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;&#9;&#9;VStack { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Spacer() &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button(action: { print("Calls a Function that updates the States accordingly.") }) { CustomButton(text: "Start") } &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;} &#9;&#9;} } 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.
Posted Last updated
.
Post not yet marked as solved
0 Replies
714 Views
I am developing an App using CoreData &amp; 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 &amp; Relationships as well as Renaming of Entities &amp; 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;)
Posted Last updated
.
Post marked as solved
17 Replies
8.3k 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.
Posted Last updated
.
Post not yet marked as solved
0 Replies
756 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.
Posted Last updated
.
Post not yet marked as solved
0 Replies
804 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!
Posted Last updated
.
Post not yet marked as solved
0 Replies
768 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 { &#9;&#9;List(selection: $selection) { &#9;&#9;&#9;&#9;NavigationLink(destination: StartView(), tag: NavigationItem.start, selection: $selection) { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Label("Start", systemImage: "square.grid.2x2.fill") &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;.accessibility(label: Text("Start")) &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;.tag(NavigationItem.start) &#9;&#9;&#9;&#9;// 4 more Items &#9;&#9;} &#9;&#9;.listStyle(SidebarListStyle()) &#9;&#9;.navigationBarTitle("Impfpass+") &#9;&#9;&#9;&#9; &#9;&#9;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?
Posted Last updated
.