ios8

If Device Supports Touch ID

半世苍凉 提交于 2019-12-21 18:13:09
问题 Wondering how I can determine if the device the user has supports the Touch ID API? Hopefully have this as a boolean value. Thanks! 回答1: try this: - (BOOL)canAuthenticateByTouchId { if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { return [[[LAContext alloc] init] canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil]; } return NO; } or like @rckoenes suggest: - (BOOL)canAuthenticateByTouchId { if ([LAContext class]) { return [[[LAContext alloc] init]

Can't unwrap Optional.None error in swift

戏子无情 提交于 2019-12-21 17:55:02
问题 When the value is passed for UILabel the error appears : Can't unwrap Optional.None source code: @IBOutlet var rowLabel : UILabel var row: String? { didSet { // Update the view. println(row) rowLabel.text = row } } Also error appears in label in the template for UITable when I appropriate new meaning: let myCell : Cell = Cell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "cell") myCell.myLabel.text = "(indexPath.row)" 回答1: You must use newValue in willSet block, and oldValue in

UISearchBar width doesn't change when its embedded inside a UINavigationBar

落爺英雄遲暮 提交于 2019-12-21 17:32:05
问题 I'm experimenting with the new UISearchController API introduced in iOS 8. Although the API is new, it uses the same old UISearchBar . I added it to the UINavigationController 's titleView . import UIKit class ViewController: UIViewController, UISearchBarDelegate { override func viewDidLoad() { super.viewDidLoad() let searchController = UISearchController(searchResultsController: nil) searchController.hidesNavigationBarDuringPresentation = false searchController

Are new characters possible with a custom keyboard in iOS 8?

跟風遠走 提交于 2019-12-21 16:51:47
问题 In iOS 8, Apple has given developers the ability to create custom keyboards. In the documentation, Apple states that you should create a new keyboard if you want to support a language that iOS does not currently support. Therefore, if you are able to support new languages, are you able to create a keyboard that contains new emoji characters? I would assume that by Apple stating that you can support a new language, they would expect there to be custom characters involved. If including custom

ios 8 (UITableViewCell) : Constraints ambiguously suggest a height of zero for a tableview cell's content view

半世苍凉 提交于 2019-12-21 14:24:28
问题 I have a tableview using auto layout constraints , every thing is working in iOS 7 but when i tested in iOS 8 get me the below warning Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead. After i made a profound investigations about this issue i found should add the below lines in viewdidload for iOS8 only self.tableView.rowHeight =

AppCode targeted device families not valid (iPad iOS 8.1)

落爺英雄遲暮 提交于 2019-12-21 13:00:11
问题 I keep getting this error in AppCode, but usually it runs just fine with Xcode: Error:xcodebuild: error: The run destination iPad Mini is not valid for Running the scheme 'Appname'. Error:iPad Mini doesn't match any of Appname.app's targeted device families. You can expand Appname.app's targeted device families to support iPad Mini. Error:Build failed with 2 errors and 0 warnings in 7 sec Note:Building for 2 architectures. Double click to set 'ONLY_ACTIVE_ARCH=YES' to speed up compilation.

How to get the edited image from UIImagePickerController in Swift?

陌路散爱 提交于 2019-12-21 12:42:12
问题 I have seen and read the documents of Apple where they have clearly mentioned about the key UIImagePickerControllerEditedImage. But when I am running my following code, I am not getting that key in the Dictionary. What is the reason behind this? My Code: func imagePickerController(picker: UIImagePickerController!, didFinishPickingMediaWithInfo info:NSDictionary!) { println(info) //var tempImage:UIImage = info[UIImagePickerControllerOriginalImage] as UIImage var tempImage:UIImage? = info

How to get the edited image from UIImagePickerController in Swift?

被刻印的时光 ゝ 提交于 2019-12-21 12:41:00
问题 I have seen and read the documents of Apple where they have clearly mentioned about the key UIImagePickerControllerEditedImage. But when I am running my following code, I am not getting that key in the Dictionary. What is the reason behind this? My Code: func imagePickerController(picker: UIImagePickerController!, didFinishPickingMediaWithInfo info:NSDictionary!) { println(info) //var tempImage:UIImage = info[UIImagePickerControllerOriginalImage] as UIImage var tempImage:UIImage? = info

UIKeyboard Suggestions height for iOS 8 notification?

时光毁灭记忆、已成空白 提交于 2019-12-21 12:29:53
问题 I'm trying to keep a text field sitting atop the keyboard in iOS 8. But when a user swipes up or down the top of the keyboard to show or dismiss iOS 8 word suggestions, I need to a notification of the new height of the keyboard so I can move my text field up or down by that height. How can I accomplish this? Thanks! 回答1: You can register for UIKeyboardDidShowNotification and then get the keyboard frame from the notification with UIKeyboardFrameEndUserInfoKey. [[NSNotificationCenter

iOS 8 custom keyboard crash when debugging

限于喜欢 提交于 2019-12-21 12:27:08
问题 Issue Most times, when I try to debug my custom keyboard extension, I receive the following error and then the keyboard disappears (presumably crashes, so the system removes it from screen and replaces it with the standard keyboard) plugin com.db.Trype.TrypeKeyboard interrupted (Note: Trype is the name of my keyboard.) Process I am debugging the keyboard the following way: I have the keyboard extension as a target. I've modified the TrypeKeyboard scheme to run my app executable on launch. The