ios8

Google Analytics not initialising in Swift

放肆的年华 提交于 2019-12-06 01:04:52
问题 My new swift app does not initialise Google Analytics for some reason. I created a bridging header in my project for all the GAnalytics files: #import "GAI.h" #import "GAIDictionaryBuilder.h" #import "GAIEcommerceFields.h" #import "GAIEcommerceProduct.h" #import "GAIEcommerceProductAction.h" #import "GAIEcommercePromotion.h" #import "GAIFields.h" #import "GAILogger.h" #import "GAITrackedViewController.h" #import "GAITracker.h" And this is part of my AppDelegate.swift file: func application

NSArray objectAtIndex index 0 beyond bounds for empty array

孤人 提交于 2019-12-06 01:01:29
I'm working on someone else's app and and I'm getting this error: 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array' Xcode points to this line: NSDictionary *geo = [response[0] objectForKey:@"geometry"]; Here's the full method: - (void)loadLatLong { indx ++; if (indx == [datalist count]) { [self showMarker]; // self.alertView.hidden = true; // [self setThreeQuarters]; [self.progressbar setProgress:1.0 animated:YES]; return; } PointClass *pt = datalist[indx]; NSString *stPt = [pt.Location stringByAddingPercentEscapesUsingEncoding

Force audio file playback through iPhone loud speaker using Swift

主宰稳场 提交于 2019-12-06 00:37:55
问题 I have an App that records and then plays back an audio file. Currently the audio playback is playing through the earpiece speaker. Could someone tell me how Swift would handle coding this to force the audio out the loud speaker instead? Below is a one of the instances I'm using to play the audio file: @IBAction func playAudioVader(sender: UIButton) { playAudioWithVariablePitch(-1000) } func playAudioWithVariablePitch(pitch: Float){ audioPlayer.stop() audioEngine.stop() audioEngine.reset()

How to detect an app extension is enabled in containing app on iOS 8?

限于喜欢 提交于 2019-12-05 23:41:14
问题 I am developing a custom keyboard on iOS 8 beta, and I want to tell the user that how to enabled it in containing app if my custom keyboard is not enabled, is there any way to detect an app extension is enabled ? 回答1: 1) first of all let's set some constants to make it easy to understand each other: containing app = the app that installs the extension and holds the extension binary and target host app = the app that the extension is running inside (other party) extension = any of iOS8's new

iCloud Key-Value-Store Synchronization issues (NSUbiquitousKeyValueStoreDidChangeExternallyNotification not called)

拜拜、爱过 提交于 2019-12-05 23:37:34
问题 i am writing a small universal game for iOS. the highscore will be synched accross devices through an iCloud Key/Value store. getting the newest score: func retrieveHighestScore() -> Int64 { let iCloudScore: Int64 = NSUbiquitousKeyValueStore.defaultStore().longLongForKey(KeyValueKeyClassification.KeyHighscore.toRaw()) let localScore: Int64 = Int64(NSUserDefaults.standardUserDefaults().integerForKey(KeyValueKeyClassification.KeyHighscore.toRaw())) var result: Int64 = 0 if localScore >

Map rotation horribly slow on ios8

有些话、适合烂在心里 提交于 2019-12-05 23:31:47
问题 I got the following code in a VC in an old project (no storyboard, pure code) : - (void)viewDidLoad { [super viewDidLoad]; self.mapView = [[MKMapView alloc] initWithFrame:CGRectInset(self.view.frame, 10, 10) ]; [self.view addSubview:self.mapView]; self.view.backgroundColor = [UIColor redColor]; self.mapView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; self.view

How to present a semi-transparent (half-cut) viewcontroller in iOS 8

核能气质少年 提交于 2019-12-05 23:18:59
问题 in iOS 7 there is no problem for this method: _rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext; [_rootViewController presentViewController:self animated:NO completion:nil]; But in iOS 8 it did nothing.How to solve it? Is it a Bug for iOS 8? 回答1: My answer is more simple, below code. This works in iOS8 (XCode6 GM seed). HogeViewController *vc = [[HogeViewController alloc] init]; vc.modalPresentationStyle = UIModalPresentationOverFullScreen; [self

IQKeyboardManager not disabling

时光怂恿深爱的人放手 提交于 2019-12-05 22:25:21
Trying to disable IQKeyboardManager for a particular ViewController or for the whole app, it's not working. My AppDelegate code: [[IQKeyboardManager sharedManager] setEnableAutoToolbar:NO]; [[IQKeyboardManager sharedManager] setEnable:NO]; [[IQKeyboardManager sharedManager] disableToolbarInViewControllerClass:[TCChatViewController class]]; [[IQKeyboardManager sharedManager] disableInViewControllerClass:[TCChatViewController class]]; Also trying to disable in viewWillAppear: : [[IQKeyboardManager sharedManager] setEnableAutoToolbar:NO]; [[IQKeyboardManager sharedManager] setEnable:NO]; Disable

Core data/iCloud seeding with local xml file throwing errors in iOS8

微笑、不失礼 提交于 2019-12-05 22:08:55
问题 Hopefully this is something simple but I haven't been able to track down a fix yet. I have an application that I'm trying to implement both iCloud and Core Data with. I'd like it to run on iOS7 and iOS8. The application is a checklist/tableview application for collectibles. Essentially, the application has an pre-seeded xml file with about 50,000 in it. The sqlite/core data is initially configured to have just 1 item. Users can, from a table view, select groups to add to the core data store

Google Directions API failing to return results in iOS

六月ゝ 毕业季﹏ 提交于 2019-12-05 21:43:25
I’m trying to use Google Directions API. I have the SDK all set up. I have enabled Google Maps SDK for iOS under the Services in the developer console. Below is the URL I've built to get the directions. There are two types of keys in the developer console. First I tried with the Key for iOS apps. https://maps.googleapis.com/maps/api/directions/json?origin=-37.814107,144.96328&destination=-31.953004,115.857469&key=<Key for iOS apps> But I got the error This IP, site or mobile application is not authorized to use this API key . When I searched for a solution to this error I saw in a few