xcode11

Set rootViewController programmatically not working, picking initial view controller from storyboard only in Xcode 11

二次信任 提交于 2021-01-29 16:20:35
问题 Trying to change the root view controller programmatically, initially in storyboard as initial view controller is checked. Every time same viewController is opened which is set up as initialViewController in storyboard. Please guide. Sharing below what code tried so far: let isLoggedIn = UserDefaults.standard.bool(forKey: kIsLoggedIn) if isLoggedIn{ //Welcome Screen for Touch ID let storyboard = UIStoryboard(name: "Main", bundle: nil) // let rootVC = storyboard.instantiateViewController

Xcode 11 Firebase auth for Mac app has error An error occurred when accessing the keychain

雨燕双飞 提交于 2021-01-28 09:14:24
问题 I am turning iOS app to Mac app, when I run Xcode for My Mac , I was trying to login my app on Mac, when I press button login, below Error shows: An error occurred when accessing the keychain. The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo dictionary will contain more information about the error encountered MacOS: 10.15.1 Xcode: 11.2.1 It works totally fine on iPhone simulator or real iPhone, it only occurs when I try to run on Mac I think this is a issue that

Receive the selected TabView from another view - SwiftUI

混江龙づ霸主 提交于 2021-01-28 04:34:46
问题 I'm trying do make a swiftui app with tabView. I want the tabview works normally but also the selected tab may come from the first page The first view struct ContentView: View { @State var selectedTab = 0 var body: some View { VStack{ NavigationView{ VStack(alignment: .center, spacing: 0){ Spacer() NavigationLink(destination: AccueilView(selectedTab: self.$selectedTab)){ VStack{ Image(systemName: "book") Text("Enseignements") } } HStack{ NavigationLink(destination: AccueilView(selectedTab:

Receive the selected TabView from another view - SwiftUI

点点圈 提交于 2021-01-28 04:24:07
问题 I'm trying do make a swiftui app with tabView. I want the tabview works normally but also the selected tab may come from the first page The first view struct ContentView: View { @State var selectedTab = 0 var body: some View { VStack{ NavigationView{ VStack(alignment: .center, spacing: 0){ Spacer() NavigationLink(destination: AccueilView(selectedTab: self.$selectedTab)){ VStack{ Image(systemName: "book") Text("Enseignements") } } HStack{ NavigationLink(destination: AccueilView(selectedTab:

How should I solve this error: Thread 1: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=650 MB, unused=0x0)?

末鹿安然 提交于 2021-01-28 00:40:34
问题 I am trying to run my app which uses this GitHub project: https://github.com/PaoloCuscela/Cards/wiki/Overview But when I run my app on my iPhone 6, it crashes and gives me the error in the title. I've written 28 of these in my viewDidLoad function and the app runs fine on the simulator. let tennisCard = CardHighlight(frame: CGRect(x: 67, y: 3362, width: 250, height: 300)) tennisCard.title = "Exercise 11" tennisCard.itemTitle = "Tennis" tennisCard.backgroundColor = UIColor(red: 0/255, green:

How can I preview a device in landscape mode in SwiftUI?

本小妞迷上赌 提交于 2021-01-20 14:38:39
问题 How can I preview a device in landscape mode in SwiftUI? I just have a simple preview like this: struct ContentView_Previews : PreviewProvider { static var previews: some View { ContentView() } } 回答1: You can't rotate the device in preview ( yet ), but you can set the size to any landscape size you want for PreviewProvider : struct ContentView_Previews : PreviewProvider { static var previews: some View { ContentView() .previewLayout(.fixed(width: 1024, height: 768)) // iPad Mini landscape

How can I preview a device in landscape mode in SwiftUI?

寵の児 提交于 2021-01-20 14:37:11
问题 How can I preview a device in landscape mode in SwiftUI? I just have a simple preview like this: struct ContentView_Previews : PreviewProvider { static var previews: some View { ContentView() } } 回答1: You can't rotate the device in preview ( yet ), but you can set the size to any landscape size you want for PreviewProvider : struct ContentView_Previews : PreviewProvider { static var previews: some View { ContentView() .previewLayout(.fixed(width: 1024, height: 768)) // iPad Mini landscape

SwiftUI - How can I blur the default background color of a view?

妖精的绣舞 提交于 2020-12-31 05:43:54
问题 no code to show here, but I would like to know how it may be possible to do this. I have tried to use .blur(radius: (20) on a view, but it tends to blur the entire view. Including the text, and anything else in the view. The default background color is fine and I don't want/need to change it (in order to keep the app compatible with light/dark mode). I want to make the view's background slightly blurred/opaque, but I want the text and buttons in the view to still remain full and normal. Is

SwiftUI - How can I blur the default background color of a view?

拥有回忆 提交于 2020-12-31 05:42:11
问题 no code to show here, but I would like to know how it may be possible to do this. I have tried to use .blur(radius: (20) on a view, but it tends to blur the entire view. Including the text, and anything else in the view. The default background color is fine and I don't want/need to change it (in order to keep the app compatible with light/dark mode). I want to make the view's background slightly blurred/opaque, but I want the text and buttons in the view to still remain full and normal. Is

Core data + CloudKit - sharing between iOS and watchOS companion app

末鹿安然 提交于 2020-12-29 06:54:27
问题 In my app I store data with core data. Recently I discovered the new feature introduced by Apple in WWDC19 which allows core data to work with CloudKit. I just enabled cloudKit for my app and used an NSPersistentCloudKitContainer instead of NSPersistentContainer and all was set up ! All my data is shared between ios devices. That works like NSPersistentContainer but it sends a copy of changes on icloud server, so there is always a local cache of data. Now I'd like to access that data from my