-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewController.m
49 lines (36 loc) · 1.2 KB
/
ViewController.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
43
44
45
46
47
48
49
//
// ViewController.m
// Palette
//
// Created by 孙玉娟 on 16/7/11.
// Copyright © 2016年 孙玉娟. All rights reserved.
//
#import "ViewController.h"
#import "InfColorPickerController.h"
@interface ViewController () <InfColorPickerControllerDelegate>
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self changeBackgroundColor];
}
- (IBAction) changeBackgroundColor
{
InfColorPickerController* picker = [[ InfColorPickerController alloc ]init];
//picker.sourceColor = self.view.backgroundColor;
picker.delegate = self;
// [ picker presentModallyOverViewController: self ];
[self.navigationController pushViewController:picker animated:YES];
}
//------------------------------------------------------------------------------
- (void) colorPickerControllerDidFinish: (InfColorPickerController*) picker
{
self.view.backgroundColor = picker.resultColor;
[ self.navigationController popViewControllerAnimated:YES ];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end