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

UITextView with hyperlink text

Set isEditable = false or the text view will go into text-editing mode when user taps on it. Swift 4 and later let attributedString = NSMutableAttributedString(string: “Just click here to register”) let url = URL(string: “https://www.apple.com”)! // Set the ‘click here’ substring to be the link attributedString.setAttributes([.link: url], range: NSMakeRange(5, 10)) self.textView.attributedText = attributedString self.textView.isUserInteractionEnabled … Read more

Swipe-able Table View Cell in iOS 9

Try this, updated for Swift 3 (Developer Docs) override func tableView(_ tableView: UITableView, editActionsForRowAt: IndexPath) -> [UITableViewRowAction]? { let more = UITableViewRowAction(style: .normal, title: “More”) { action, index in print(“more button tapped”) } more.backgroundColor = .lightGray let favorite = UITableViewRowAction(style: .normal, title: “Favorite”) { action, index in print(“favorite button tapped”) } favorite.backgroundColor = .orange let … Read more