Giter Club home page Giter Club logo

declaretype's Introduction

DeclareType

An Xcode Source Editor Extension that generates a type declaration based on the file name

Declare type example

Why?

Because typing the class name or choosing a Cocoa Touch Class template and selecting the superclass can be tedious.

Installation

  1. Open DeclareType.xcodeproj
  2. Enable target signing for both the Application and the Source Code Extension using your own developer ID
  3. Select the application target and then Product > Archive
  4. Export the archive as a macOS App
  5. Run the app, then quit (Don't delete the app, put it in a convenient folder)
  6. Go to System Preferences -> Extensions -> Xcode Source Editor and make sure the extension is enabled
  7. The menu-item should now be available from Xcode's Editor menu

Features

  • Detects probable superclass (or that a protocol is created) based on the file name ending
  • Imports UIKit it wasn't imported and a UIKit class is being created
  • Detects: UIView, UIViewController, UIButton, UITableView, UITableViewCell, UICollectionView, UICollectionViewCell
  • Creates a protocol if the file name ends with "able" or "Protocol"
  • Will create a class with no parent if no candidate was found

Shortcut

Preferences (โŒ˜ + ,) -> Key Bindings -> Search for "Declare" Shortcut

Limitations

Detects superclasses only for UIKit classes. Works only with Swift.

declaretype's People

Contributors

timaktimak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

benron

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.