/CodeSnippets

An Xcode Objective-C code snippet repository.

Snippets

An Xcode Objective-C / Swift 4 code snippet repository.

Installation

Installation via these commands will overwrite any existing code snippets!

  1. cd ~/Library/Developer/Xcode/UserData/
  2. git clone https://github.com/jfuellert/CodeSnippets.git
  3. Restart Xcode

Swift Snippet shortcuts

Constants

  • Constant constant

Properties

  • Delegate delegate
  • Declare local immutable property var
  • Declare lazy load local property varlazy

Environment

  • Mac Catalyst target wrapper mactarget

Functions

  • Create constraints createconstraints
  • Prepare for reuse prepareforreuse
  • Layout subviews layoutsubviews
  • Dealloc deal

Misc

  • Pragma mark prag
  • Comment /
  • Dispatch after dispatchafter

Objective-C Snippet shortcuts

Constants

  • External CGFloat externfloat
  • External NSUInteger externinteger
  • External NSString externstring
  • Internal CGFloat constfloat
  • Internal NSUInteger constinteger
  • Internal NSString conststring

Properties

  • Delegate delegate
  • Assign assign
  • Strong strong
  • Copy copy
  • Weak weak
  • Assign readonly assignreadonly
  • Strong readonly strongreadonly
  • Copy readonly copyreadonly
  • Weak readonly weakreadonly

Life cycle

  • Init init
  • Dealloc deal
  • View did load viewdidload
  • Layout subviews layoutsubviews
  • Update constraints updateconstraints
  • Lazy load local property var
  • Prepare for reuse prepareforreuse

Animations

  • Keyframe animation keyframe

CGRect

  • Get width getwidth
  • Get height getheight
  • Get min X getminx
  • Get min Y getminy
  • Get max X getmaxx
  • Get max Y getmaxy

Misc

  • Pragma mark prag
  • Comment /