xcode11

Programmatically detect Tab Bar or TabView height in SwiftUI

空扰寡人 提交于 2020-04-26 06:31:06
问题 I have a SwiftUI app that will have a floating podcast player, similar to the Apple Music player that sits just above the Tab Bar and persists across all tabs and views while the player is running. I have not figured out a good way to position the player so that it is flush above the Tab Bar, since the Tab Bar height changes based on device. The main issue I've found is just how I have to position the player in an overlay or ZStack in the root view of my app, instead of within the TabView

Xcode 11.2.1 error: Command CompileSwiftSources failed with a nonzero exit code

[亡魂溺海] 提交于 2020-04-15 12:10:43
问题 I've downloaded the latest Xcode 11.2.1. When I build I'm getting this error. <unknown>:0: error: using bridging headers with module interfaces is unsupported Command CompileSwiftSources failed with a nonzero exit code How can I resolve this? 回答1: I solved this build error by setting Build Options -> Build Libraries for Distribution in the targets Build Settings to No . I stumbled upon this config change that worked for me so I don't have any evidence/research to back up why it works. And I

ld: library not found for -lRCTBlob clang: error: linker command failed

给你一囗甜甜゛ 提交于 2020-04-11 07:40:49
问题 Ld /Users/ajaysivan/Library/Developer/Xcode/DerivedData/MyApp-fhlxfvymksoqhsglhalddkzaekrm/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp normal x86_64 (in target 'MyApp' from project 'MyApp') cd /Users/ajaysivan/MyApp/OfflineUpgrade/MyApp-offline-app/ios /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios9.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs

ld: library not found for -lRCTBlob clang: error: linker command failed

痞子三分冷 提交于 2020-04-11 07:40:08
问题 Ld /Users/ajaysivan/Library/Developer/Xcode/DerivedData/MyApp-fhlxfvymksoqhsglhalddkzaekrm/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp normal x86_64 (in target 'MyApp' from project 'MyApp') cd /Users/ajaysivan/MyApp/OfflineUpgrade/MyApp-offline-app/ios /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios9.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs

Why doesn't my iOS app disable dark mode?

别等时光非礼了梦想. 提交于 2020-04-10 08:30:50
问题 So ... I've tried to set my app to disable iOS 13 dark mode by forcing light mode according apple documentation, in the emulator all attempts work fine, but when I try on the real device, nothing happens, it's like I've never changed my code First Attempt Override the Interface Style for a Window, View, or View Controller I tried to put this code sample in my viewDidLoad() Nothing Changed if #available(iOS 13.0, *) { overrideUserInterfaceStyle = .light } else { // Fallback on earlier versions

How to launch new project without a storyboard >= iOS 13 in Xcode 11?

纵然是瞬间 提交于 2020-03-25 22:36:36
问题 Xcode 11 with iOS 13 now launches with a slightly different setup from before, moving many functions from the AppDelegate.m file into a new file called SceneDelegate.m - deleting the Main.storyboard and setting the root view controller in AppDelegate is no longer an option, leading to the error below: -[AppDelegate window]: unrecognized selector sent to instance How to continue building new projects without storyboard? 回答1: Check this post: Xcode 11.3 | Remove Storyboard from project Step 1:

SwiftUI Navigation Bar and Status Bar - Make them same color

拈花ヽ惹草 提交于 2020-03-23 12:12:29
问题 I have a new app that ideally will have a solid dark blue navigation bar at the top that extends up behind the status bar. It was a pain to make this opaque and the correct color of blue, but I finally figured out how to make it work by putting the following in the init() of my View that contains the NavigationView: init() { UINavigationBar.appearance().barTintColor = UIColor(named: "primaryBlue") UINavigationBar.appearance().backgroundColor = UIColor(named: "primaryBlue") UINavigationBar

SwiftUI Navigation Bar and Status Bar - Make them same color

你说的曾经没有我的故事 提交于 2020-03-23 12:12:22
问题 I have a new app that ideally will have a solid dark blue navigation bar at the top that extends up behind the status bar. It was a pain to make this opaque and the correct color of blue, but I finally figured out how to make it work by putting the following in the init() of my View that contains the NavigationView: init() { UINavigationBar.appearance().barTintColor = UIColor(named: "primaryBlue") UINavigationBar.appearance().backgroundColor = UIColor(named: "primaryBlue") UINavigationBar

Add dependency on a local swift package in Xcode 11

≯℡__Kan透↙ 提交于 2020-03-18 09:08:09
问题 I am trying to add a dependency on a local swift package in my Xcode project. (I don't want to add a dependency using a file url file://me/dev/app/package as this cannot be shared to other environments) I tried to drag & drop the package to the target. This creates a references to the package in the project that I was able to add in the "Link Binary With Libraries" build phase, but the library is still not found. No such module 'Analytics' My original configuration After drag & drop and here

Cannot preview in this file - [App Name].app may have crashed on Xcode 11 Beta 5

不问归期 提交于 2020-03-16 07:19:23
问题 The Xcode preview does not work if i add a EnviromentObject property wrapper. Everytime i add one the Canvas doesn't build and i get this error: Cannot preview in this file - [App Name].app may have crashed If i replace the EnviromentObject property wrapper with ObservedObject and initialize it everything works fine. Here's my code: class NetworkManager: ObservableObject { } struct ContentView : View { @EnvironmentObject var networkManager: NetworkManager var body: some View { Text("Canvas