-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPSRDetailViewController.m
More file actions
73 lines (49 loc) · 2.14 KB
/
PSRDetailViewController.m
File metadata and controls
73 lines (49 loc) · 2.14 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
// PSRDetailViewController.m
// SimpleNotes
//
// Created by Daniil Korotin on 24.04.14.
// Copyright (c) 2014 Daniil Korotin. All rights reserved.
//
#import "PSRDetailViewController.h"
@interface PSRDetailViewController ()
@end
@implementation PSRDetailViewController
//@synthesize colorViewController;
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.textView = [[UITextView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:self.textView];
if (self.note) {
self.textView.text = self.note.text;
}
self.navigationItem.title = self.note.text;
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)];
UIBarButtonItem *colorChangeButton = [[UIBarButtonItem alloc]init];
colorChangeButton.action = @selector(changeColor);
colorChangeButton.title = @"Color";
colorChangeButton.target = self;
UIBarButtonItem *fontChangeButton = [[UIBarButtonItem alloc]init];
fontChangeButton.action = @selector(doTheThing);
fontChangeButton.title = @"Font";
fontChangeButton.target = self;
// self.navigationItem.rightBarButtonItem = buttons;
self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:cancelButton, colorChangeButton, fontChangeButton, nil];
}
- (void)cancel {
}
- (void) doTheThing {
NSLog(@"Doing the thing");
}
- (IBAction)changeColor {
PSRColoreSelectSliderViewController *colorChangerView = [[PSRColoreSelectSliderViewController alloc]initWithNibName:@"colorChangerView" bundle:nil];
[self.navigationController pushViewController:colorChangerView animated:YES];
// colorChangerView = [self.storyboard instantiateViewControllerWithIdentifier:@"colorChangerView"];
// [self.navigationController presentViewController:colorChangerView animated:YES completion:nil];
// [self presentViewController:colorChangerView animated:YES completion:nil];
}
- (void)viewWillDisappear:(BOOL)animated {
self.note.text = self.textView.text;
}
@end