ios9

Load desktop version WKWebView iOS 9

心已入冬 提交于 2019-12-01 13:43:33
Up until recently let url = NSURL (string:http://asite.com) let request = NSMutableURLRequest(URL: url!) //iOS loads the mobile version of asite.com which does not have the required DOM so we force the desktop version by setting new value forHTTPHeadrField let newUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.6 Safari/537.11" request.setValue(newUserAgent, forHTTPHeaderField: "User_Agent") let config = WKWebViewConfiguration() //even though we dont need to see it the webpage needs to appear but we set its frame to CGRectZero

Hide gray box in UiSplitView when animating to PrimaryHidden from PrimaryOverlay in iPhone

此生再无相见时 提交于 2019-12-01 12:11:58
There are numerous answers here that describe how to programmatically animate the primary split view: let addButton = self.splitViewController!.displayModeButtonItem() UIApplication.sharedApplication().sendAction(addButton.action, to: addButton.target, from: nil, forEvent: nil) On an iPad this works wonderfully! But on an iPhone there is this annoying gray box that trails the primary view. By wrapping that action in a UIView.animate block, its possible to see it quite clearly: The box is hardly visible when you actually dismiss the primary view by tapping over the detail view, but is really

With Xcode 7 testing an iOS 9 app is unable to obtain data from a http request

北城以北 提交于 2019-12-01 11:52:26
问题 I am developing an application in iOS. For my development I am using Xcode beta7. Before, I used to test my app in my mobile with iOS 8.4 after updating to iOS 9, I can't install the same app in my mobile. Please give me some suggestions. Big thanks! 回答1: Add this line to your .plist file: Source: <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>yoursite.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads<

Swift: Triggering TableViewCell to lead to a link in a UIWebView in another ViewController

痴心易碎 提交于 2019-12-01 10:40:53
问题 When i tap a tableViewCell I want a link (that is specific to that cell's indexPath.row ) to open up in a new viewController with a webView. Example: I tap the 3rd cell in the tableView and www.apple.com opens up on a new viewController. I'm trying to do that with didSelectRowAtIndexPath but I can't figure out how to put the code together so that the code from the linksArray (where i have all the links stored) works together when I tap the tableViewCell I'm querying these links from Parse.com

CNUI ERROR Selection predicates are set but the delegate does not implement contactPicker:didSelectContact:

时光总嘲笑我的痴心妄想 提交于 2019-12-01 10:12:35
I try to use the new iOS 9.0 CNContactPickerViewController to select a contact in objective-C. I set the delegate and implement the CNContactPickerDelegate methods. @import ContactsUI; @import Contacts; //----------------------------------------------------------------------- - (void) presentContacts { CNContactPickerViewController *contactPicker = [[CNContactPickerViewController alloc] init]; contactPicker.delegate = self; contactPicker.predicateForEnablingContact = [NSPredicate predicateWithFormat:@"familyName LIKE[cd] 'smith'"]; contactPicker.predicateForSelectionOfContact = [NSPredicate

How to share notes data with share extension in iOS 9?

白昼怎懂夜的黑 提交于 2019-12-01 09:18:07
My application is working fine till iOS 8 But in iOS 9 Beta I am not able to share Notes text/image so can you please suggest me what thinks I need to implement for this? Add **NSExtensionActivationDictionaryVersion** Attributes in your plist file. see this image for reference. What to use if I am using NSPredicate for NSExtensionActivationRule? <key>NSExtensionAttributes</key> <dict> <key>NSExtensionActivationRule</key> <string> SUBQUERY( extensionItems, $extensionItem, SUBQUERY ( $extensionItem.attachments, $attachment, ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.movie"

WKWebView ScaleToFit

元气小坏坏 提交于 2019-12-01 08:32:35
Moving from UIWebView to WKWebView, I can not figure out how to make the HTML that I am loading using the loadHTMLString function on WKWebView size to fit the view bounds. I now get the html to load but it goes off the right and bottom of my view. How do I scale it to fit my view bounds? Fay007 First of all, take a container view in StoryBoard under which you are going to add the WKWebView as a subview : @IBOutlet var container: UIView! then import WebKit and initialize it and later add as the subview of the container. In order to preserve the bound you have to give it constraint value

CNContactStore retrieve a contact by email address

这一生的挚爱 提交于 2019-12-01 07:54:21
I would like to use the Contacts Framework (IOS 9) to retrieve contacts that matching an email address. Any help will be appreciated. Objective C please. Thanks. minjoongkim Add Contacts.framework #import <Contacts/Contacts.h> write code -(void)loadContactList { CNAuthorizationStatus status = [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts]; if( status == CNAuthorizationStatusDenied || status == CNAuthorizationStatusRestricted) { NSLog(@"access denied"); } else { //Create repository objects contacts CNContactStore *contactStore = [[CNContactStore alloc] init]; //Select

Facebook login page showing blank page in IOS 9

浪尽此生 提交于 2019-12-01 07:38:35
I am using FBSDKCoreKit (4.12.0) FBSDKLoginKit (4.12.0) first i am getting screen 1 This method is block is never called . FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init]; [login logInWithReadPermissions:@[@"email",@"public_profile"] fromViewController:self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { //never called }]; getting this warning Warning: Attempt to present <FBSDKContainerViewController: 0x16570810> on <ViewController: 0x16528870> whose view is not in the window hierarchy! Then i press ok button i am getting blank page without moving to any other

Unable to register for Push Notifications (Xcode 7, iOS9)

北慕城南 提交于 2019-12-01 07:17:05
问题 I've upgraded my devices to iOS 9 and my Xcode environment to 7.0 (7A220). My app registers for notifications via: [[UIApplication sharedApplication] registerForRemoteNotifications]; However, neither "didRegisterForRemoteNotificationWithDeviceToken" or "didFailToRegisterForRemoteNotificationsWithError" are called. Furthermore, my app does not appear in the Settings->Notifications section (which tells me its not even trying to register for remote/push notifications) My App ID has the following