• Stars
    star
    232
  • Rank 172,196 (Top 4 %)
  • Language
    Objective-C
  • Created over 10 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Xcode plugin which help you write code faster.

MLAutoReplace

Xcode plugin, Re-Intent, make you write code more quickly.
Use a portion code of VVDocumenter-Xcode.

##Overview You can use shortcut key Shift+Command+\ to auto re-indent all source of the current edit file.

You can custom other replacer with regex.
regex replace
regex replace
pseudo-generic

You can input common getter quickly.
replace getter

##How to install? Download this project and run.

##Regex replacer

Exmple:
replace getter
This item means that plugin will replace @s/ to @property (nonatomic, strong) <#custom#>.

The plugin will detect the content of current input line.

Some placeholders can be replace with context.

  • <datetime>: current datetime, you can use it to mark your edit time.
  • <declare_class_below>: the class name of the first @interface XXX : below.
  • <{0}>,<{1}>...: these placeholders will be replaced with its corresponding position of regex result.

A demo for pseudo-generic(ibireme/YYModel#79):

pseudo-generic

It uses two styles of placeholders:

<declare_class_below>:

regex: ^\s*@[Pp]{2}$
replaceContent: @protocol <declare_class_below>;

<{0}>,<{1}>(location placeholders):

regex: ^\s*@property\s*\(\s*nonatomic\s*(,\s*strong\s*|)\)\s*(NSArray|NSMutableArray|NSSet|NSMutableSet)\s*<\s*(\w+)\s*>$
replaceContent: @property (nonatomic<{0}>) <{1}><<{2}> *><<{2}>> *<#name#>

regex: ^\s*@property\s*\(\s*nonatomic\s*(,\s*strong\s*|)\)\s*(NSDictionary|NSMutableDictionary)\s*<\s*(\w+)\s*>$
replaceContent: @property (nonatomic<{0}>) <{1}><NSString *,<{2}> *><<{2}>> *<#name#>

##Re-Indent

Just can be quickly re-intent.

If you find that press Shift+Command+\ does nothing.
Please ensure that the shortcut key setting of Re-Intent is default. re-intent shortcut key setting

##Getter replacer

In fact, this feature can be implemented with location placeholders. But I am not willing to delete the old feature.

You need add your own common syntax to the getter replacer.
replace getter

<name> means the property name.
<#xxx#> means where need to input in,it is recommended to provide.

Exmple:

- (UIImageView *)<name>
{
    if (!_<name>) {
		UIImageView *imageView = [[UIImageView alloc]init];
        imageView.image = [UIImage imageNamed:@"<#imageName#>"];
        imageView.contentMode = UIViewContentModeScaleAspectFill;
        <#custom#>

        _<name> = imageView;
    }
    return _<name>;
}

You must reload .plist file with shortcut control+option+command+\ after editing and saving it.
You can also reload it with the Reload .plist Data button in MLAutoReplace window.

How to use:

- (UIImageView *)xxx///

Dont forget /// please. :)

More Repositories

1

MLEmojiLabel

Automatic URL recognition and custom expression like wechat
Objective-C
803
star
2

MLLabel

UILabel replacement with TextKit. Support link and expression.
Objective-C
724
star
3

MLTransition

iOS7+, pop ViewController with pan gesture from middle or edge of screen.
Objective-C
452
star
4

MLLayout

Flexbox in Objective-C, using Facebook's css-layout.
Objective-C
251
star
5

MLInputDodger

The best view dodger for inputting.
Objective-C
203
star
6

MLAudioRecorder

练手之作,实现不怎么样,可能存在问题,也不继续维护,所以注意仅供参考学习。
Objective-C
181
star
7

MLNavigationBarTransition

Advanced navigation bar transition based on official push-pop transition
Objective-C
78
star
8

MLPresentController

Present ViewController with custom animator. support interactiving with UIPanGestureRecognizer
Objective-C
55
star
9

MLMultiSelectViewController

multi select contact like wechat group
Objective-C
43
star
10

MLImageCrop

image crop ,custom ratio , can rotate - 图片截取,可以自定义截取比例,支持旋转
Objective-C
31
star
11

MLIgnoreTransparentButton

a button can ignore touch of transparent area and a uiview category can auto set mask with image.
Objective-C
9
star
12

MLAudio

MLAudio - 暂时请勿关注,方便自己使用的玩意。
Objective-C
7
star
13

Arm64InspectiveC

Based on InspectiveC. Print on console. No theos/tweak/cycript depend.
Objective-C++
4
star
14

MLActivityView

ActivityView Like WeChat - 类似微信的ActivityViewController
Objective-C
4
star
15

jsoniterpb

Replacement of Protojson over Jsoniter Extension
Go
3
star
16

MLKit

自用,暂请勿关注
Objective-C
3
star
17

gopit

golang大坑集锦
Go
3
star
18

MLActionSheet

ActionSheet - 类似Instagram的
Objective-C
2
star
19

MLDataSyncPool

simple data sync pool
Objective-C
2
star
20

MLRefreshControl

Refresh control for UIScrollView
Objective-C
2
star
21

zlib

zlib cgo wrapper
Go
1
star
22

MLAlipaySDK

方便使用罢了 请勿关注~~~!!!!!
Objective-C
1
star
23

MLSmoothCorner

smooth using for corner of UIView
Objective-C
1
star
24

MLHttpDNS

Objective-C
1
star