ios10

How to update data in TableView without the delay using CloudKit when Creating new Records

ぐ巨炮叔叔 提交于 2019-11-28 01:14:01
There are 2 View Controllers in my App. The first "MainViewController" displays a tableView with CKRecords fields fetched from the private CloudKit database. Inside the viewWillAppear method of this VC I fetch records from CloudKit and reload data of a tableview to show the latest fetched results that have been previously saved in the CloudKit by the user. The second view controller "CreateRecordViewController" is made for creating CKRecords and saving them to the private database of the CloudKit. So i create records in the CreateRecordViewController and show them in the MainViewController.

iOS10 SFSafariViewController not working when alpha is set to 0

这一生的挚爱 提交于 2019-11-28 00:36:48
问题 I'm using SFSafariViewController to grab user's cookie in my app. Here's is my code: SFSafariViewController *safari = [[SFSafariViewController alloc]initWithURL:[NSURL URLWithString:referrerUrl] entersReaderIfAvailable:NO]; safari.delegate = self; safari.modalPresentationStyle = UIModalPresentationOverCurrentContext; safari.view.alpha = 0.0; safari.view.hidden = true; [self dismissViewControllerAnimated:false completion:nil]; NSLog(@"[referrerService - StoreViewController] presenting safari

iOS 10 - App crashes To access photo library or device camera via UIImagePickerController

亡梦爱人 提交于 2019-11-28 00:28:18
Below is my code to access photo library -(void)click_gallery { if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { UIImagePickerController *imgPicker= [[UIImagePickerController alloc] init]; UIColor* color = [UIColor colorWithRed:46.0/255 green:127.0/255 blue:244.0/255 alpha:1]; [imgPicker.navigationBar setTintColor:color]; imgPicker.delegate = self; imgPicker.allowsEditing = YES; imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentViewController:imgPicker animated:NO completion:Nil]; } } And it aborts with This

How can I remove previously delivered notifications when a new notification arrives with UNUserNotificationCenterDelegate in iOS 10?

若如初见. 提交于 2019-11-27 23:45:44
问题 This question is about the new UserNotifications framework in iOS 10. I have an app that schedules a local notification every half hour after the user did a certain action in the app, starting at 1 hour. To avoid cluttering a user's lock screen or notification center, I only want one notification to show up at a time, so there is only one notification with the most recent, relevant information. My plan to achieve this is to clear all delivered notifications any time a new notification is

Contact Address book crash on iOS 10 beta

≯℡__Kan透↙ 提交于 2019-11-27 22:03:26
When click on any contacts in address book (inside my app) it's crashing on iOS 10 beta and working fine on iOS 9 versions; This is the crash log *** Terminating app due to uncaught exception 'CNPropertyNotFetchedException', reason: 'A property was not requested when contact was fetched.' *** First throw call stack: (0x1cf11a07 0x1c62af63 0x1cf1194d 0x246f0f4f 0x246c6a71 0x1ce355eb 0x1ce2e19b 0x246c69cf 0x246c6883 0x25e4a375 0x2538f283 0x254204ef 0x25420bb1 0xe9da97 0xe9da83 0xea2321 0x1cecf18f 0x1cecd477 0x1ce1e6bd 0x1ce1e549 0x1e54ebfd 0x21f961e3 0x21f90947 0x966c9 0x1ca9e507) libc++abi

Open Wifi Settings by “prefs:root=WIFI” failed in iOS 10

情到浓时终转凉″ 提交于 2019-11-27 21:13:02
问题 I was using prefs:root=WIFI url scheme in my app with prefs entered in info.plist to open directly the iOS settings application in Wi-Fi settings and it was working great on iOS 9 but it does not work anymore on iOS 10. Does anyone know if this is just a regression in the first developer preview or the way to open Wi-Fi settings has changed in iOS 10 or it is not allowed anymore? 回答1: Just so it's explicit: Apple does not allow this. It's possible your app will make it through anyway, but

cornerRadius stopped working in Swift 2.3 / iOS 10 / Xcode 8

旧时模样 提交于 2019-11-27 20:03:44
I have a cornerRadius set on a UIView and a UIImageView inside the same UIView . I am calculating the corner radius with RockProfileView.frame.size.height / 2 but the UIView stopped showing in iOS 10. After further checking i found the value of RockProfileView.frame.size.height / 2 is coming out to be 1000.0 while the width and height constraint is set to 64.0 When I hardcoded the RockProfileView.layer.cornerRadius = 32 to 64/2 it works just fine. What could be the issue ? Full code: RockProfileView.layer.cornerRadius = RockProfileView.frame.size.height / 2 RockProfileView.clipsToBounds = true

xcode 8 push notification capabilities and entitlements file setting

喜你入骨 提交于 2019-11-27 19:50:58
问题 when using xcode 8 doing the push notification setting, unlike xcode 7 , xcode 8 need developer turn on push notifications capabilities switch ( located at TARGETS -> AppName -> Capabilities as following pic ), then it will generate AppName.entitlements file as following //AppName.entitlements <key>aps-environment</key> <string>development</string> but for production version App, if we change the string to //AppName.entitlements <key>aps-environment</key> <string>production</string> then the

AVPlayer playback fails while AVAssetExportSession is active as of iOS 10

﹥>﹥吖頭↗ 提交于 2019-11-27 19:32:52
AVPlayer will randomly just play audio, not showing the video track... Playing video correctly with AVPlayer while having an active compression session of AVAssetExportSession:exportAsynchronouslyWithCompletionHandler is now failing. It seems it causes some instability that persists until the app goes into the background and comes back. Examining AVURLAsset when video playback fails, there is a video track even though there is no video output. I also don't get any errors from the compressor or the other playback components... The problem happens even for a while after the compression session

Remove duplicate structs in array based on struct property in Swift

烈酒焚心 提交于 2019-11-27 19:27:15
问题 I have made a simple struct and implemented the Equatable protocol : extension MyModelStruct: Equatable {} func ==(lhs: NModelMatch, rhs: NModelMatch) -> Bool { let areEqual = lhs.id == rhs.id return areEqual } public struct MyModelStruct { var id : String? var staticId : String? init(fromDictionary dictionary: NSDictionary){ id = dictionary["id"] as? String ... } Then in my project i get an array of [MyModelStruct], what i what to do is to remove all the MyModelStruct that have the same id