ios11

Auto Layout iOS 11 Toolbar UIBarButtonItem with customView

夙愿已清 提交于 2020-01-23 03:11:07
问题 Recently in our project there was a problem with a UIBarButtonItem that was using a customView. Before iOS 11 we did the layout via flexible spacing items. This didn't work anymore and so nothing was displayed. Because I didn't find an answer here on SO that really solved the issue for me, I looked into it and came up with a (admittedly kind of hacky) solution I wanted to share with you. Maybe it can help you or you have some feedback. This is mixed objc and swift code, hope you don't mind.

Xcode 9 simulator doesn't save userdefaults

瘦欲@ 提交于 2020-01-15 08:05:08
问题 Maybe it's the same issue as this one. But few of the solutions that I have tried don't work. The simulator don't save userdefaults on Xcode Version 9.0 beta 6 (9M214v). I had Xcode 8 as well (together with 9) but removed it. the code that I'm using: UserDefaults.standard.setValue("1234567", forKey: "phone") if let phone = UserDefaults.standard.value(forKey: "phone") as? String{ //some code here } Additionally I have tried: UserDefaults.standard.set("1234567", forKey: "phone") if let phone =

iOS 11 Drop URL Returning Nil

余生颓废 提交于 2020-01-15 04:54:25
问题 I have the following code I'm trying to use for dragging a URL from Safari into a collection view and just having it print the URL. func collectionView(_ collectionView: UICollectionView, performDropWith coordinator: UICollectionViewDropCoordinator) { for item: UIDragItem in coordinator.session.items { item.itemProvider.loadItem(forTypeIdentifier: kUTTypeURL as String, options: nil, completionHandler: { (url, error) in if let myURL = url as? URL { print (myURL) } }) } } Problem is the print

Top Layout Guide deprecated since iOS 11 - unable to find view

↘锁芯ラ 提交于 2020-01-14 14:12:41
问题 I am getting the following errors: But i am unable to find the view which occurs that warnings. When ill delete all views in the Storyboard, and perform a "Clean" - the warnings are still present. Any ideas how to find that view? 回答1: Any ideas how to find that view? It's not a "view"; it's the storyboard itself. Edit the storyboard and check Use Safe Area Layout Guides: Also you might need to quit Xcode and clean out the DerivedData folder so as to get a completely clean build. 来源: https:/

Disable Safe Area Layout Guides For UIView Programmatically

◇◆丶佛笑我妖孽 提交于 2020-01-14 08:48:06
问题 Safe area layout guides can be disabled in Interface Builder by unchecking the Use Safe Area Layout Guides . How can this be done in code? I didn't notice an iOS11-available boolean that directly corresponds with the checkbox. 回答1: I think the only way to accomplish this programmatically is to override the safeAreaLayoutGuide property. override var safeAreaLayoutGuide: UILayoutGuide { return UILayoutGuide() } When you disable it through IB it still returns a UILayoutGuide but with zero

How to set UIBarButton size in iOS 11 to match size in iOS 10 [closed]

人走茶凉 提交于 2020-01-14 07:15:04
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago . I have an view controller with a simple UINavigationBar with a rightBarButtonItem which contains a button view with an image asset. In iOS 10, this UIBarButtonItem would be sized properly, not filling up the entire height and of the navigation bar and therefore taking up enough width to stay

How to set UIBarButton size in iOS 11 to match size in iOS 10 [closed]

孤者浪人 提交于 2020-01-14 07:13:27
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago . I have an view controller with a simple UINavigationBar with a rightBarButtonItem which contains a button view with an image asset. In iOS 10, this UIBarButtonItem would be sized properly, not filling up the entire height and of the navigation bar and therefore taking up enough width to stay

Xcode 9 iOS Simulator - Unable To Obtain Valid Process Handle

杀马特。学长 韩版系。学妹 提交于 2020-01-13 06:58:48
问题 I have upgraded to Xcode 9, and the iOS Simulator for 10.3 and 11 are not working. All stock and my apps are force closing when trying to run. Xcode Console errors like the following show when I try to run Calendar, Preferences etc. What does the "Unable to obtain valid process handle" mean? Process handle (com.apple.Preferences, <BSProcessHandle: 0x7fe84552b8b0; Preferences:9270; valid: NO>) is invalid. Returning error { BKSProcessExitReason = 0; BKSProcessJobLabel = "UIKitApplication:com

Xcode 9 iOS Simulator - Unable To Obtain Valid Process Handle

自古美人都是妖i 提交于 2020-01-13 06:58:13
问题 I have upgraded to Xcode 9, and the iOS Simulator for 10.3 and 11 are not working. All stock and my apps are force closing when trying to run. Xcode Console errors like the following show when I try to run Calendar, Preferences etc. What does the "Unable to obtain valid process handle" mean? Process handle (com.apple.Preferences, <BSProcessHandle: 0x7fe84552b8b0; Preferences:9270; valid: NO>) is invalid. Returning error { BKSProcessExitReason = 0; BKSProcessJobLabel = "UIKitApplication:com

How to use NEDNSProxyProvider in iOS 11

笑着哭i 提交于 2020-01-12 13:53:08
问题 On the networking side, DNS Proxy is one of the biggest features of iOS 11. But they haven't provided much documentation or samples regarding it. There's a talk on it as well where they have just given a description of what is possible with DNS Proxy. I want to create a working sample of it but didn't get success till now. So I have created a Network Extension with DNS Proxy entitlements and added a DNS Proxy Provider. Here's the code: class DNSProxyProvider: NEDNSProxyProvider { let defaults