Skip to content

Commit bf36edd

Browse files
committed
fix author information property method (+1 squashed commit)
Squashed commits: [3470b91] refine the author information format (+1 squashed commit) Squashed commits: [da46975] temp
1 parent da46975 commit bf36edd

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

VVDocumenter-Xcode/Commenter/VVBaseCommenter.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ -(NSString *) startComment
4848
NSString *authorInfo = @"";
4949

5050
if ([[VVDocumenterSetting defaultSetting] useAuthorInformation] && !self.forSwift) {
51-
authorInfo = [NSString stringWithFormat:@"%@@Author",
52-
self.prefixString];
5351
NSMutableString *authorCotent = @"".mutableCopy;
5452

5553
if ([[VVDocumenterSetting defaultSetting] authorInformation].length > 0) {
@@ -69,13 +67,14 @@ -(NSString *) startComment
6967
}
7068
[authorCotent appendString:[formatter stringFromDate:[NSDate date]]];
7169
}
72-
authorInfo = [NSString stringWithFormat:@"%@\n", authorInfo];
70+
71+
authorInfo = [NSString stringWithFormat:@"%@@Author %@\n%@\n", self.prefixString, authorCotent, self.prefixString];
7372
}
7473

7574
if ([[VVDocumenterSetting defaultSetting] useHeaderDoc]) {
76-
return [NSString stringWithFormat:@"%@/*!\n%@%@<#Description#>\n", self.indent, self.prefixString, descriptionTag];
75+
return [NSString stringWithFormat:@"%@/*!\n%@%@%@<#Description#>\n", self.indent, authorInfo, self.prefixString, descriptionTag];
7776
} else if ([[VVDocumenterSetting defaultSetting] prefixWithSlashes]) {
78-
return [NSString stringWithFormat:@"%@%@<#Description#>\n", self.prefixString, descriptionTag];
77+
return [NSString stringWithFormat:@"%@%@%@<#Description#>\n", self.prefixString, authorInfo, descriptionTag];
7978
} else {
8079
return [NSString stringWithFormat:@"%@/**\n%@%@%@<#Description#>\n", self.indent, authorInfo, self.prefixString, descriptionTag];
8180
}

VVDocumenter-Xcode/Setting/VVDocumenterSetting.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ -(void) setAlignArgumentComments:(BOOL)alignArgumentComments
181181

182182
-(BOOL)useAuthorInformation
183183
{
184-
return ![[NSUserDefaults standardUserDefaults] boolForKey:kVVDUseAuthorInformation];
184+
return [[NSUserDefaults standardUserDefaults] boolForKey:kVVDUseAuthorInformation];
185185
}
186186
-(void) setUseAuthorInformation:(BOOL)useAuthorInformation
187187
{
188-
[[NSUserDefaults standardUserDefaults] setBool:!useAuthorInformation forKey:kVVDUseAuthorInformation];
188+
[[NSUserDefaults standardUserDefaults] setBool:useAuthorInformation forKey:kVVDUseAuthorInformation];
189189
[[NSUserDefaults standardUserDefaults] synchronize];
190190
}
191191

@@ -203,11 +203,11 @@ -(void)setAuthorInformation:(NSString *)authorInformation {
203203

204204
-(BOOL)useDateInformation
205205
{
206-
return ![[NSUserDefaults standardUserDefaults] boolForKey:kVVDUseDateInformation];
206+
return [[NSUserDefaults standardUserDefaults] boolForKey:kVVDUseDateInformation];
207207
}
208208
-(void) setUseDateInformation:(BOOL)useDateInformation
209209
{
210-
[[NSUserDefaults standardUserDefaults] setBool:!useDateInformation forKey:kVVDUseDateInformation];
210+
[[NSUserDefaults standardUserDefaults] setBool:useDateInformation forKey:kVVDUseDateInformation];
211211
[[NSUserDefaults standardUserDefaults] synchronize];
212212
}
213213

0 commit comments

Comments
 (0)