Detect if app is running in Slide Over or Split View mode in iOS 9

Just check if your window occupies the whole screen: BOOL isRunningInFullScreen = CGRectEqualToRect([UIApplication sharedApplication].delegate.window.frame, [UIApplication sharedApplication].delegate.window.screen.bounds); If this is false, then you’re running in a split view or a slide over. Here is the code snipped which will automatically maintain this flag irrespective of rotation -(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { // simply create a property of ‘BOOL’ … Read more

Does App Store reject submission if NSAllowsArbitraryLoads set to YES?

Thanks for everyone’s answer. The good news is Apple Accepted my app with NSAllowsArbitraryLoads set to YES. UPDATE (Thanks @Vijayts): Apple will reject Apps not conforming to ATS after the end of Dec 2016. Source However, If you need to load a http:// resource only in web (UIWebView/WKWebView/SafariViewController) then the following should suffice. <key>NSAppTransportSecurity</key> <dict> … Read more

Apple Live Photo file format

A live photo has two resources. They are tied together with an asset identifier (a UUID as a string). A JPEG; this must have a metadata entry for kCGImagePropertyMakerAppleDictionary with [17 : assetIdentifier] (17 is the Apple Maker Note Asset Identifier key). A Quicktime MOV encoded with H.264 at the appropriate framerate (12-15fps) and size … Read more

Synchronous URL request on Swift 2

If you really wanna do it synchronously you can always use a semaphore: func send(url: String, f: (String) -> Void) { var request = NSURLRequest(URL: NSURL(string: url)!) var error: NSErrorPointer = nil var data: NSData var semaphore = dispatch_semaphore_create(0) try! NSURLSession.sharedSession().dataTaskWithRequest(request) { (responseData, _, _) -> Void in data = responseData! //treat optionals properly dispatch_semaphore_signal(semaphore) … Read more

tech