swift3

App is not opening when click on Push Notifications in killed/close state in Swift 3

橙三吉。 提交于 2019-12-23 19:54:31
问题 How to open a Application when app is in killed/closed state , i m getting the notifications but when i click on notification app is not opening,, but working fine when app in foreground or background.I tried below code still not getting where is issue.Pls check what i have tried func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { if #available(iOS 10.0, *) { let center = UNUserNotificationCenter.current(

How to present the arabic keyboard while changing the application language to arabic?

房东的猫 提交于 2019-12-23 19:13:12
问题 I have a mobile application which supports the Arabic and English language. So for this i am using two separate storyboard to flip the layout right to left while changing the language(Not sure whether its a good thinking of using two separate storyboard for Arabic and Malayalam. Please do suggest of any other better solution). But thats not the case i wish to present the user with Arabic keyboard while changing the application language to Arabic for filling the registration form. How to

NSTextField margin and padding? (Swift)

試著忘記壹切 提交于 2019-12-23 17:27:05
问题 I am wondering if there’s a possibility to set a margin or padding for NSTextField ? I achieved a more or less custom looking textField (the first one in this screenshot)... ... using this code: myTextField.wantsLayer = true myTextField.layer?.cornerRadius = 2.0 myTextField.layer?.borderWidth = 1.0 myTextField.layer?.borderColor = CGColor(red: 0.69, green: 0.69, blue: 0.69, alpha: 1.0) However, it feels like I have to add some padding on the left side so that the numbers are not too close to

Cannot invoke initializer for type 'Range<String.Index>' with an argument list of type '(start: String.Index, end: String.Index)'

泪湿孤枕 提交于 2019-12-23 17:14:41
问题 let greenHex = hex.substring(with: Range<String.Index>(start: hex.index(hex.startIndex, offsetBy: 2), end: hex.index(hex.startIndex, offsetBy: 4))) This is Swift3.0, hex is a string, but this code throws an error saying that: Cannot invoke initializer for type 'Range' with an argument list of type '(start: String.Index, end: String.Index)' 回答1: Range.init(start:end:) constructor was removed in Swift 3.0 so you initialize a range like follows: let range = hex.index(hex.startIndex, offsetBy: 2)

PaintCode StyleKit Swift 3.0 Error with CGGradient

…衆ロ難τιáo~ 提交于 2019-12-23 17:04:41
问题 StyleKit Code: static let red: UIColor = UIColor(red: 0.800, green: 0.000, blue: 0.000, alpha: 1.000) static let blue: UIColor = UIColor(red: 0.200, green: 0.600, blue: 1.000, alpha: 1.000) static let green: UIColor = UIColor(red: 0.000, green: 0.600, blue: 0.200, alpha: 1.000) static let yinying: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 0.200) static let redGradient: CGGradient = CGGradientCreateWithColors(CGColorSpaceCreateDeviceRGB(), [UIColor.whiteColor().CGColor,

Swift 3 - Firebase Push Notification, How can I do?

安稳与你 提交于 2019-12-23 16:53:38
问题 I do like below in Swift 2. But It's not working in Swift 3. How Can I provide this? If someone explain this It would be great. didFinishLaunchingWithOptions let notificationSettings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil) UIApplication.sharedApplication().registerUserNotificationSettings(notificationSettings) application.registerForRemoteNotifications() and func application(application: UIApplication, didRegisterUserNotificationSettings

Weird Swift 3 issue with latest Amazon AWS Mobile sample code

 ̄綄美尐妖づ 提交于 2019-12-23 16:14:11
问题 Following along the current sample code for aws.amazon.com/mobile/ there are a number of code items they have not updated really well to Swift 3 (which is pretty bizarre considering their resources). When you come to AWSMobileClient.swift there's a line of code like this: if (!isInitialized) { AWSIdentityManager.defaultIdentityManager().resumeSession(completionHandler: {(result: AnyObject?, error: NSError?) -> Void in print("Result: \(result) \n Error:\(error)") } as! (Any?, Error?) -> Void)

Combine translation, alpha and scale animations in swift3

依然范特西╮ 提交于 2019-12-23 14:20:20
问题 I'm totally newbies with iOS Swift developement and i try to combine three parameters in a single animations but i don't succeed. I think the solution is here -Apple Dev Core Animation Programming Guide by grouping the animations but being a beginner and after a lot of Internet research i can't find what i'm looking for. What do you think of my code and what is for you the best solution to combine performance and stability. I want to point out that the purpose of this animation is to create

Clear input of SFSpeechAudioBufferRecognitionRequest after every result (Swift3)

做~自己de王妃 提交于 2019-12-23 13:16:01
问题 I have integrated speech to text through this appcoda tutorial. The problem I am facing is I want that user can write/edit something himself, but SFSpeechAudioBufferRecognitionRequest doesn't take into consideration the thing user has typed. What's the way to send user typed input in SFSpeechAudioBufferRecognitionRequest or any way to clear SFSpeechAudioBufferRecognitionRequest input params before sending new request. Thanks in advance. 回答1: Here is what I use to create my recognition request

Facebook login in Swift 3

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 12:53:33
问题 Hi I'm having a problem with FBLogin in Swift It always displays "User cancelled login." in iOS8.2 and "Falling back to storing access token in NSUserDefaults because of simulator bug" when I use iOS10.1 Do you have any suggestions regarding this issue? 回答1: I solved this issue by adding these functions in my AppDelegate.swift @available(iOS 9.0, *) public func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { return