ios9

Register notification in iOS 9

隐身守侯 提交于 2019-12-05 10:57:52
I am using this to register notification : if application.respondsToSelector("registerUserNotificationSettings:") { let types:UIUserNotificationType = (.Alert | .Badge | .Sound) let settings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: types, categories: nil) application.registerUserNotificationSettings(settings) application.registerForRemoteNotifications() } else { // Register for Push Notifications before iOS 8 application.registerForRemoteNotificationTypes(.Alert | .Badge | .Sound) } But it's not woking for iOS 9. I have found solution : if application

UIAlertController not working in iOS 9

我的梦境 提交于 2019-12-05 10:37:38
I have added the UIAlertController code showing login and password textfields, it works for iOS 8 but in iOS 9 not works. The textfields shrinks as shown in figure below The code I am trying is as follows : - (void)toggleLoginLdap:(UIViewController *)currentVC { if ([UIAlertController class]) { self.alertController= [UIAlertController alertControllerWithTitle:@"Title of Msg" message:@"Hello" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action){ NSString *userName = self

Change tintcolor of SFSafariViewController?

被刻印的时光 ゝ 提交于 2019-12-05 10:25:10
问题 As the title says; how does one change the overall tint color of the new, in iOS 9, SFSafariViewController? 回答1: Some news from iOS 10: now we have two properties to control the overall looks of the SFSafariViewController source: link The only downside is, of course, it's not available for older versions. if #available(iOS 10.0, *) { safariVC.preferredBarTintColor = .black safariVC.preferredControlTintColor = .white } else { safariVC.view.tintColor = .someColor } 回答2: It's a property of the

Can't hide status bar on launch

送分小仙女□ 提交于 2019-12-05 10:05:41
I'm building an iOS 9 app with horizontal pages navigation and need to show the status bar on some pages, and hide it on others. I want to use the fade in/out animation so I have to set View controller-based status bar appearance = NO and update the status bar like this: [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; This procedure works perfectly when navigating between pages, but I can't get rid of the status bar on launch. I have tried setting: Status bar is initially hidden = YES Adding this to the NavigationControllers viewDidLoad: [

Xcode 7.0 Beta fails to launch a watchOS 2 App on Apple Watch

人盡茶涼 提交于 2019-12-05 08:01:45
Tried a public sample code project and my own project. Observe no problem with watchOS 1. watchOS 2 App installs and operates successfully on the real Apple Watch and the simulator, but it won't support the debug mode launching the app on the device by Xcode. Tried to allow the system to create the Provisioning files and manually create the Provisioning files for the development mode. Test on 10.10, 10.11. Steps to Reproduce: Set up the Provisioning files on build settings, watchOS 2 environment and etc. Go to the scheme on the left top of the Xcode 7.0 beta and choose the iPhone and Apple

AVPlayer's video and audio become out of sync after pausing and then resuming video

北城余情 提交于 2019-12-05 07:46:56
I'm using AVPlayer to play videos in my app. Video playback always works perfectly, except for when you pause/resume the video. If the user presses the pause button, and then resumes the video, sometimes the audio will be ahead of the video. The video resumes at the correct location, but the audio is ahead. It's as if when you press pause, the audio keeps running. When they press the pause button, all I am doing is calling the pause method of the AVPlayer , and I have also tried setting it's rate property to 0.0 which is supposed to be the exact same thing according to the documentation. I

Failed to load optimized model at path error with Google Maps API using Xcode 7 / iOS9

我只是一个虾纸丫 提交于 2019-12-05 07:03:22
I am trying to use the Google Places API autocomplete feature in my code. import UIKit import GoogleMaps class ViewController: UIViewController, GMSMapViewDelegate { var placesClient: GMSPlacesClient? override func viewDidLoad() { super.viewDidLoad() placesClient = GMSPlacesClient() let filter = GMSAutocompleteFilter() filter.type = GMSPlacesAutocompleteTypeFilter.City placesClient?.autocompleteQuery("Pizza", bounds: nil, filter: filter, callback: { (results, error: NSError?) -> Void in if let error = error { print("Autocomplete error \(error)") } for result in results! { if let result =

PFFacebookUtils logInInBackgroundWithReadPermissions doesn't open Facebook after iOS9 update

大兔子大兔子 提交于 2019-12-05 06:58:25
I've updated to iOS9, and now my Facebook login button, which calls: [PFFacebookUtils logInInBackgroundWithReadPermissions:@[@"public_profile"] block:^(PFUser * _Nullable user, NSError * _Nullable error) {...} doesn't even attempt to open Facebook. I've added the necessary files to my info.plist file ( as suggested here ), which now looks like this: But the FB app doesn't launch, and the block is never called. Any ideas? The (Parse) Facebook login in iOS9 by default will use Facebook in the safari browser instead of the Facebook App as this is now regarded as the best user experience. If the

NSAllowsArbitraryLoads not working for ip address

笑着哭i 提交于 2019-12-05 06:50:17
I am trying to get my app to connect to an http server at 152.111.198.244 through the Apple Transport Security. And nothing I'm trying works. Adding the NSAllowsArbitraryLoads key to the info.plist file of my project still did not allow my app to connect to this specific ip address 152.111.198.244 I have gone through the technote on Apple Transport Security. I installed OSX 10.11 to try and find what settings might work for the URL using nscurl --ats-diagnostics http://152.111.198.244 and nscurl --ats-diagnostics http://152.111.198.244/publications/ in the terminal. All settings that nscurl

UITableViewAutomaticDimension not working on iOS 8

五迷三道 提交于 2019-12-05 06:48:17
I was following this tutorial to make self sizing cells. I registered custom cell into table view and in the cell xib I gave every subview constraints manually. Please refer to the source code in GitHub Arranging 3 labels vertically in one cell's content view worked fine in iOS 9 but not in iOS 8 (both tested in device and simulator). In iOS 8 one cell does not have fitting height and not every label shows all it's full text. iOS 8 not fitting: iOS 9 as I expected: Any advice would be appreciated! Update code in viewDidLoad : tableView.registerNib(UINib.init(nibName: "SelfSizingCell", bundle: