Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@miotke
Last active August 14, 2020 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miotke/0206ab2471a4e34182b5f38f245987bc to your computer and use it in GitHub Desktop.
Save miotke/0206ab2471a4e34182b5f38f245987bc to your computer and use it in GitHub Desktop.

This gist is just a list of small helper code and CLI commands to help during development.

CoreData location in simulator

Prints the location of the Core Data database in the console to inspect if data is actually saving. You can put this anywhere you would like. I typeically put it in the AppDelegate.swift file to be called when the app first launches.

print("🚒 Documents Directory: ", FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last ?? "Not Found!")

Show build timex in Xcode.

Shows the build time in the "status bar" of Xcode. Only works for building(cmd + b), does not show for build & run(cmd + r)

defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES

Not related to Swift development

Remove all local git branches except [insert main branch name here]:

git branch | grep -v "master" | xargs git branch -D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment