Sorting

 

Like most code generation events in Accessorizer, Sorting can be done from the Action Menu or Action Panel in addition to the main interface panel.

Sorting works on ivar declarations, @property statements, @synthesize statements, and on the dealloc and viewDidUnload methods. You select any of the above types of code and send it in for sorting and Accessorizer will sort based on ivar NAME, or, on TYPE and then by NAME, based on your settings in the main Accessorizer Panel -> SORT TAB.

Example: let’s say you have the following property statements and you want to sort them by type, then by name.  Select the properties, then send them to Accessorizer via the Accessorizer Action Panel Service.   You can either use the main interface (as shown above), or bring up the Action Menu or Action Panel and use a keyboard shortcut to invoke the SORT (the type of sort is based on your settings in the main panel).

Here are results for sort by NAME, on the above example of property statements passed in...

@property (nonatomic, assign, getter=isFlat) BOOL flat;

@property (nonatomic, retain) KCNoteFind *noteFind;

@property (nonatomic, retain) IBOutlet UIView *screenContainer;

@property (nonatomic, retain) KCNotePosition *notePosition;

@property (nonatomic, retain) KCNoteNeighbor *noteNeighbor;

@property (nonatomic, copy)  NSString *name;

@property (nonatomic, retain) KCNoteFamily *noteFamily;

@property (nonatomic, assign) CGPoint point;

@property (nonatomic, retain) IBOutlet UILabel *warningLabel;

@property (nonatomic, copy) NSString *title;

@property (nonatomic, copy) Animal *animal;


NSLog()NSLog.htmlFormatting.htmlshapeimage_2_link_0

Here are results for sort by TYPE, then byNAME, on the same original example...

@property (nonatomic, copy) Animal *animal;

@property (nonatomic, assign, getter=isFlat) BOOL flat;

@property (nonatomic, copy)  NSString *name;

@property (nonatomic, retain) KCNoteFamily *noteFamily;

@property (nonatomic, retain) KCNoteFind *noteFind;

@property (nonatomic, retain) KCNoteNeighbor *noteNeighbor;

@property (nonatomic, retain) KCNotePosition *notePosition;

@property (nonatomic, assign) CGPoint point;

@property (nonatomic, retain) IBOutlet UIView *screenContainer;

@property (nonatomic, copy) NSString *title;

@property (nonatomic, retain) IBOutlet UILabel *warningLabel;


@property (nonatomic, copy) Animal *animal;

@property (nonatomic, assign, getter=isFlat) BOOL flat;

@property (nonatomic, assign) CGPoint point;

@property (nonatomic, retain) KCNoteFamily *noteFamily;

@property (nonatomic, retain) KCNoteFind *noteFind;

@property (nonatomic, retain) KCNoteNeighbor *noteNeighbor;

@property (nonatomic, retain) KCNotePosition *notePosition;

@property (nonatomic, copy)  NSString *name;

@property (nonatomic, copy) NSString *title;

@property (nonatomic, retain) IBOutlet UILabel *warningLabel;

@property (nonatomic, retain) IBOutlet UIView *screenContainer;

Original property statements: