Post

Replies

Boosts

Views

Activity

UIUserInterfaceIdiom Errors
Hello, I am getting following errors in Xcode console when running my app on the simulator with iPad Pro 13-inch (M4) 17.4: CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) passed a device subtype '2752' and idiom '2':pad that are not a matching pair, subtype is not valid with given idiom. Assuming subtype should be 0 instead. This is the code: import Foundation import SwiftUI struct PrefersTabNavigationEnvironmentKey: EnvironmentKey { static var defaultValue: Bool = false } extension EnvironmentValues { var prefersTabNavigation: Bool { get { self[PrefersTabNavigationEnvironmentKey.self] } set { self[PrefersTabNavigationEnvironmentKey.self] = newValue } } } #if os(iOS) extension PrefersTabNavigationEnvironmentKey: UITraitBridgedEnvironmentKey { static func read(from traitCollection: UITraitCollection) -> Bool { return traitCollection.userInterfaceIdiom == .phone || traitCollection.userInterfaceIdiom == .pad || traitCollection.userInterfaceIdiom == .tv } static func write(to mutableTraits: inout UIMutableTraits, value: Bool) { // do not write } } #endif I am using this to decide what layout of the app to use – learned this from the Apple sample app Backyards Birds: if prefersTabNavigation { AppTabView(selection: $selection) } else { NavigationSplitView { AppSideBar(selection: $selection) } detail: { AppDetailColumn(screen: selection) } } Could you please help me find out what is wrong with the code?
Topic: UI Frameworks SubTopic: SwiftUI
3
0
551
Jul ’24
Programmatic image creation using ImageCreator
Hello, Could you please provide details for maximum string length of the prompt and the title when using ImageCreator and the method extracted(from:title:)? static func extracted( from text: String, title: String? = nil ) -> ImagePlaygroundConcept Any additional details or example of prompt and title would help. Additionally, are ImagePlaygroundStyle.animation, ImagePlaygroundStyle.illustration and ImagePlaygroundStyle.sketch all available when using extracted(from:title:)? I am trying to generate images programmatically and would appreciate your guidance. Thank you.
1
0
468
Mar ’26
UIUserInterfaceIdiom Errors
Hello, I am getting following errors in Xcode console when running my app on the simulator with iPad Pro 13-inch (M4) 17.4: CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) passed a device subtype '2752' and idiom '2':pad that are not a matching pair, subtype is not valid with given idiom. Assuming subtype should be 0 instead. This is the code: import Foundation import SwiftUI struct PrefersTabNavigationEnvironmentKey: EnvironmentKey { static var defaultValue: Bool = false } extension EnvironmentValues { var prefersTabNavigation: Bool { get { self[PrefersTabNavigationEnvironmentKey.self] } set { self[PrefersTabNavigationEnvironmentKey.self] = newValue } } } #if os(iOS) extension PrefersTabNavigationEnvironmentKey: UITraitBridgedEnvironmentKey { static func read(from traitCollection: UITraitCollection) -> Bool { return traitCollection.userInterfaceIdiom == .phone || traitCollection.userInterfaceIdiom == .pad || traitCollection.userInterfaceIdiom == .tv } static func write(to mutableTraits: inout UIMutableTraits, value: Bool) { // do not write } } #endif I am using this to decide what layout of the app to use – learned this from the Apple sample app Backyards Birds: if prefersTabNavigation { AppTabView(selection: $selection) } else { NavigationSplitView { AppSideBar(selection: $selection) } detail: { AppDetailColumn(screen: selection) } } Could you please help me find out what is wrong with the code?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
3
Boosts
0
Views
551
Activity
Jul ’24
Programmatic image creation using ImageCreator
Hello, Could you please provide details for maximum string length of the prompt and the title when using ImageCreator and the method extracted(from:title:)? static func extracted( from text: String, title: String? = nil ) -> ImagePlaygroundConcept Any additional details or example of prompt and title would help. Additionally, are ImagePlaygroundStyle.animation, ImagePlaygroundStyle.illustration and ImagePlaygroundStyle.sketch all available when using extracted(from:title:)? I am trying to generate images programmatically and would appreciate your guidance. Thank you.
Replies
1
Boosts
0
Views
468
Activity
Mar ’26