ios8

PKPaymentAuthorizationViewController present as nil view controller

馋奶兔 提交于 2019-12-09 19:31:18
问题 I am trying to integrate Apple Pay in my demo app following this link & I am facing this issue issue. I have updated my iphone 6+ os to 8.1.1 version but still not able to present PKPaymentAuthorizationViewController properly & I am getting this error "Application tried to present a nil modal view controller on target".Please suggest something since I am stuck on this.Here is the code which I have written :- PKPaymentRequest *request = [[PKPaymentRequest alloc] init]; request.currencyCode = @

SceneKit get texture coordinate after touch with Swift

不羁岁月 提交于 2019-12-09 18:49:51
问题 I want to manipulate 2D textures in a 3D SceneKit scene. Therefore i used this code to get local coordinates: @IBAction func tap(sender: UITapGestureRecognizer) { var arr:NSArray = my3dView.hitTest(sender.locationInView(my3dView), options: NSDictionary(dictionary: [SCNHitTestFirstFoundOnlyKey:true])) var res:SCNHitTestResult = arr.firstObject as SCNHitTestResult var vect:SCNVector3 = res.localCoordinates} I have the texture read out from my scene with: var mat:SCNNode = myscene.rootNode

Setting a MapView's center coordinate does not take into account full size of MapView (off-screen portion)

穿精又带淫゛_ 提交于 2019-12-09 18:46:03
问题 The Problem I have a view that includes a full-screen MKMapView. The bottom half of the MapView is covered with a TableView that has translucent cells so that the map shows through. When I center on an annotation coordinate, the current location for example, the annotation view is blocked by the TableView. - (void)centerOnCurrentLocation { MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(self.locationManager.location.coordinate, 50000, 50000); [self.mapView setRegion:[self

KeychainItemWrapper Crashing for iOS8

耗尽温柔 提交于 2019-12-09 18:40:56
问题 I'm using KeychainItemWrapper for my application using the following line of code KeychainItemWrapper *currentUser = [[KeychainItemWrapper alloc] initWithIdentifier:@"com.example" accessGroup:nil]; [currentUser setObject:accountString forKey:CFBridgingRelease(kSecAttrAccount)]; accountString is a string containing my user information. The code works perfectly fine with iOS7 but crashes with iOS8. I'm not sure what i'm doing wrong., can someone please help!! I'm running the application on a

How to set height and width of a UIAlertController in IOS 8

强颜欢笑 提交于 2019-12-09 17:53:39
问题 I have a UIAlertController with an TextFile. The problem is that the default UIAlertController is a very small size. It's text cannot be seen properly. So, I want to increase the height and width of the UIAlertController. In other words, I want to create a custom UIAlertController. What would be the way to do that? 回答1: I do not think you can set the size. Bad workaround is, to set \n on the message. UIAlertView also has same limitation. I will suggest to use UIPopoverController and implement

How to use Touch ID sensor in iOS 8

梦想与她 提交于 2019-12-09 17:02:54
问题 One of the most things I was excited about iOS 8 was the ability to use fingerprint sensors on the iPhone 5s and later. Unfortunately I cannot find out what is the required framework for that, nor how I can make authentication. Please help me with: What framework required for using Touch ID? How to use its methods and how to authenticate the user? A code sample would be much appreciated. 回答1: More complete snippet, swift style: func authenticateUser() { // Get the local authentication context

Delayed push notifications and checking if user enabled it

风格不统一 提交于 2019-12-09 16:26:40
问题 I develop an app, which builds itself around push notifications. The app requests notification permissions only when the user reaches certain point of the registration process. I have already managed to do the following: the app maintains an NSUserDefaults variable, which indicates if it is required to register for push at launch or not (by default: not) when the registration reaches that point, I flip the variable and call -registerForRemoteNotificationTypes: on iOS 7 and

iOS8 + Apple's KeychainItemWrapper results in a crash

。_饼干妹妹 提交于 2019-12-09 16:26:37
问题 I've been digging around Apple forums and SO for this issue to no avail. Using Apple's KeychainItemWrapper (ARCified), trying to set the kSecAttrAccessible attribute to anything except the default ( kSecAttrAccessibleWhenUnlocked ) results in an assertion failure from SecItemUpdate returning an error. KeychainItemWrapper *wrapper = [[KeyChainItemWrapper alloc] initWithIdentifier:kMyIdentifier accessGroup:nil]; [wrapper setObject:kMyServiceName forKey:(__bridge NSString*)kSecAttrService];

Closures return value (previously completionBlock)

旧城冷巷雨未停 提交于 2019-12-09 16:18:06
问题 I'd like to return some values after the long term operation is completed. But furthermore I'd like to split the logic and the gui. For example; I have two classes SomeServices.swift which has a method named "getDataFromService..." MyTableViewController.swift which will display the result from "getDataFromService" So, previously in Objective-C I've just add a method in SomeServices like this: (void)getDataFromService:(void (^)(NSArray *, NSError *))completionBlock{ ...... } In this method I

MagicalRecord (CoreData) + Today Extension (iOS8)… Will They Play?

浪子不回头ぞ 提交于 2019-12-09 16:12:09
问题 Hoping you can help. I'm adding Today support to my app, which uses MagicalRecord https://github.com/magicalpanda/MagicalRecord to managing all my CoreData stuff. I'm tearing my hair out trying to understand how to surface my data into the Today extension. I have enabled app groups as outlined here http://blog.sam-oakley.co.uk/post/92323630293/sharing-core-data-between-app-and-extension-in-ios-8 however all the documentation and StackOverflow posts I'm reading relate to using CoreData