-
Notifications
You must be signed in to change notification settings - Fork 1
/
CreditsKitDetail.m
42 lines (32 loc) · 1.19 KB
/
CreditsKitDetail.m
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
#import "CreditsKitDetail.h"
@interface CreditsKitDetail ()
@property NSString* headerContent;
@property NSString* descriptionContent;
@property (weak, nonatomic) IBOutlet UILabel *titleText;
@property (weak, nonatomic) IBOutlet UITextView *descriptionText;
@end
@implementation CreditsKitDetail
-(id) initWithContentTitle:(NSString *)title description:(NSString *)description {
self = [super init];
if (self) {
self.headerContent = title;
self.descriptionContent = description;
self.closeButtonText = @"Close";
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:self.closeButtonText style: UIBarButtonItemStyleBordered target:self action:@selector(doneButtonPressed:)];
self.navigationItem.rightBarButtonItem = backButton;
self.title = self.headerContent;
self.titleText.text = self.headerContent;
self.descriptionText.text = self.descriptionContent;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void) doneButtonPressed:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}
@end