Helpful Swift 5 code snippets to use in all your Xcode projects.
- Open Finder and type
cmd + shift + G
- Paste ~/Library/Developer/Xcode/UserData/CodeSnippets/ and press "Go" button
- The folder* will open, paste all the .codesnippet files
- Restart Xcode
- Type
snippet
and access the code snippets you just added
*If the folder doesn't exists create it.
snippetViewDidLoad viewDidLoad for UIViewController
snippetViewDidAppear viewDidAppear for UIViewController
snippetViewDidDissappear viewDidDissapear for UIViewController
snippetViewWillAppear viewWillAppear for UIViewController
snippetViewWillDissappear viewWillDissappear for UIViewController
snippetAddObserver Add observer
snippetPostObserver Post observer
snippetAlert Present alert or action sheet with two default actions
snippetMark Simple MARK with a placeholder to complete
snippetMarksUIViewController MARKs for UIViewController
snippetMarksModel MARKs for models
snippetSingleton Generic singleton class
More information about Code Snippets on this link.