xcode9-beta

Compile error in Swift 4 on parameter passing

一笑奈何 提交于 2019-11-27 23:45:13
I used 3rd party library in Xcode 9 Beta 3. And I am getting the following error in the completion call, I am not able to resolve this error: DispatchQueue.main.asyncAfter(deadline: .now() + delay) { self.animationView?.alpha = 0 self.containerView.alpha = 1 completion?() // -> Error: Missing argument parameter #1 in call. } And getting the following warning in the completion function: func openAnimation(_ completion: ((Void) -> Void)?) { // -> Warning: When calling this function in Swift 4 or later, you must pass a '()' tuple; did you mean for the input type to be '()'? } In Swift 4, tuples

Closure tuple does not support destructuring in Xcode 9 Swift 4

本小妞迷上赌 提交于 2019-11-27 22:57:03
问题 After the gloss project for Swift 4 in Xcode 9 I am getting following error which i have no idea Closure tuple parameter '(key: _, value: _)' does not support destructuring Code: extension Dictionary { init(elements: [Element]) { self.init() for (key, value) in elements { self[key] = value } } func flatMap<KeyPrime, ValuePrime>(_ transform: (Key, Value) throws -> (KeyPrime, ValuePrime)?) rethrows -> [KeyPrime:ValuePrime] { return Dictionary<KeyPrime, ValuePrime>(elements: try flatMap({ (key,

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

↘锁芯ラ 提交于 2019-11-27 18:26:23
I am using google maps in Xcode 9 beta, iOS 11. I am getting an error outputted to the log as follows: Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState] PID: 4442, TID: 837820, Thread name: com.google.Maps.LabelingBehavior, Queue name: com.apple.root.default-qos.overcommit, QoS: 21 Why would this be occurring as I am almost certain I'm not altering any interface elements from the main thread in my code. override func viewDidLoad() { let locationManager = CLLocationManager() locationManager.requestAlwaysAuthorization() locationManager

How can I add file to project in Xcode 9?

廉价感情. 提交于 2019-11-27 17:53:01
问题 I created a new project in xcode 9. I want to add image file to project. When I delete this file from desktop, Image file appears in red? But in project folder, I find this image file. In Xcode 8 its working fine, Any idea? 回答1: It is an Xcode9-beta (9M136h) bug. I don't know if it has been resolved in beta3 or not. Copy items if needed copies the file to your project directory but still links to the original file. What I do is, after dragging the file to my project, I select the folder icon

iOS 11 iPhone X simulator UITabBar icons and titles being rendered on top covering eachother

冷暖自知 提交于 2019-11-27 10:26:41
Anyone having issue with the iPhone X simulator around the UITabBar component? Mine seem to be rendering the icons and title on top of each other, I'm not sure if I'm missing anything, I also ran it in the iPhone 8 simulator, and one actual devices where it looks fine just as shown on the story board. iPhone X: iPhone 8 David Hooper I was able to get around the problem by simply calling invalidateIntrinsicContentSize on the UITabBar in viewDidLayoutSubviews. -(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; [self.tabBar invalidateIntrinsicContentSize]; } Note: The bottom of the tab

Use the increased navigation-bar title in iOS 11

北战南征 提交于 2019-11-27 09:28:22
问题 iOS 11 Beta 1 uses the increased navigation-bar title for almost all system-apps (it started doing this in iOS 10 and the Music app). I am wondering if Apple has a public API for this coming in iOS 11, or whether it will stay private for now. The behavior is that the title has an increased font-size, is left aligned and will move to the navigation-bar once the user scrolls down. I've attached some screens showing this behavior in the Messages app here: Although I could not find any reference

How can we use Assets Catalog Colors Sets

左心房为你撑大大i 提交于 2019-11-27 09:00:26
I usually use custom UIColors on iOS using extensions with Swift but now with iOS11/XCode9 we can create Colors Sets. How can we use them? Update - Tip As @Cœur says we can drag&drop de color, and use it like a UIColor object and a possible solution could be use it as a extension: Or as a constant: Now I wanna know if we can access them like an UIImage access to an Asset Image or not, like: UIImage(named: "image-name") -> UIColor(named: "color-name") user2421361 UIColor(named: "myColor") Source: WWDC 2017 Session 237 —— What's New in MapKit Caveat: Your project's Deployment Target needs to be

Simultaneous accesses to 0x1c0a7f0f8, but modification requires exclusive access error on Xcode 9 beta 4

余生颓废 提交于 2019-11-27 08:37:25
my project uses both Objective-C and Swift code. When a user logs in, it calls a set of apis for user preference, I have a DataCoordinator.swift class which schedules the API operation and I make this calls from UserDetailViewController.m class to load user preferences. This use to work fine before I migrated my code to Swift 4 using Xcode 9 beta 4. Now when I login it crashes by giving me this error in my DataCoordinator class. Below is a sample of my DataCoordinator and Viewcontroller class. DataCoordinator.swift import UIKit @objcMembers class DataCoordinator: NSObject { //MARK:- Private

iOS 11 iPhone X simulator UITabBar icons and titles being rendered on top covering eachother

南笙酒味 提交于 2019-11-27 04:02:00
问题 Anyone having issue with the iPhone X simulator around the UITabBar component? Mine seem to be rendering the icons and title on top of each other, I'm not sure if I'm missing anything, I also ran it in the iPhone 8 simulator, and one actual devices where it looks fine just as shown on the story board. iPhone X: iPhone 8 回答1: I was able to get around the problem by simply calling invalidateIntrinsicContentSize on the UITabBar in viewDidLayoutSubviews. -(void)viewDidLayoutSubviews { [super

Xcode 9 - “Fixed Width Constraints May Cause Clipping” and Other Localization Warnings

心已入冬 提交于 2019-11-26 23:45:00
I downloaded the new Xcode and in Interface Builder I'm having a ton of problems with warnings that say things like: Fixed Width Constraints May Cause Clipping It looks like this: I do have localization for several languages and I understand the warning that in another language a label's size may change, but my app doesn't have this problem. I ran and tested it in Xcode 8 yesterday, it was fine. I don't want to spend hours and hours adding pointless new constraints. Any suggested solutions? I was getting the same warnings even without multiple languages in my app , which led me to find out