ios9

Permission to take photo OR get image from library not shown in iOS9 (Xcode 7beta, Swift2)

倖福魔咒の 提交于 2019-12-03 07:56:46
The code below shows an example for my access to the image lib. No matter where I call the code (view) I do not see the permission dialog from the phone popping up and therefore cannot allow my app to access either camera or library. Also, the privacy settings do not show my app either. Any thoughts? I'm going nuts. let imgPicker = UIImagePickerController() imgPicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary imgPicker.modalPresentationStyle = UIModalPresentationStyle.Popover self.presentViewController(imgPicker, animated: true, completion: nil) another way I tried if

API to capture Live Photos in iOS9

自闭症网瘾萝莉.ら 提交于 2019-12-03 06:53:20
问题 I can't find any API to capture live photos. Did I miss something? Apple release DOCs Live Photos Live Photos is a new feature of iOS 9 that allows users to capture and relive their favorite moments with richer context than traditional photos. When the user presses the shutter button, the Camera app captures much more content along with the regular photo, including audio and additional frames before and after the photo. When browsing through these photos, users can interact with them and play

Returning CGFloat.leastNormalMagnitude for UITableView section header causes crash

隐身守侯 提交于 2019-12-03 06:31:49
I made an app for iOS 8 which uses grouped UITableView for one of its page. There are multiple sections in it that uses CGFloat.leastNormalMagnitude (or CGFloat.min in Swift 2 and below) for section header and footer height to remove the "default" space. Everything went well until the app run in iOS 9 and 10, where it crashes with this error: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'section header height must not be negative - provided height for section 0 is -0.00000' Somehow, any value under 1 (except the rounded 0 ) is treated as a negative -

UIApplication.sharedApplication().setStatusBarStyle() deprecated in iOS 9

青春壹個敷衍的年華 提交于 2019-12-03 06:30:23
问题 I have been using UIApplication.sharedApplication().setStatusBarStyle() In my appDelegate and it has worked fine, but since iOS 9, this method is deprecated and I can't find an alternative. I want to change the statusbar style to .LightContent for my whole application, but the only suggestion xCode gives me is to handle this in every VC separately with; override func preferredStatusBarStyle() -> UIStatusBarStyle { return .LightContent } Has anyone an idea how to do this for the whole

Launching with UIApplicationShortcutItem

情到浓时终转凉″ 提交于 2019-12-03 06:28:08
问题 I'm implementing some 3D touch quick actions for my iOS 9 app in swift, and I have a curious issue. When my app is in the background and I launch with the quick action, everything goes as planned. When my app is totally dead (i.e. I killed it from the multitasking menu), and I launch with the quick action, the app crashes. I'm having trouble debugging this as once I kill the app, the debug session in Xcode gets detached. Is there a way for me to connect to the app to debug like normal, or is

UIDatePicker issue in iOS9

放肆的年华 提交于 2019-12-03 06:19:13
问题 Date is hiding in UIDatePicker in iOS9. i am using xib. This issue is only in xoode7(iOS9) Can any one help me to solve my issue?? 回答1: I think this is problem with new font San Francisco (the font is big than Helvetica ) and .xib file. It can be hacked around by changing the UIDatePicker mode right before it was displayed, and then changing it back to the desired one: [myDatePicker setDatePickerMode:UIDatePickerModeDateAndTime]; [myDatePicker setDatePickerMode:UIDatePickerModeDate]; Also try

Trying to do screen capture with private framework IOSurface no longer seems to work in iOS 9

南笙酒味 提交于 2019-12-03 06:12:57
I'm working on an existing (non app-store) app for a client that uses the IOSurface private framework to do screen captures while in the background. There are a few threads here on SO that outline the technique, as well as several open source example projects. Again, this is an internal application used by the client. It isn't intended for app-store release, so the fact that it uses private frameworks is acceptable. Here is an example project on Github that uses a very similar technique: https://github.com/k06a/UIView-FastScreenshot I just tried to run the client's app on the latest iOS 9 beta

UIImagePickerController crashing on force touch?

≡放荡痞女 提交于 2019-12-03 06:10:57
问题 With iOS 9, all of my UIImagePickerControllers are now crashing if I do a force touch on the presented images. Error message is : *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSObject previewingContext:viewControllerForLocation:]: unrecognized selector sent to class 0x1a0752020' I guess this is an Apple bug, but has anybody a work around ? 回答1: Here's a workaround: https://gist.github.com/nolanw/bd0a8997632fe92a9f83 (warning: swizzles a method on a

iOS Contacts How to Fetch contact by phone Number

纵饮孤独 提交于 2019-12-03 06:07:55
问题 I just want to get contact given name and family name by phone number. I tried this but this is too much slow and cpu is hitting over %120. let contactStore = CNContactStore() let keys = [CNContactGivenNameKey, CNContactFamilyNameKey, CNContactPhoneNumbersKey] var contacts = [CNContact]() do { try contactStore.enumerateContactsWithFetchRequest(CNContactFetchRequest.init(keysToFetch: keys), usingBlock: { (contact, cursor) in if (!contact.phoneNumbers.isEmpty) { for phoneNumber in contact

CoreData: Failed to load optimized model at path

假装没事ソ 提交于 2019-12-03 05:56:54
I am getting this warning multiple times when i goto a view using google maps.This started as soon as i migrated to swift 2.0 and xcode 7 for my exising project .Im using google maps in my project. See the console log below I have gone through some links but was not helpful https://code.google.com/p/gmaps-api-issues/issues/detail?id=8459 https://forums.developer.apple.com/thread/14157 Gameo Hamasaki In my case I needed doing 1) update cocoa pod, 2) setup again, and 3) update pods. 1) $ gem update cocoapods 2) $ pod setup 3) $ pod update As indicated in your console log, this is caused by an