GithubHelp home page GithubHelp logo

awesomeswiftsnippets's Introduction

AwesomeSwiftSnippets

Collection of awesome Swift Snippets compiled with Swift 4

What is need

Code completion and Fix‐It can both help you speed up your development of Swift code. Code snippets in the library go even further: They are snippets of code you can just drag into your own code. You can use a snippet as‐is, but many have tokens — highlighted areas that you can customize with your own variable names or other customizations.

When you drag snippets with tokens into your code, they almost always generate errors because you haven’t replaced the tokens yet. This is normal. In addition to the built‐in library, you can create your own snippets according to your project needs and distribute along team members.

Import

Xcode's all built-in code snippets exist at path in ~/Library/Developer/Xcode/UserData/CodeSnippets/ So you can just download this codesnippet folder and copy all it's files to same path and you done !

Don't forget to restart Xcode after copying this file, so changes can be get reflected.

Note:If you don't found the folder, create it. It is get created by Xcode when user adds his first custom snippet.

Usage

I named all snippets using scheme snippet... . So when you start typing word snippet in Xcode editor all relevant snippet code will appear to choose from.

Snippet Use

Or you can click on Snippet Library button to get all list of snippets in Xcode. Note: In Xcode 10 Snippet Library button position changed to top toolbar as shown in below graphics. In Xcode 9 it was at bottom-right position at Utilities Panel.

Snippet Use

Create own custom snippet

In Xcode 10 you can go to Editor->Create Code Snippet. And you will get window for creating custom snippet. For older Xcode versions, you can write custom snippet in editor area and drag it to Utilites panel's snippet library area.

Snippet Use

If you want to add placeholder in snippet simply put it between <# and #> and it will be transformed in both editor and final snippet.

Note

This code is written in swift 4.1 language with XCode 10.

awesomeswiftsnippets's People

Contributors

sagarmore62 avatar

Watchers

James Cloos avatar 迈腾大队长 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.