Xcode 10 Library TipsSep 24, 2018 · 2 minute read
Have you been wondering what happened to the media library since you migrated to Xcode 10? Is the object browser annoying you by disappearing every time you use it? Here are some quick Xcode 10 library tips to restore your calm.
Where’s My Library?
One obvious change in Xcode 10 is the new location for the library. In Xcode 9 the library was tucked down in the bottom of the inspectors. It had four tabs to switch between the file template, snippet, object, and media browsers:
In Xcode 10, the library has moved to a button up on the Xcode toolbar. It is “smarter” but, I think, less discoverable. Some quick tips to get you back up to speed with the new Xcode 10 library:
The toolbar button is context sensitive. When using Interface Builder, you get a button that opens the object browser:
In the source editor you get a button that opens the snippet editor:
When you drag an item from the library it automatically closes the popup window. This can be more than a little annoying. To keep the library open hold down the Option (⌥) key when you click the toolbar button. The library opens in a window which stays open until you close it:
If you forget to hold the Option (⌥) key when opening the library. You can hold the Option (⌥) key when you drag an item from the library. The library popup becomes a window and stays open.
Wondering where the media library is? Use a long-press on the toolbar library button, and you get a menu that allows you to access the media library:
Use the keyboard shortcut shift-command-L (⇧⌘L) to open the library. This opens the snippet browser in the source editor or the object browser in Interface Builder. Use shift-command-M (⇧⌘M) to open the media library.
The file template library browser does not seem to have made it to Xcode 10?
I don’t think I ever used it so I’ll not miss it. Use New File (⌘N) to see the file templates instead.
For some more Interface Builder tips see my earlier post:
If you are struggling to build layouts that work across the growing range of iOS devices, take a look at my new book on Auto Layout which is coming real soon. To find out when it’s published and get a launch discount be sure to sign up (I’ll only e-mail you about the book launch).