A new feature was added in Catalina that lets the user use their local user account password (or Touch ID) to log into Apple websites when that local user account is logged in to iCloud. There are a few problems with this feature.

Recently, I have been working on an app that is centered around opening files on iOS. Opening files is something we have been able to do on iOS for several years now and the concept is pretty simple. While working on this app I ran into a bug in iOS 13.

Users can no longer select multiple folders with UIDocumentPickerViewController in iOS 13. This is obviously a problem when your app’s functionality is heavily reliant on opening an arbitrary number of files and folders that users select.

I have a very simple sample project that demonstrates the regression.

The code is very simple:

let documentPicker = UIDocumentPickerViewController(documentTypes: [kUTTypeDirectory as String], in: .open)
documentPicker.allowsMultipleSelection = true
present(documentPicker, animated: true, completion: nil)

It just creates a document picker by specifing the UTIs we allow the user to select. I have not found a different UTI or combination of UTIs that create a UIDocumentPickerViewController that allows user to select multiple folders.

Side Note: Choosing a single folder is still supported if you use the UTI of kUTTypeFolder instead of kUTTypeDirectory. The curious thing is that a completely different view is presented when creating the document picker view controller with just the kUTTypeFolder UTI. This view does not have the “select” functionality that would allow multiple folder selection.

Reproduction Steps


Set up two simulators, one iOS 12.x and one iOS 13.x, and sign in to an iCloud account. Make sure that iCloud account has two folders in iCloud drive.

iOS 12

  1. Run the sample app.
  2. Tap the button.
  3. Tap “select” to enter selection mode.
  4. Verify you are able to select the folders.

iOS 13

  1. Run the sample app.
  2. Tap the button.
  3. Tap “select” to enter selection mode.
  4. Verify you are NOT able to select the folders.

With this simple project you can see that selecting multiple folders at a time was supported on iOS 12 and is no longer possible with the exact same code on iOS 13. I have not been able to find any documentation stating this change was intentional.


Quick refresher: There are a couple supported ways to let users select a document and do something with it.

UIDocumentPickerViewController UIDocumentPickerViewController is a view controller that your app can use to let a user import, export, open, or move a file/document. It’s a pretty simple idea. You present this view controller when the user needs to move a file in/out of your app.

UIDocumentBrowserViewController UIDocumentBrowserViewController is a view controller for browsing and performing actions on documents. It is designed to be the root view controller in a document-based app (like Pages, Numbers, Keynote, etc.). UIDocumentBrowserViewController is designed to be the view controller you design/build your entire app around. You start at the document browser and only navigate away when a user selects a document.

So, we have already addressed the fact that UIDocumentPickerViewController does not work for a situation where you need to open/import more than one folder at a time.

Open folders one at a time

The first solution is more of a change in your app navigation than a functional replacement. You could create a flow where users would open one folder at a time until they have opened all of folders they want. This only works if you know that the user needs/wants to open a folder before presenting the UIDocumentPickerViewController.

[Mis]Use UIDocumentBrowserViewController

The best work-around I have found so far is to present a UIDocumentBrowserViewController modally, even though the documentation explicitily says not to do this. It seems to work well even though it is not intended to be used as a document picker.

Bug Report

I filed a bug in Feedback Assistant on December 9, 2019. It is still “Open” but has a resolution of “Investigation complete - Works as currently designed”. I don’t know exactly what that status means, but it sounds like Apple thinks this isn’t an issue and will not fix it. (But if that is the case then why not mark the issue as “Closed”?) I just find it really hard to belive that it “works as currently designed” given that opening multiple folders at a time was possible in iOS 12, and no longer seems to be possible in iOS 13 without misusing UIDocumentBrowserViewController.

In hindsight, my initial bug report could have been a little more detailed, though I thought it was pretty clear from the sample project that the behavior in iOS 13 was different than iOS 12. I hope this blog post will help provide any missing details and get the attention of someone at Apple so this gets a second look.

Feedback Assistant: https://feedbackassistant.apple.com/feedback/7486859

Content of the bug report: https://github.com/addisonwebb/FB7486859/blob/master/README.md

Open Radar: https://openradar.appspot.com/radar?id=4954820121198592


If you think this is something that should be fixed, please take a few minutes to dupe FB7486859.

If you spot a problem in my sample code, or know of a way to reenable multiple folder selection in iOS 13’s UIDocumentPickerViewController please let me know!

Sample Project: https://github.com/addisonwebb/FB7486859

This past week John Sundell wrote a blog post (Unit testing asynchronous Swift code) about unit testing asynchronous code.

As I was trying to apply some fo the techniques when I came across a method I couldn’t mock because I was getting an error.

Objective-C method addNotificationRequest:withCompletionHandler: provided by method add(_:withCompletionHandler:) does not match the requirement’s selector (add:withCompletionHandler:)

Consider the following method for UNUserNotificationCenter in Swift.

func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Swift.Void)? = nil)

If you would want to create a Swift protocol to mimic the interface to UNUserNotificationCenter that would be pretty simple.

protocol UserNotificationCenter {
	func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Swift.Void)?)

The problem is that the method signature in Swift is different from the method signature in Objective-C. Here is the method definition in Objective-C.

- (void)addNotificationRequest:(UNNotificationRequest *)request withCompletionHandler:(nullable void(^)(NSError *__nullable error))completionHandler;

Since the Objective-C method has a different method signature than the Swift version, we have to specify the Objective-C method signature in our protocol.

func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Swift.Void)?)

Now we can implement that method in our mock object!

I love podcasts. Podcasts are a great medium that I use for entertainment and learning. I have had many people interested in the podcasts I listen to so I figured I’d put a list of them in one place.

Today I needed an HDMI to DVI cable to connect a computer to a monitor. I wanted it right away so I started looking online for the cable at local computer stores. I planned to find the best deal and then drive to pick it up in the store. That was my plan until I found out that the more affordable cables were not available for store pickup. My only options were $15 - $30 cables and adapters.

I quickly checked Amazon to see if the prices were comparable. Not even close. The Amazon cable, exactly what I wanted, was only $6. Then I remembered that I live in a Prime Now location. (Prime Now is a part of Amazon Prime. When you order through Prime Now, they will deliver your order in 2 hours.) Sure enough, the cable was available via Prime Now. I even had to add another $14 to my cart since the minimum for delivery is $20. So in all I got the cable I wanted and some other goodies for under the price it would have cost me to get just the cable at Best Buy. Even better, I didn’t have to leave the house!

I can’t believe that the best deal for the cable I wanted at Best Buy was $30 + tax. Best Buy and other tech stores are doing it to themselves. If they can’t compete with the prices and convenience of Amazon then good riddance.

It’s a good thing these “experts” don’t work for Apple. That car is hideous.

Link: http://www.motortrend.com/news/apple-car-exclusive/

This past Wednesday I gave a talk about CloudKit at Nashville CocoaHeads. It was nice to get to meet everyone there and I am excited to be a part of the meetup! The slides for the presentation can be found here: CloudKit Overview Keynote.

Update 3/2/16

Video is now up on YouTube: CloudKit Overview Video

subscribe via RSS