Tag: ios8

KeyboardViewController NSLog IOS 8

我们可以在iOS 8的其他视图中使用NSlog进行login(Xcodetesting版)。 但是,我无法在KeyboardViewController中进行NSLog的键盘扩展。 它没有出现在日志中。 NSLog(@“viewdidload in keyboard”); 我想知道如何实时检测/login。

“在使用Swift在Xcode 6中导入时,没有这样的模块”LocalAuthentication“

我想用新的LocalAuthentication框架和Swift构build一个简单的演示应用程序。 我做了一个新的单视图项目,并添加了一行到ViewController.swift文件的顶部: import LocalAuthentication 于是Xcode告诉我没有这个模块。 很明显Swift非常新,我做错了什么?

两个查询约束在一个关键与parsing和Swift

大家好,我试图得到所有的用户名不包含在数组中的用户名( dontShowUsers ,我也想用variablesname来限制查询,这样可以得到所有用户名和用户名相同的用户。做这个: findUsers.whereKey("username",containsString:name) findUsers.whereKey("username",notContainedIn:dontShowUsers) 每个用户显示。 它同时处理这两个查询,并将它们加在一起。 我想用第二个whereKey约束第一个whereKey 。 最好的办法是什么呢?

UIActionSheet不显示在iOS 8中

我可以在iOS 7中显示actionSheet,但不能在iOS 8环境中显示。 有什么方法可以追踪? UIActionSheet *_actionSheet = [[UIActionSheet alloc] initWithTitle:@"Account" delegate:self cancelButtonTitle:@"Close" destructiveButtonTitle:@"Log Out" otherButtonTitles:@"View Account", nil]; [_actionSheet showInView:appDel.window];

UIAlertController – 更改文本字段的大小并在它们之间添加空格

我的警报看起来像这样: 是否有可能使input变大并在它们之间增加空间? 这是我的代码的例子。 我试图改变第二个textField的框架属性,但没有帮助: let alert = UIAlertController(title: title, message: message, preferredStyle: .Alert) // Add the textfields alert.addTextFieldWithConfigurationHandler({ (textField) -> Void in textField.placeholder = "Vaše jméno" }) alert.addTextFieldWithConfigurationHandler({ (textField) -> Void in textField.placeholder = "Společné heslo" var oldFrame = textField.frame oldFrame.origin.y = 40 oldFrame.size.height = 60 textField.frame = oldFrame })

在NSUserDefaults中保存一个元组

我正在使用一个元组来存储这样的东西。 var accessLavels: (hasInventoryAccess: Bool, hasPayrolAccess: Bool) accessLavels = (hasInventoryAccess: true, hasPayrolAccess: false) 现在我想把它保存在NSUserDefaults 。 NSUserDefaults.standardUserDefaults().setValue(accessLavels, forKey: "AccessLevelKey") NSUserDefaults.standardUserDefaults().synchronize() 但是我得到以下错误。 types'(hasInventoryAccess:Bool,hasPayrolAccess:Bool)'不符合协议'AnyObject' 我该如何解决这个问题? 如果不可能的话,那么任何其他的build议来拯救元组是值得欢迎的。 谢谢。

为什么我不能在xcode 6.1中使用show segue?

所以我正在做另一个swift项目的testing,我想连接一个embedded了NavigationController的TableViewController到一个常规的ViewController使用barbutton项和第二个ViewController 。 当我控制拖动button到ViewController ,我只能得到以下选项: 据我所知,我应该看到一个很长的清单,包括显示和显示细节。 即使我用push或其他segue连接它们,如果select了segue,我也不能selectshow或show detail作为segue的types。 我究竟做错了什么? 我没有修改ViewController.swift 。 谢谢!

在Apple Swift中,在什么情况下我不希望隐式解包可选项?

我相信我明白为什么选项是方便的(我最好的想法是能够返回一个零布尔值),但在什么情况下,我想声明一个包装的可选使用? 而不是 ! 为隐式解包可选。 这似乎没有必要宣布? 然后input! 到处都是,而不仅仅是使用! 一旦。 我不想忽视? 作为无用的,但我只是无法find它的用途…任何想法?

无法在iOS 8上select联系人

我有一个ABPeoplePickerNavigationController的子类来处理在我的应用程序中select一个联系电话号码。 一切工作在iOS 7及以下的伟大。 但是,在iOS 8上,我的ABPeoplePickerNavigationControllerDelegate在select电话号码时不会被打中。 相反,它只是拨打那个电话号码。 我注意到,我用来处理iOS 7中的联系人select的方法( peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:在iOS 8中已被弃用。此方法已被peoplePickerNavigationController:didSelectPerson:property:identifier:取代。 我知道我的委托设置,因为我成功地接收peoplePickerNavigationControllerDidCancel:方法callback。 有没有人遇到过这个问题? 以下是我的ABPeoplePickerNavigationController子类的代码片段: – (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier { [self peoplePickerNavigationController:peoplePicker shouldContinueAfterSelectingPerson:person property:property identifier:identifier]; } – (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier { …do stuff… return NO; } – (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { return YES; } – (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker { [self dismissViewControllerAnimated:self.shouldAnimateDismiss completion:NULL]; }

位置权限的iOS alertview不会popup

我刚开始我的项目为iOS 8,我跑了太多的问题,我不能让问题popup权限。 我在info.plist中添加了以下内容 <key>NSLocationWhenInUseUsageDescription</key> <string>The spirit of stack overflow is coders helping coders</string> <key>NSLocationAlwaysUsageDescription</key> <string>I have learned more on stack overflow than anything else</string> 这是我的代码: @interface ViewController () <MKMapViewDelegate> @property (nonatomic, strong) UIPopoverController* userDataPopover; @property (weak, nonatomic) IBOutlet MKMapView *mapView; @property (strong, nonatomic, retain) CLLocationManager *locationManager; @end @implementation ViewController -(CLLocationManager *)locationManager { if(!_locationManager) _locationManager = […]