xcode

ionic serve on iOS 14 device. Error “Invalid Service”

不打扰是莪最后的温柔 提交于 2021-01-21 10:18:08
问题 After upgrading an iPhone6s to iOS 14 and Xcode to the latest version, I am unable to serve the app. The error stack is as following Error: InvalidService at LockdownProtocolReader.parseBody (/usr/local/lib/node_modules/native-run/node_modules/node-ioslib/dist/protocol/lockdown.js:35:19) at LockdownProtocolReader.onData (/usr/local/lib/node_modules/native-run/node_modules/node-ioslib/dist/protocol/protocol.js:52:40) at TLSSocket.emit (events.js:315:20) at addChunk (_stream_readable.js:295:12)

I want to change path of ~/Library/Developer/Xcode/iOS DeviceSupport to my External Drive

我的梦境 提交于 2021-01-21 09:18:31
问题 When we connect any iOS device to MAC OS X, by default Xcode copy device info into ~/Library/Developer/Xcode/iOS DeviceSupport path. I want that files for symbolicate crash log. But my MAC derive is almost full only 1 GB avaialble. So I want to move ~/Library/Developer/Xcode/iOS DeviceSupport to my External drive so my symbolication works well. So can any one please suggest me some way to change path. I have try to change the developer directory but that's not work. Any help or hint will be

Adding a TabView makes the Navigation Bar not cover the safe area in SwiftUI

你离开我真会死。 提交于 2021-01-21 08:25:41
问题 When adding a TabView in my SwiftUI iOS App, the Navigation Bar stops covering up the notch I've tried creating another file for the TabView implementation ( Modifying SceneDeletage and so on) Here is a simple code without TabView that makes the Navigation Bar cover the safe area (aka the notch) import SwiftUI struct ContentView: View { var body: some View { NavigationView{ ScrollView{ HStack{ VStack{ ForEach((1...10), id: \.self){_ in Text("Hello") .padding(.leading, 20) } } Spacer() //

SwiftUI iOS app crashes when state change causes keyboard to resign as first responder while in a sheet

萝らか妹 提交于 2021-01-21 07:09:44
问题 I'm trying to create a view in a sheet with multiple "pages". The view holds a @State variable of an enum and I "switch" between pages with if self.page == .text {...} else if self.page == .image {...} else {...} However, when self.page is set while a textfield is active in one of the pages, the app crashes with no clear error message. This seems to work on the simulator but not on a device. Here's the dump: Thread 1 Queue : com.apple.main-thread (serial) #0 0x00000001f6dc702c in

SwiftUI iOS app crashes when state change causes keyboard to resign as first responder while in a sheet

不羁岁月 提交于 2021-01-21 07:07:48
问题 I'm trying to create a view in a sheet with multiple "pages". The view holds a @State variable of an enum and I "switch" between pages with if self.page == .text {...} else if self.page == .image {...} else {...} However, when self.page is set while a textfield is active in one of the pages, the app crashes with no clear error message. This seems to work on the simulator but not on a device. Here's the dump: Thread 1 Queue : com.apple.main-thread (serial) #0 0x00000001f6dc702c in

SwiftUI iOS app crashes when state change causes keyboard to resign as first responder while in a sheet

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-21 07:06:52
问题 I'm trying to create a view in a sheet with multiple "pages". The view holds a @State variable of an enum and I "switch" between pages with if self.page == .text {...} else if self.page == .image {...} else {...} However, when self.page is set while a textfield is active in one of the pages, the app crashes with no clear error message. This seems to work on the simulator but not on a device. Here's the dump: Thread 1 Queue : com.apple.main-thread (serial) #0 0x00000001f6dc702c in

Repeating animation on SwiftUI Image

穿精又带淫゛_ 提交于 2021-01-21 06:52:48
问题 Given the following struct : struct PeopleList : View { @State var angle: Double = 0.0 @State var isAnimating = true var foreverAnimation: Animation { Animation.linear(duration: 2.0) .repeatForever() } var body: some View { Button(action: {}, label: { Image(systemName: "arrow.2.circlepath") .rotationEffect(Angle(degrees: self.isAnimating ? self.angle : 0.0)) .onAppear { withAnimation(self.foreverAnimation) { self.angle += 10.0 } } }) } } I was hoping that the Image would rotate clockwise and

How to determine if a string is a URL in Objective-C

拥有回忆 提交于 2021-01-21 06:32:18
问题 I'm new to iPhone development and Objective-C. Using the ZBar SDK I've developed a basic app which scans a QR image from the photo album and outputs what it translates to. I want to know if there is a way to take this output, determine whether it is a URL and if so open it in a web browser. 回答1: NSURL's URLWithString returns nil if the URL passed is not valid. So, you can just check the return value to determine if the URL is valid. UPDATE Just using URLWithString: will usually not be enough,

how to use .svg images in SwiftUI

99封情书 提交于 2021-01-21 05:18:50
问题 Can I only upload .png files into the assets folder? I get an error for .svg files. I want to use it for the Image() component 回答1: You can use Macaw to display a SVG: https://github.com/exyte/Macaw 1) Add the Package via SPM to your project (the tag 0.9.5 actually doesn't work, you need to use the master branch) 2) Move your .svg-file to the project or create a new Data set in your Assets.xcassets and then add the svg file to this data set. 3) Use this code: struct MyView: View { var svgName

Could not build module 'nanopb' error in Xcode 12.0.1

冷暖自知 提交于 2021-01-21 05:14:08
问题 I upgraded my Xcode to 12. Everything was working perfectly and all of a sudden I kept getting bellow error message (Image below) SO link have tried using to solve this issue SO Link What I've done so far Cleaned Build Folder Restarted Xcode Updated Cocoapods Deleted DerivedData Cleared pod cache Deleted pods directory and file and reinstall None of them worked and its getting frustrating. Pod file 回答1: All I did was to follow the instruction(see image below) and it got fixed. Source here 回答2