xcode11

SwiftUI hide list item from list item view

做~自己de王妃 提交于 2020-02-02 12:05:16
问题 So, let's say I have a SwiftUI List and Toggle (heavily simplified): List { Toggle(isOn: $isOn) { Text("Toggle") } ForEach(arr) { item in if isOn || !item.isComplete { Row(item: item) } } } Then my Row: HStack { Button(action: { self.item.isComplete.toggle() // isComplete is a Boolean value }) { Text("Button") } Text(item.isComplete ? "Complete" : "Not complete") } The toggle should change the list, swapping between all items, and only non-completed items. This works perfectly. However, I

VSCode, MacOS Catalina - doesn't stop on breakpoints on C/C++ debug

筅森魡賤 提交于 2020-02-01 03:54:27
问题 I'm trying to make breakpoints work on C code developed using VSCode on Mac. My code seems to compile and run just fine (thanks to 'openssl/crypto.h' file not found on vscode B.T.W) but I don't get any breakpoints, not even on start using "stopAtEntry": true or by attaching to a running process. My tasks.json and launch.json are very standard: { "tasks": [ { "type": "shell", "label": "clang build active file", "command": "/usr/bin/clang", "args": [ "-g", "${file}", "-o", "${fileDirname}/$

Will “Sign in With Apple” allow apps to be backward compatible with iOS 12 and lower?

我们两清 提交于 2020-01-30 05:01:52
问题 Does implementing the new Sign in With Apple feature make an app incompatible with iOS 12 and below, similar to SwiftUI? Will it be possible to compile an app which has to import AuthenticationServices on something like XCode 10 ? 回答1: Sign in With Apple itself doesn't make the whole app incompatible with iOS 12 and lower (the same is for SwiftUI). But when you need to support this kind of feature (which available on iOS 13 only) you'll need to use @available(iOS 13.0, *) attribute and if

SwiftUI: List Refresh scrolls up

为君一笑 提交于 2020-01-25 06:41:12
问题 I just discovered a funny behavior. if .id(UUID().uuidString) modifier of the List is commented, when a user modifies the value of a bound control which is not visible at the initial view (which means the control may be at somewhere towards the end of the list), the list will scroll up as the bound value will refresh the view. However, if .id(UUID().uuidString) the modifier is commented out, the list won't scroll up, it will stay as where it is - which is good for me. I am just curious if

Proportional width and height with main view in iOS

不打扰是莪最后的温柔 提交于 2020-01-25 03:59:07
问题 To make application compatible with all sizes of devices, At some point we need to give width or height of UIControl in proportion with main view that is our self.view . So we used to assign constraint in storyboard, equal height/width to main view and then we set multiplier. Like 0.3 So it will set height of my control (iPhone 5s --> 568 ==> 568*0.3 = 170.4) and so on for all devices. But right now I am creating app in Xcode 11.0 . In that I cannot set equal height or width to main view. I

iOS 13: UITextField with LeftView spacing issue - Xcode 11

老子叫甜甜 提交于 2020-01-24 19:42:25
问题 iOS 12.0 with Xcode 10.0 iOS 13.0 with Xcode 11.0 I have taken custom LeftView with image and label for adding LeftView in UITextField. I have set all the needed constraints also but still I am facing issues of LeftView width spacing. In old Xcode and iOS it was working well but after new Xcode and iOS there is something wrong. 回答1: I had similar problem fixed by adding constraints. Make sure had set UIImageView and UILabel width constraints and margins with other views, like: H:|-0-[image(=

Issues with named colors on iOS 11 with Xcode 11 beta

送分小仙女□ 提交于 2020-01-24 06:44:42
问题 I am trying to implement dark mode in my iOS app. I need to use named colors in order to do this, but I've run into a bit of a snag. Everything works fine on the iOS 13 simulator when switching between light and dark mode, and the colors are also correct in the iOS 12 simulator. The problem occurs when I try to run my app on an iOS 11 simulator. Any named colors that I've used in the storyboard default to the dark version of the color, and when I try to access a named color in code I get nil.

SwiftUI setting status bar style

吃可爱长大的小学妹 提交于 2020-01-23 17:46:07
问题 I have been attempting to set the statusbar in my SwiftUI app to light text as it has a dark background. I found this solution on several sites but cannot get it to work. HostingController.swift import Foundation import UIKit import SwiftUI class HostingController : UIHostingController { override var preferredStatusBarStyle: UIStatusBarStyle { return .lightContent } } This returns an error on the class declaration line Reference to generic type 'UIHostingController' requires arguments in <...

Xcode 11 iOS playgrounds no longer symlink playgroundSharedDataDirectory - bug or feature?

时光毁灭记忆、已成空白 提交于 2020-01-23 01:15:26
问题 Xcode 11 Playgrounds seemingly changed the behavior of playgroundSharedDataDirectory : To reproduce, paste the below in a playground and execute it in Xcode 10 and Xcode 11 respectively: import PlaygroundSupport print(playgroundSharedDataDirectory) let str = try String(contentsOf: playgroundSharedDataDirectory.appendingPathComponent("data.json")) // assuming you create ~/Documents/Shared Playground Data/data.json playgroundSharedDataDirectory resolves to: Xcode 11.2: iOS: file:///Users/

UITableViewCell selectedBackgroundView's color not visible when building on iOS 13

风流意气都作罢 提交于 2020-01-22 20:36:28
问题 I have given a tableview cell a color on selection in cellForRowAtIndexPath using let backgroundView = UIView() backgroundView.backgroundColor = UIColor.grey3 //custom color cell.selectedBackgroundView = backgroundView Since I am building with Xcode 11.0 the color is not propagated to the subviews of the cell anymore on an iOS 13 device or Simulator. If I build on an iOS 12.2 simulator using Xcode 11.0 it still works. Anyone has an idea what has changed to cause this behaviour? I am working