Tag: ios9

随着3D触摸偷看和stream行,你如何检测用户平移过程中(如Facebook)?

在Facebook应用程序中,如果您“窥视”作为相册一部分的照片,则可以水平滑动手指以转到其他照片。 这在API中如何完成? 我所看到的全部是提供一个视图控制器,并提交popup视图控制器。

如何将video片段保存到照片库 – ios 8&9

我已经努力将video剪辑保存到照片库。 这里的代码如下,但它不工作。 即使saveVideo返回true,但我打开照片库无法获取video剪辑。 文件path 是本地文档目录上的位置 func saveVideo(filePath: String) { UISaveVideoAtPathToSavedPhotosAlbum (filePath, self,"video:didFinishSavingWithError:contextInfo:", nil) } func video(filePath: String, didFinishSavingWithError error: NSError?, contextInfo:UnsafePointer<Void>) { if error == nil { let ac = UIAlertController(title: "Saved!", message: "Your altered video has been saved to your gallery.", preferredStyle: .Alert) ac.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) self.presentViewController(ac, animated: true, completion: nil) […]

如何在导航到UIViewController时将其旋转到支持的界面方向?

我有一个viewcontroller(与儿童viewcontrollers)被locking在肖像,使用下面的代码来完成这一点: – (UIInterfaceOrientationMask) supportedInterfaceOrientations { if ([self.centerViewController respondsToSelector:@selector(supportedInterfaceOrientations)]) { return [self.centerViewController supportedInterfaceOrientations]; } return UIInterfaceOrientationMaskAll; } 这完美的作品,我可以“重写”我的当前centerViewController supportedInterfaceOrientations如果我需要locking该视图,并保留它,如果我希望视图支持一切。 问题是被locking的视图在导航时不会旋转到支持的方向。 一个视图被locking在肖像中,但是当在景观中显示另一个视图并导航到这个视图时,它会以横向显示,即使这个视图不支持景观。 如何确保在浏览时将视图旋转到允许的方向?

如何在Swift中获得所有以前连接的Wi-Finetworking?

我知道不可能获得所有可用的Wi-Finetworking,并且有可能获得当前连接的Wi-Finetworking的信息,如果我错了,请纠正我的错误。 我只是想知道获取所有以前连接的Wi-Finetworking的信息的可行性,请分享您的经验帮助我。 仅供参考, 我正在使用下面的代码获取当前连接的Wi-Finetworking的信息,它工作正常。 var currentSSID: String! let interfaces:CFArray! = CNCopySupportedInterfaces() for i in 0..<CFArrayGetCount(interfaces) { let interfaceName: UnsafePointer<Void> = CFArrayGetValueAtIndex(interfaces, i) let rec = unsafeBitCast(interfaceName, AnyObject.self) let unsafeInterfaceData = CNCopyCurrentNetworkInfo("\(rec)") if unsafeInterfaceData != nil { let interfaceData = unsafeInterfaceData! as Dictionary! currentSSID = interfaceData["SSID"] as! String } else { currentSSID = "" } print(currentSSID) […]

如何检测点播资源下载后的位置?

我通过从以下两个答案中获取参考来实现我的项目中的应用程序细化: https://stackoverflow.com/a/33145955/988169 https://stackoverflow.com/a/31688592/988169 如何检测on demand resources下载后的位置?

无法弄清楚如何使用CLPlacemark正确地在消息正文中embedded我的当前位置

我几天前几乎没有尝试将我目前的位置embedded到我的iPhone上的Message body中,但是我失败了。 我尝试了我所有的想法,但我只有错误 我得到的最后一个错误是 “致命错误:意外地发现零,而解包可选值” 我创build了一个CLPlacemark的对象,我把它作为可选项,这意味着它可能有价值或可能CLPlacemark 。 有什么方法来创build一个消息与我目前的位置? MainMenu文件 import UIKit import Social import MessageUI import Foundation import CoreLocation class MainMenu: UIViewController , MFMessageComposeViewControllerDelegate , UINavigationControllerDelegate , MFMailComposeViewControllerDelegate, CLLocationManagerDelegate { let locationManager = CLLocationManager() func messageComposeViewController(controller: MFMessageComposeViewController, didFinishWithResult result: MessageComposeResult) { } let placeMarks = Location() @IBAction func TapOnEmergency(sender: UIButton) { let textMessageRecipients = ["+123456789"] […]

Swift 2.0 + Alamofire 3.0 – 缓慢加载JSON

我有一个展示健康食谱的项目。 该项目将JSON对象从Alamofire返回到Arraylist,然后返回Tableview中的Table Cell。 当我加载所有的对象到tableview它加载…很慢。 8+秒。 但是我的目标是3秒。 我知道这个问题是在alamofire周围,因为我检查打印(时间戳)。 任何我做错了? func getCookData(urlString: String , completionHandler: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String) -> ()) -> (){ Alamofire.request(.GET, urlString).responseJSON() { response in // var cookArray:[CookData] = [] if response.result.isSuccess { let data = response.result.value let cookJson = JSON(data!) for (var […]

KeychainItemWrapper在iOS 9上未加载OSStatus -34018(errSecMissingEntitlement)

我一直在使用KeychainItemWrapper。 但是由于我已经将手机更新到iOS 9,因此出于某种原因它不存储会话ID。 + (BOOL)createKeychainValue:(NSString *)value forIdentifier:(NSString *)identifier { NSMutableDictionary *dictionary = [self setupSearchDirectoryForIdentifier:identifier]; NSData *valueData = [value dataUsingEncoding:NSUTF8StringEncoding]; [dictionary setObject:valueData forKey:(__bridge id)kSecValueData]; // Protect the keychain entry so it's only valid when the device is unlocked at least once. [dictionary setObject:(__bridge id)kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly forKey:(__bridge id)kSecAttrAccessible]; // **THIS LINE OF CODE RETURNS -34108** OSStatus status = […]

search编程使用NSUserActivity和CoreSpotlight框架之间的基本区别是什么? 如何select它们?

如何确定在CoreSpotlight框架和NSUserActivity for Search Programming中哪一个最适合。

应用程序安装失败:应用程序已经禁止Info.plist键

就在最近,我试图将我的应用程序安装到我的iOS 9设备时遇到了错误,唯一不同的是我可以告诉现在,然后是我已经从iOS 8.4.1更新我的设备到iOS 9。 我正在安装使用Xcode 7,testing版6和我得到的错误说:“应用程序安装失败:未知的错误。” 我怀疑,我得到的更有用的错误消息是从安装过程中的设备日志,似乎与此有关的错误消息是: Sep 14 13:10:47 Bill-Luhmanns-iPhone installd[50] <Error>: 0x16e1bb000 -[MIExecutableBundle hasOnlyAllowedWatchKitAppInfoPlistKeysWithError:]: 1033: WatchKit app has disallowed Info.plist key: CFAppVersion 然后有一些其他的日志从不同的地方给出相同的信息。 任何想法如何让我的目标,允许在plist文件中的关键? 我检查文件是否在正确的位置,密钥是否存在等等。作为最后的努力,我已经删除了我的派生数据,并重新启动了Mac和设备,都没有用。 清理项目也没有帮助。 任何build议或方法来解决这个任何人都熟悉? 我真的很感激,谢谢!