ios9

accessing and downloading on demand resources iOS9

半城伤御伤魂 提交于 2019-12-20 01:11:34
问题 I am trying to implement new iOS9 feature app thinning, I understood how tag an image and enable on demand resource in Xcode 7 but I don't understand how to implement NSBundleResourceRequest in my app, can someone help me, that would greatly appreciated 回答1: First, check if the resources are available. Else download them. Here is the swift code I use let tags = NSSet(array: ["tag1","tag2"]) let resourceRequest = NSBundleResourceRequest(tags: tags as! Set<String>) resourceRequest

wkwebview auto fill login form swift 2

痴心易碎 提交于 2019-12-20 01:10:30
问题 im new in the Swift World. I have a big problem ... I've tried to write an app that has only one WKWebView. It is like a web browser. The app should be able to fill die LogIn Fields automatically from an object or a list. But for test reasons i have put the login data into variables. class ViewController: UIViewController , WKNavigationDelegate{ // Zugänge let pw : String = "test" let bn : String = "test@test.com" // Adresse let adresse : String = "https://www.facebook.com" var webView:

iOS9 This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes

 ̄綄美尐妖づ 提交于 2019-12-19 13:10:08
问题 I have just dowloaded the latest XCode (7.1 beta) and have started playing around with iOS9. I had an app working perfectly with no errors in iOS8 but now I get the following error from overriding the drawRect method in a UITableViewCell class : "This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release." here is the backtrace : Stack:( 0 CoreFoundation

iOS9 This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes

让人想犯罪 __ 提交于 2019-12-19 13:09:21
问题 I have just dowloaded the latest XCode (7.1 beta) and have started playing around with iOS9. I had an app working perfectly with no errors in iOS8 but now I get the following error from overriding the drawRect method in a UITableViewCell class : "This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release." here is the backtrace : Stack:( 0 CoreFoundation

Is it possible to set custom font & size for NSString?

走远了吗. 提交于 2019-12-19 11:56:25
问题 I'm working with Swift in iOS 9. I want to customize the font for a UIAlertAction . I searched these questions for a Swift answer: Change the Font of UIAlertAction in Swift Is it possible to customize the font and appearance of a UIAlertController in the new XCode w/ iOS8? And this question for an Objective-C answer: UIAlertController custom font, size, color But there was no solution for customizing the font for a UIAlertAction . I believe the problem is that a UIAlertAction uses an NSString

Load desktop version WKWebView iOS 9

牧云@^-^@ 提交于 2019-12-19 11:45:06
问题 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

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

回眸只為那壹抹淺笑 提交于 2019-12-19 10:47:49
问题 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

WKWebView ScaleToFit

隐身守侯 提交于 2019-12-19 09:52:48
问题 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? 回答1: 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

WKWebView ScaleToFit

痞子三分冷 提交于 2019-12-19 09:52:28
问题 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? 回答1: 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

Connect to a Server with Invalid Certificate using NSURLSession (swift2,xcode7,ios9)

放肆的年华 提交于 2019-12-19 09:15:14
问题 I'm using Xcode 7, Swift 2, and iOS9. I want to connect to a web service using NSURLSession but I get the following error when I try to connect: 2015-10-13 16:07:33.595 XCTRunner[89220:4520715] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813) 2015-10-13 16:07:33.604 XCTRunner[89220:4520571] Error with connection, details: Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to