xcode11

The iOS 13.0 simulator runtime is not available

北慕城南 提交于 2021-02-20 06:25:24
问题 I installed the Xcode-11-beta along with macOS 10.15 beta. At first I can play with SwiftUI preview normally. But after I tried to move the Xcode-beta from the ~/Downloads directory where I initially installed it, to /Applications , the preview can't work. Here is the error: So I moved it back to ~/Downloads , hoping things will go well as before. But it gives the same error. After this, I reinstalled it and I still got this error. Can anyone help me fix it? The content of diagnostics report

Removing large amounts of whitespace in a SwiftUI subview

ぐ巨炮叔叔 提交于 2021-02-11 18:16:04
问题 Demonstration of whitespace problem When I nest a NavigationView within a NavigationView, an enormous amount of whitespace separates the back button and the new navigation bar title. Is there something I'm doing wrong in terms of setting up my SwiftUI views? import SwiftUI struct Dashboard: View { @EnvironmentObject var user: User let courses = Course.exampleCourses() var body: some View { NavigationView { List(courses) { course in NavigationLink(destination: CourseView(course: course)) {

Removing large amounts of whitespace in a SwiftUI subview

你离开我真会死。 提交于 2021-02-11 18:15:52
问题 Demonstration of whitespace problem When I nest a NavigationView within a NavigationView, an enormous amount of whitespace separates the back button and the new navigation bar title. Is there something I'm doing wrong in terms of setting up my SwiftUI views? import SwiftUI struct Dashboard: View { @EnvironmentObject var user: User let courses = Course.exampleCourses() var body: some View { NavigationView { List(courses) { course in NavigationLink(destination: CourseView(course: course)) {

SwiftUI: Stepper Binding is not working in the subview

故事扮演 提交于 2021-02-11 15:12:35
问题 I have a stepper control in the main list view as well as in the detail view. the code is exactly the same. However the stepper in main view is working perfectly, but the subview is stopping after 1 increment (as it looks like the upper bound is set.) The funny thing is it was working some time ago, after improvements, i am not able to trace what exactly changed it s behaviour. Here is the code. struct QuestionCardTest: View { @Binding var question : SurveyQuestion var body: some View {

SwiftUI: Stepper Binding is not working in the subview

可紊 提交于 2021-02-11 15:08:33
问题 I have a stepper control in the main list view as well as in the detail view. the code is exactly the same. However the stepper in main view is working perfectly, but the subview is stopping after 1 increment (as it looks like the upper bound is set.) The funny thing is it was working some time ago, after improvements, i am not able to trace what exactly changed it s behaviour. Here is the code. struct QuestionCardTest: View { @Binding var question : SurveyQuestion var body: some View {

Explicitly manage Swift Package nested dependencies required?

随声附和 提交于 2021-02-08 13:17:16
问题 I'm moving my Carthage libraries to Swift Package Manager. If my Swift Package has dependencies to other Swift Packages, do I have to explicitly link those libraries into the project like I do with Carthage, or are the nested dependencies embedded in the Swift Package? 来源: https://stackoverflow.com/questions/57659938/explicitly-manage-swift-package-nested-dependencies-required

Add a border with cornerRadius to an Image in SwiftUI Xcode beta 5

泪湿孤枕 提交于 2021-02-06 08:48:01
问题 how can I add a border with a cornerRadius to an Image. I get a deprecation warning saying that i should use a RoundedRectange Shape, but i don't know how to use that exactly Beta 4: Image(uiImage: ...) .border(Color.black, width: 2, cornerRadius: 10) 回答1: SwiftUI 1.0 Using cornerRadius & overlay Modifiers Here is another way in which we can use a cornerRadius modifier (which clips the view) and then overlay a stroke with a color. VStack(spacing: 40) { Text("Image Border").font(.largeTitle)

Add a border with cornerRadius to an Image in SwiftUI Xcode beta 5

非 Y 不嫁゛ 提交于 2021-02-06 08:46:20
问题 how can I add a border with a cornerRadius to an Image. I get a deprecation warning saying that i should use a RoundedRectange Shape, but i don't know how to use that exactly Beta 4: Image(uiImage: ...) .border(Color.black, width: 2, cornerRadius: 10) 回答1: SwiftUI 1.0 Using cornerRadius & overlay Modifiers Here is another way in which we can use a cornerRadius modifier (which clips the view) and then overlay a stroke with a color. VStack(spacing: 40) { Text("Image Border").font(.largeTitle)

SwiftUI @FetchRequest crashes the app and returns error

本小妞迷上赌 提交于 2021-02-05 07:51:29
问题 I am trying to use core data within my mac app with SwiftUI using Xcode 11. I have checked "Using Core Data" when creating the project. I also have created the entity (called VisitedCases) and used editor to create NSManagedObject Subclass files. I also have set the Codegen to Manual/none. Here is the code in the generated NSManagedObject files: VisitedCases+CoreDataProperties.swift extension VisitedCases { @nonobjc public class func fetchRequest() -> NSFetchRequest<VisitedCases> { return

Xcode 11: Building a static framework which includes other frameworks/libs into its binary in iOS

為{幸葍}努か 提交于 2021-01-29 18:26:48
问题 I have a framework target in Xcode 11.x to build a Dynamic framework with statically linking some 3rd party libraries using pod file. platform :ios, '9.0' #use_frameworks! target 'Framework' do pod 'DeviceUtil', '~> 2.0' end Now I have a requirement to build a Static framework, and for this I changed the "Mach-O' type to Static Library in 'Framework's' target build settings and able to create Static framework. The generated framework shows all architectures correctly (for architecture i386):