ios9

How to send data from Iphone to Watchkit in OS2 in SWIFT

妖精的绣舞 提交于 2019-12-06 01:02:35
问题 I want to send a dictionary from iPhone to Watchkit in watchOS 2. In watchOS 1 it works fine for me with appgroups but in watchOS 2 I know that we have to use WCSession but I don't know how to use it. Please help me find the solution. 回答1: This blog post should help you out. From that post: First, you'll create and activate a WCSession like so: if (WCSession.isSupported()) { let session = WCSession.defaultSession() session.delegate = self session.activateSession() } For transferring a

NEVPNErrorDomain Error 1 when trying to start TunnelProvider network extension

时光毁灭记忆、已成空白 提交于 2019-12-06 00:44:30
I'm trying to make a custom TunnelProvider network extension by starting with the XCode template for the TunnelProvider and then adding the code to the host app in order to configure it and start it. I am using an instance of NETunnelProviderManager to configure it, and when I call saveToPreferencesWithCompletionHandler: I get success (error = 0). However, when I call startVPNTunnelAndReturnError: on the (non-zero) connection I always get the below error: Error Domain=NEVPNErrorDomain Code=1 "(null)" I have read through all of the related Apple documentation as well as tried to make my program

How to use xcodebuild in Xcode 7 with a watch extension

我与影子孤独终老i 提交于 2019-12-06 00:36:34
问题 Our command used to be like this xcodebuild -configuration Release -target "xxx" -sdk iphoneos9.0 -scheme "xxx" archive Now in Xcode 7, we get this error: Build settings from command line: SDKROOT = iphoneos9.0 === BUILD TARGET xxx WatchKit Extension OF PROJECT Mobile WITH CONFIGURATION Release === Check dependencies target specifies product type 'com.apple.product-type.watchkit2-extension', but there's no such product type for the 'iphoneos' platform How do we specify to use iOS 9.0 SDK and

Eddystone beacon detecting issue

房东的猫 提交于 2019-12-06 00:24:04
Here is a code I use to detect Eddystone using iPhone iOS 9: - (void)viewDidLoad { [super viewDidLoad]; if ([CLLocationManager locationServicesEnabled]) { _locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; self.locationManager.pausesLocationUpdatesAutomatically = NO; [self.locationManager requestAlwaysAuthorization]; NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"f7826da6-4fa2-4e98-8024-bc5b71e0893e"]; NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; CLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID

XCode 7: Unable to Convert OCUnit to XCTest

夙愿已清 提交于 2019-12-05 23:40:16
I upgraded the XCode to 7.0 and ran into compilation issues. XCode asked me to convert my test target to use XCTest and I followed the wizard screen. I'm unable to find any test targets and cannot finish converting. Does any one know how to fix this ? Thanks. Make sure you have selected the scheme of your test target (in the top-left scheme selector), then select Edit -> Convert -> To XCTest... This will make Xcode recognize the appropriate target. 来源: https://stackoverflow.com/questions/32707166/xcode-7-unable-to-convert-ocunit-to-xctest

AVAudioPlayer sound not playing

六眼飞鱼酱① 提交于 2019-12-05 19:55:12
问题 In iOS 8/Xcode 6 I had a function that included a sound effect. It no longer works in iOS 9 after changing the code multiple times. This is what I've tried: Original: let bangSoundEffect = SKAction.playSoundFileNamed("Bang.mp3", waitForCompletion: false) runAction(bangSoundEffect) Other attempt: self.runAction(SKAction.playSoundFileNamed("Bang.mp3", waitForCompletion: false)) Also: func playRocketExplosionSound(filename: String) { let url = NSBundle.mainBundle().URLForResource( filename,

Way to go ahead after mpmovieplayercontroller deprecation in iOS9

自闭症网瘾萝莉.ら 提交于 2019-12-05 19:01:17
I have a code which does: self.video = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]]; self.video.movieSourceType = MPMovieSourceTypeStreaming; [[self.video view] setFrame:[[self view] bounds]]; [self.view addSubview:self.video.view]; [self.video play]; It basically loads a url and starts playing it. With the deprecation of MPMoviePlayerController what is the framework to be used to do the above functionality. Use below ways provided by Apple. Basically using AVFoundation framework, Also it support picture in picture feature to support latest iOS 9 multi tasking

accessory bar hiding in ios 9

蓝咒 提交于 2019-12-05 18:19:43
Hi can someone help me out i want to hide the accessory bar from keyboard in ios 9 its working find till ios 8 but in ios 9 i am not able to hide the accessory bar i tired this code but its not working for (UIView *possibleFormView in [keyboardWindow subviews]) { if([[possibleFormView description] hasPrefix:@"<UIInputSetContainerView"]) { for(UIView *view1 in possibleFormView.subviews) { if([[view1 description] hasPrefix:@"<UIInputSetHostView"]) { for (UIView *peripheralView_sub in view1.subviews) { //Hides the backdrop (iOS 8) if ([[peripheralView_sub description] hasPrefix:@"

GTMSessionFetcher.h file not found upgrading app to latest google-api-objectivec-client

大城市里の小女人 提交于 2019-12-05 16:43:56
I implement access to Google Drive in my iOS app. This has been an active feature in the app since middle of 2014 and functions properly under iOS 6, 7 & 8. I am currently checking my project for compatibility with iOS 9. I've downloaded the latest google-api-objectivec-client to ensure my project remains up to date. I redid the standard Google implementation... as detailed in this page and included for completeness at the end of this post. Problem: When I attempt to build in any of my releases I receive the error " GTMSessionFetcher.h file not found". I'm certain I've implemented the API

UITapGestureRecognizer issue in iOS 9

房东的猫 提交于 2019-12-05 16:23:57
问题 I guys, today I've updated my iPhone to iOS 9 and now have problems with a gesture recognizer. This is the error: WARNING: A Gesture recognizer (; target= <(action=onVideoTap:, target=)>>) was setup in a storyboard/xib to be added to more than one view (->; layer = >) at a time, this was never allowed, and is now enforced. Beginning with iOS 9.0 it will be put in the first view it is loaded into. I didn't have this problem with iOS8. The view contains a UIImageView and a TextView. The