xcode9-beta

Compile error in Swift 4 on parameter passing

我的梦境 提交于 2019-11-26 23:20:58
问题 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

Xcode 9 - Localization Issue Warning Storyboard

◇◆丶佛笑我妖孽 提交于 2019-11-26 23:00:42
问题 I am currently testing out Xcode 9 beta 3 at the time of this writing. When viewing the storyboard I am receiving a list of warnings indicating that in other languages/regions my fixed constraint will pose an issue. The application is fairly complex and many views are experiencing these warnings. The warning is: Certain autolayout constraint combinations may result in an appropriate layout in the current development language but will pose issues in other languages and regions. I know that the

Barcode on swift 4

和自甴很熟 提交于 2019-11-26 18:51:45
I'm trying to upgrade mi app to swift 4, but the barcode reader is not working. I have isolated the barcode reader code, and still not working. The camera works but it does not detect the barcode. The code worked just fine on swift 3 iOS 10. This is the complete code import AVFoundation import UIKit class ViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { var captureSession: AVCaptureSession! var previewLayer: AVCaptureVideoPreviewLayer! override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = UIColor.black captureSession = AVCaptureSession() let

navigation bar rightbaritem image-button bug iOS 11

ε祈祈猫儿з 提交于 2019-11-26 18:32:46
This code works ok in ios10. i get my label and an image button which is the user photo profile, circular round.. ok. but when running xcode 9 ios11 simulator i get it streched out. the button frame has to be 32x32 , when checking on the sim and getting the view and telling xcode to describe the view i get output as 170x32 or somethint like that. heres my code. let labelbutton = UIButton( type: .system) labelbutton.addTarget(self, action:#selector(self.toLogin(_:)), for: .touchUpInside) labelbutton.setTitleColor(UIColor.white, for: .normal) labelbutton.contentHorizontalAlignment = .right

How can we use Assets Catalog Colors Sets

半腔热情 提交于 2019-11-26 14:26:21
问题 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") 回答1: UIColor(named: "myColor") Source:

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

给你一囗甜甜゛ 提交于 2019-11-26 12:57:27
问题 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

The use of Swift 3 @objc inference in Swift 4 mode is deprecated?

ぃ、小莉子 提交于 2019-11-26 10:59:14
Briefly, while using Xcode 9 Beta, I have run into the following warning: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and disable Swift 3 @objc inference.** After some research, I still have no idea how to fix the issue. I would greatly appreciate any tips on how to fix this issue as well as an explanation of what is going on. My goal is to grasp a better understanding of what is happening with my code. I got rid of this warning by changing

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

廉价感情. 提交于 2019-11-26 08:46:40
问题 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

navigation bar rightbaritem image-button bug iOS 11

谁都会走 提交于 2019-11-26 06:27:47
问题 This code works ok in ios10. i get my label and an image button which is the user photo profile, circular round.. ok. but when running xcode 9 ios11 simulator i get it streched out. the button frame has to be 32x32 , when checking on the sim and getting the view and telling xcode to describe the view i get output as 170x32 or somethint like that. heres my code. let labelbutton = UIButton( type: .system) labelbutton.addTarget(self, action:#selector(self.toLogin(_:)), for: .touchUpInside)

Barcode on swift 4

孤者浪人 提交于 2019-11-26 05:32:17
问题 I\'m trying to upgrade mi app to swift 4, but the barcode reader is not working. I have isolated the barcode reader code, and still not working. The camera works but it does not detect the barcode. The code worked just fine on swift 3 iOS 10. This is the complete code import AVFoundation import UIKit class ViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { var captureSession: AVCaptureSession! var previewLayer: AVCaptureVideoPreviewLayer! override func viewDidLoad() {