Find your SQLite Database for Xcode 10

To get the SQLite database for your app on all simulators on which it’s installed:

find ~/Library/Developer/CoreSimulator/Devices -name MyAppName.sqlite

(Xcode 10)

Open Finder and do Shift + Cmd + G  to bring up the “Go to folder” dialog. Paste in the file path and you should see it. It will be garbled if you try to open it with a plain text editor. DB Browser for SQLite seems to work for me.

Rounded Corner Button in Swift

It’s very simple to create buttons with rounded corners. Create a button like you normally would in Interface Builder, create an Outlet to it, and then in viewDidLoad, set the attributes like this:

button.layer.borderWidth = 3.0
button.layer.borderColor = UIColor.white.cgColor // Set this to the background color of your button
button.layer.cornerRadius = 8.0

Custom key bindings in Xcode 8

I hate that Xcode doesn’t include a duplicate line shortcut. I have to keep adding it in every time a new version of Xcode comes out and every time, I have to Google it, so I’m pasting the SO post here that worked most recently. There must be a better way, but until I figure that out, here’s what has worked for me.

Open

/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist

And add:

<key>Custom Commands</key>
<dict>
    <key>Cut Current Line</key>
    <string>selectLine:, cut:</string>
    <key>Copy Current Line</key>
    <string>selectLine:, copy:</string>
    <key>Duplicate Current Line</key>
    <string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
</dict>

Then restart Xcode and go to Preferences -> Key Bindings and assign your shortcuts.

This was taken from: https://stackoverflow.com/a/41579618