-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFFFormField.m
More file actions
54 lines (43 loc) · 1.44 KB
/
FFFormField.m
File metadata and controls
54 lines (43 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// FFFormAttribute.m
// prophets-ios
//
// Created by Benjamin Roesch on 10/17/12.
// Copyright (c) 2012 Benjamin Roesch. All rights reserved.
//
#import "FFFormField.h"
#import "NSString+Additions.h"
@implementation FFFormField
+(id)formFieldWithAttributeName:(NSString *)attributeName labelName:(NSString *)labelName{
return [[self alloc] initWithAttributeName:attributeName labelName:labelName];
}
+(id)formFieldWithAttributeName:(NSString *)attributeName{
return [self formFieldWithAttributeName:attributeName labelName:[attributeName humanized]];
}
-(id)initWithAttributeName:(NSString *)attributeName labelName:(NSString *)labelName{
self = [super init];
if(self){
self.attributeName = attributeName;
self.labelName = labelName;
}
return self;
}
-(NSString *)cellReuseIdentifier{
if (self.customCellReuseIdentifier) {
return self.customCellReuseIdentifier;
}
return [NSString stringWithFormat:@"%@Cell", NSStringFromClass([self class])];
}
-(CGFloat)height{
return 44;
}
-(BOOL)canBecomeFirstResponder{
return NO;
/*
@throw [NSException exceptionWithName:NSInternalInconsistencyException
reason:[NSString stringWithFormat:@"Invalid method call"
"canBecomeFirstResponder must be implemented by subclasses of FFFormField"]
userInfo:nil];
*/
}
@end