To get the SQLite database for your app on all simulators on which it’s installed:
find ~/Library/Developer/CoreSimulator/Devices -name MyAppName.sqlite
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.
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
TIL if you you just do a Google search for “hex color picker” the top result is a little widget with sliders that let you pick a color and the hex and RGB values appear on the side. So easy!
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.
<key>Cut Current Line</key>
<key>Copy Current Line</key>
<key>Duplicate Current Line</key>
<string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
Then restart Xcode and go to Preferences -> Key Bindings and assign your shortcuts.
This was taken from: https://stackoverflow.com/a/41579618
Start a container when using Docker Compose
docker-compose up -d
Continue reading “Docker Cheatsheet”
Reference to StackOverflow answer so I don’t have to keep searching for it:
I kept wondering whether you’re supposed to call the parent init method before or after your code and I found a basic answer:
// Put values into your instance variables and constants
// Other initialization code, such as calling methods, goes here
I don’t think you’re really supposed to do this since the option is grayed out in Xcode when you select Editor -> Embed in Navigation Controller, but a hacky way to get around it is to control-drag from a free-standing Navigation Controller to the Tab Bar Controller and select “root view controller.”
Control-click from the Tab Bar Controller to the controller you want to be the new tab and select “view controllers.”
One reason the Archive button may be grayed out in Xcode is that you need to be connected to a device, and choose that device.
See here: http://stackoverflow.com/questions/16050640/xcode-product-archive-disabled/18791703#18791703