ios13

Siri shortcuts iOS 13 bug INUIAddVoiceShortcutButton

百般思念 提交于 2019-12-10 11:13:18
问题 In my project I use siri shortcuts with INUIAddVoiceShortcutButton . I use this method to create the button and associate the NSUserActivity : let button = INUIAddVoiceShortcutButton(style: .blackOutline) view.addSubview(button) button.shortcut = INShortcut.userActivity(activityPreCreated) In iOS 12 all works right, the button add or edit the shortcuts. But in iOS 13 the button only add but doesn't edit the shortcut and remain with the text "Add to Siri". Is a bug of the beta or I do

iOS 13: NavigationBar BarStyle is ignored when using UINavigationBarAppearance

江枫思渺然 提交于 2019-12-10 11:08:16
问题 I have a custom colour Navigation Bar and I need to make sure the Status Bar colour is set to white. In pre iOS 13 this was easy to do, here is a code snippet from a UIViewController that did the job just fine: override func viewDidLoad() { super.viewDidLoad() self.navigationController?.navigationBar.barStyle = .black } The issue I'm facing with iOS 13 is that I now need to use the NavigationBar's standardAppearance and scrollEdgeAppearance to undo the forced background transparency in the

Fallback behavior for new iOS 13 system colors in iOS 12

▼魔方 西西 提交于 2019-12-10 10:29:21
问题 I’m currently adopting to Dark Mode and I figured that using the new system colors like systemBackground and label in Interface Builder also just works when running the app in iOS 12. I half expected to get a compiler error, but instead the app looks like in iOS 13 light mode. So obviously the runtime somehow translates those colors for iOS 12. Does anyone know what happens under the hood and if there is a convenient way to achieve the same in code? 回答1: If you look at the XML of the

Swift Combine: What are those multicast functions for and how do I use them?

跟風遠走 提交于 2019-12-10 09:25:15
问题 Struggling with some combine problems I came across the "Working with Multiple Subscribers" section in https://developer.apple.com/documentation/combine/publisher : func multicast<S>(() -> S) -> Publishers.Multicast<Self, S> func multicast<S>(subject: S) -> Publishers.Multicast<Self, S> However, when I tried to confirm my assumption that multicast would be needed when sending to multiple subscribers, I found out this is not necessary when trying on this playground code (modified from https:/

Xcode 11 — SwiftUI's dark mode setup

╄→尐↘猪︶ㄣ 提交于 2019-12-10 03:52:25
问题 Okay. I know this shouldn't be rocket science. I can't seem to get dark mode working and I've read the documentation a few times. Hoping someone can pick out what I'm missing. I have an named color in the asset catalog. I set my plist mode to be in dark mode for easier testing. My content view looks like this: struct ContentView : View { var body: some View { VStack { Text("Hello World") Text("Yo yo yo") .color(Color("darkModeColor")) } } } No matter what I do, the color is ALWAYS of the "Any

UISearchBar's set_cancelButtonText: ivar is prohibited

南笙酒味 提交于 2019-12-09 18:32:03
问题 Previously in iOS 12 the same code was allowed, but now when i try to run the same code on iOS 13 it crashes giving me the same error: Terminating app due to uncaught exception 'NSGenericException', reason: 'Access to UISearchBar's set_cancelButtonText: ivar is prohibited. This is an application bug' Which is related to this line of code: searchController.searchBar.setValue("Cancel".localized, forKey:"_cancelButtonText") Now i know the access of setValue is now prohibited but how is it

“Missing required entitlement” for NFCTagReaderSession

痴心易碎 提交于 2019-12-09 16:55:47
问题 I'm diving into iOS 13's new CoreNFC capabilities, and I'm struggling to get NFCTagReaderSession working. After setting up my entitlements and instantiating an NFCTagReaderSession and delegate I attempt to start the session by calling nfcTagReaderSession?.begin() . My session immediately gets invalidated with this error: Error Domain=NFCError Code=2 "Missing required entitlement" UserInfo={NSLocalizedDescription=Missing required entitlement} I followed the documentation here for my

How do I easily support light and dark mode with a custom color used in my app?

会有一股神秘感。 提交于 2019-12-09 00:01:39
问题 Let's say I have a custom color in my app: extension UIColor { static var myControlBackground: UIColor { return UIColor(red: 0.3, green: 0.4, blue: 0.5, alpha: 1) } } I use this in a custom control (and other places) as the control's background: class MyControl: UIControl { override init(frame: CGRect) { super.init(frame: frame) setup() } required init?(coder: NSCoder) { super.init(coder: coder) setup() } private func setup() { backgroundColor = .myControlBackground } // Lots of code

How to set height and width in proportion with superview in SwiftUI?

有些话、适合烂在心里 提交于 2019-12-08 09:45:52
问题 I want to know that is it possible to adjust height and width in proportion according to superview in SwiftUI to any UIControl ? As we are doing like : let txtFld = UITextField() txtFld.frame = CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize(width: self.view.frame.width/2, height: self.view.frame.height*0.1)) I know we can somehow achieve to adjust width by using Spacer() , .padding and edgeInsets . But what about height ? I have seen lots of tutorial for SwiftUI , everywhere height is

Three-finger undo gesture with custom undo manger

…衆ロ難τιáo~ 提交于 2019-12-08 08:02:30
I'm trying to handle the three-finger gesture with a custom undo manager. Using the default undo manager provided by the window, resolved via the UIResponder chain works flawlessly. As soon as I try to use an own undo manager in a view controller I run into issues. (Background: I want to switch between different managers depending on the state of the view, so I can't use the single undo manager provided by the window.) What I did: override undoManager in my view controller and return an own instance override canBecomeFirstResponder and return true set the VC to be the first responder on