Giter VIP home page Giter VIP logo

imp's Introduction

Imp 😈

Imp is a tiny yet useful Xcode extension, which allows you to sort import declarations and remove duplicates. Sorting import statements is a good quality coding practice and Imp is here to help you.

Tame the Imp by binding a key in Xcode preferences

Supported languages

Objective-C, Swift

Features

  • Basic import sorting
  • The class header on top, separated by new line
  • Split frameworks and headers imports
  • Remove duplicates
  • Cut empty lines among imports
  • Sorting selected lines
  • More flexible settings

If you have an idea for a new feature, please file an issue and tell me more.

Installation

Demo way

Clone and Run the project with Xcode 8+ (make sure the App and the Extension are signed with your developer account)

Right way

  1. Open Imp.xcodeproj
  2. Sign both the Application and the Extension using your own developer account
  3. Product > Archive
  4. Right click archive > Show in Finder
  5. Right click archive > Show Package Contents
  6. Open Products, Applications
  7. Drag Imp.app to your Applications folder
  8. Run Imp.app and close it (the app need to be run at least once)
  9. Go to System Preferences -> Extensions and check if Imp Tools is enabled in Xcode Source Editor section (or Imp in All section)
  10. Imp Tools should now be available from Xcode's Editor menu
  11. Bind a key for Sort imports command
  12. Find a Large Class with many messy imports
  13. Hit the key and enjoy the magic!

Settings

Just run Imp from your Applications folder. No need in restarting Xcode to apply the changes!

How to uninstall

  1. Disable the extension in System Preferences
  2. Delete the App from Applications folder
  3. Feel sorry

Known limitations (objC)

Imp doesn’t like messy code and may think that the first @implementation (or @interface, in case no implementation found) he founds is the class you are working with. Xcode doesn’t provide any information on the current file, so little fella has to guess it. It will affect the header which will (or will not) be popped to top with “own header on top” setting.

Thank you

For any questions or feedbacks, feel free to contact me directly via Telegram: @alexxxander

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.