Skip to content

Commit 5b2126c

Browse files
author
Matt Cai
committed
为makeTemplate添加allText和allImage功能
1 parent 132aca6 commit 5b2126c

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

NudeIn/NUDTextMaker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ extern NSString * const kNUDAttachmentAllImageKey;
7171
@interface NUDTemplateMaker : NSObject
7272
- (NUDTextTemplate * (^)(NSString *))textTemplate;
7373
- (NUDAttachmentTemplate * (^)(NSString *))imageTemplate;
74+
- (NUDTextTemplate * (^)(void))allText;
75+
- (NUDAttachmentTemplate * (^)(void))allImage;
7476
@end
7577

7678
@interface NUDTemplateMaker (ToolsExtension)

NudeIn/NUDTextMaker.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,19 @@ - (instancetype)init {
129129
return self.textMaker.imageTemplate(tplName);
130130
};
131131
}
132+
133+
- (NUDTextTemplate *(^)(void))allText {
134+
return ^NUDTextTemplate *(void) {
135+
return self.textMaker.textTemplate(kNUDTextAllText);
136+
};
137+
}
138+
139+
- (NUDAttachmentTemplate *(^)(void))allImage {
140+
return ^NUDAttachmentTemplate *(void) {
141+
return self.textMaker.imageTemplate(kNUDAttachmentAllImageKey);
142+
};
143+
}
144+
132145
@end
133146

134147
@implementation NUDTextMaker (ToolsExtension)

textExample/textExample/ViewController.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ - (void)loadView {
3333
self.view = [UIScrollView new];
3434
self.view.backgroundColor = [UIColor whiteColor];
3535
((UIScrollView *)self.view).contentSize = CGSizeMake([UIScreen mainScreen].bounds.size.width, 1000);
36+
[NudeIn makeTemplate:^(NUDTemplateMaker *make) {
37+
make.allText().color([UIColor orangeColor]).shadowDirection(NUDLeft,10).attach();
38+
}];
3639
}
3740

3841
- (void)viewDidLoad {

0 commit comments

Comments
 (0)