GithubHelp home page GithubHelp logo

xcodesnippets's Introduction

XcodeSnippets

Maintained by @bryanluby

A repository of useful Swift and Objective-C Xcode snippets.

Installation

  • Clone this repo.
  • Run the install script at the top-level of this repo: ./install.sh
  • This will copy all of the snippets into the user-level Xcode snippets directory.
  • Restart Xcode if it is currently open to use the snippets.

Adding Snippets

If you have any other Snippets that you would like to share make a Pull Request!

Steps For Adding Snippets To This Repo

  • Follow the directions here for adding a snippet to Xcode.
  • Then navigate to ~/Library/Developer/Xcode/UserData/CodeSnippets/ and find the .codesnippet file that was just created (sorting by Date Modified or Date Created helps).
  • Drag that snippet file into the top-level of this repo folder and rename the file with either the swift_ or objc_ naming scheme similar to the other snippets.

List of Snippets

Swift

  • swift_mark: MARK: - convenience snippet
  • swift_private_set_var: private(set) var ... convenience snippet
  • swift_static_date_formatter: Static date formatter snippet
  • swift_tableview_data_source: Bare bones required UITableViewDataSource methods
  • swift_collectionview_data_source: Bare bones required UICollectionViewDataSource methods
  • swift_swiftlint_disable_enable: Disable/enable a SwiftLint rule for a block of code.
  • swift_swiftlint_disable_this: Disable a SwiftLint rule for the current line of code.
  • swift_swiftlint_disable_next: Disable a SwiftLint rule for the next line of code.
  • swift_swiftlint_disable_previous: Disable a SwiftLint rule for the previous line of code.
  • swift_source_code_tag: Add a tag to link to source code via the x-source-tag URL scheme.
  • swift_source_code_link: Create a link to source code via the x-source-tag URL scheme.

Objective-C

  • objc_pragma_mark: #pragma mark - ... snippet
  • objc_weakself: weakSelf snippet
  • objc_strongSelf: strongSelf snippet
  • objc_static_object_creation: static TYPE *const ... snippet
  • objc_global_variable_interface: FOUNDATION_EXPORT TYPE *const ... snippet for .h files
  • objc_global_variable_implementation: TYPE *const ... snippet for .m files
  • objc_struct_types_interface: Struct type for grouping constants for .h files
  • objc_struct_types_implementation: Struct type for grouping constants for .m files

xcodesnippets's People

Contributors

bryanluby avatar eckrag89 avatar ilg avatar vokal-isaac avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.