ios10

HTTP/2 Server Push in iOS 10

北慕城南 提交于 2019-12-04 14:39:27
I am trying to get server push working on iOS 10. I am working off of the Akamai HTTP/2 demo. https://http2.akamai.com/demo The following is my attempt at testing server push. @interface ViewController () <NSURLSessionTaskDelegate> @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: self delegateQueue: [NSOperationQueue mainQueue]]; NSString *displayArtUrl; for

How to respond to local notification when app is closed in iOS10?

…衆ロ難τιáo~ 提交于 2019-12-04 14:31:44
How to respond to local notification when app is completly closed (not in background)? When the app is running in the background or foreground everything works fine. But when the app is closed and I'm trying to answer to a notification, only "application didFinishLaunchingWithOptions" gets called, "userNotificationCenter didRecive response " isn't answering. I found this question ( How to handle UNNotificationAction when app is closed? ) but in my case it doesn't work neither at a real device nor in a simulator. I also noticed that the function "UNUserNotificationCenter.current()

UICollectionView cellForItemAt indexPath is skipping row indexes in iOS 10

我们两清 提交于 2019-12-04 13:49:44
I have UICollectionView with horizontal scrolling and paging. When I scroll to next or previous page for the first time or change scrolling direction from left to right, value of indexPath.row in cellForItemAtIndexPath is changing by 3 not 1. Then it works properly. CollectionView works without problems in iOS 9. The problem occurs just in iOS 10. Thanks. Problem was with new prefetching feature of UICollectionView. Disabling of prefetching solved my problem. if #available(iOS 10.0, *) {collectionView.isPrefetchingEnabled = false} Possible Case: Since you're using paging in your collectionView

I'm trying to import either GoogleAPIClient or GoogleAPIClientForREST

自作多情 提交于 2019-12-04 13:42:35
I'm trying to follow Google's tutorial on making their QuickStart app to learn how to make API calls with Swift. I followed the tutorial completely and ended up with this code import GoogleAPIClient import GTMOAuth2 import UIKit class ViewController: UIViewController { private let kKeychainItemName = "Drive API" private let kClientID = "592019061169-nmjle7sfv8i8eahplae3cvto2rsj4gev.apps.googleusercontent.com" // If modifying these scopes, delete your previously saved credentials by // resetting the iOS simulator or uninstall the app. private let scopes = [kGTLAuthScopeDriveMetadataReadonly]

Keyboard extension loses height in iOS 10 when trying to size automatically in some cases

强颜欢笑 提交于 2019-12-04 12:15:36
问题 You can download a sample project demonstrating the issue below here: https://github.com/DimaVartanian/keyboard-extension-height-bug When creating a keyboard extension and not specifying a concrete height for its components but instead anchoring them to the view/inputView so that in theory the system will determine their height based on environment and orientation, in some situations that height instead turns into 0 and the keyboard is crushed (with the exception of anything that has a

Ranging Beacons in iOS 10

て烟熏妆下的殇ゞ 提交于 2019-12-04 12:04:06
问题 In my app, I use Beacon Region Monitoring in CoreLocation. The app sets 2 proximityUUID as region (they have different id), and start ranging like following. #pragma mark - CLLocationManagerDelegate (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { [self.locationManager requestStateForRegion:(CLBeaconRegion *)region]; } - (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region { [self.locationManager stopRangingBeaconsInRegion:

AVSpeechSynthesizer errors in iOS 10

两盒软妹~` 提交于 2019-12-04 11:50:15
I'm currently creating a text-to-speech app using AVSpeechSynthesizer() . It's working fine in iOS 9 but has the following error in iOS 10: Could not get attribute 'LocalURL': Error Domain=MobileAssetError Code=1 "Unable to copy asset attributes" UserInfo={NSDescription=Unable to copy asset attributes} Does anyone know what's going on here? static let speechSynthesizer = AVSpeechSynthesizer() static func speak(text: String) { if speechSynthesizer.isSpeaking { speechSynthesizer.continueSpeaking() } else { let speechUtterance = AVSpeechUtterance(string: text) speechUtterance.rate = 0.45 // 0.0 -

UITableView didSelectRowAt is not called iOS 10, but works for 9.3.5

狂风中的少年 提交于 2019-12-04 11:47:07
There are lots of questions regarding this problem, but the answers I have found so far are not applicable. In this case, the table works correctly in iOS 9.3.5, but not for iOS 10 (or 10.3.1) I have ruled out: Not setting up the delegate properly. The delegate performs 3 functions, didSelectRowAt , heightForRowAt , and editActionsForRowAt . The latter is the right-to-left swipe which gives the option to perform the exact same functionality as selecting the row. . These three functions work correctly on v9.3.5 (as tested via simulator and and older iPad I test with.) When I use v10 via the

In iOS10, is it possible to access Keychain from within a static library/framework, for unit testing

萝らか妹 提交于 2019-12-04 10:38:24
Until Xcode 8/iOS 10, I was able to access the Keychain from within the unit tests of a static library. After upgrading, I get an error, see stack trace: failed: caught "NSInternalInconsistencyException", "Couldn't add the Keychain Item." ( 0 CoreFoundation 0x000000010b2a734b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010ad0821e objc_exception_throw + 48 2 CoreFoundation 0x000000010b2ab442 +[NSException raise:format:arguments:] + 98 3 Foundation 0x000000010a89eedd -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195 4 MyLibTests 0x0000000117366dea -

Strange white space at UITableView header when using UISearchController with UITableViewController on iOS 10

别等时光非礼了梦想. 提交于 2019-12-04 10:38:15
The white space only appears on iOS 10. I ran into this problem as well. If you have the vertical scroll indicator enabled, you should be able to see that it's a UIScrollView 's inset issue. And seems like it only happens when you use a UITableViewcontroller as the searchResultsController of a UISearchController . And this extra space is visible at both the top and bottom of the view. This answer is not pretty, but I'm adding this in for now. if #available(iOS 10.0, *) { automaticallyAdjustsScrollViewInsets = false tableView.contentInset = UIEdgeInsetsMake(64, 0, 44, 0) } You're setting a