Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

kudinovdenis/Xcode-headers-sorting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tool for sorting Xcode import headers alphabetically

This tool will work with any Xcode including Xcode 8: this is not a plugin for Alcatraz which is not fully available in Xcode 8.

How to install

$ git clone https://github.com/kudinovdenis/Xcode-headers-sorting.git
$ cd Xcode-headers-sorting
$ ./install.sh

How to use

  1. Select headers
  2. Right-click on the text in Xcode editor
  3. Choose "Sort Alphabetically"

Or

Just ctrl+shift+S

Example

Before Sorting:

// headers group 1
#import "A_header.h"
#import "C_header.h"
#import "B_header.h"
// headers group 2
#import "A2_header.h"
#import "C2_header.h"
#import "B2_header.h"

#import "A3_header.h"
#import "C3_header.h"
#import "B3_header.h"

ctrl+shift+S

// headers group 1
#import "A_header.h"
#import "B_header.h"
#import "C_header.h"
// headers group 2
#import "A2_header.h"
#import "B2_header.h"
#import "C2_header.h"

#import "A3_header.h"
#import "B3_header.h"
#import "C3_header.h"

Additional info

Delimiter symbols to group headers (see Example):

  • \n (new line)
  • // (comments)

Known issues

Shortcut is not active on the first file right after Xcode is launched.

About

Xcode shortcut to sort #imports

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published