forked from Tangdixi/DCPathButton
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.m
More file actions
94 lines (72 loc) · 4.19 KB
/
Copy pathViewController.m
File metadata and controls
94 lines (72 loc) · 4.19 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//
// ViewController.m
// Example
//
// Created by tang dixi on 12/8/14.
// Copyright (c) 2014 Tangdxi. All rights reserved.
//
#import "ViewController.h"
#import "DCPathButton.h"
@interface ViewController ()<DCPathButtonDelegate>
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self ConfigureDCPathButton];
}
- (void)ConfigureDCPathButton
{
// Configure center button
//
DCPathButton *dcPathButton = [[DCPathButton alloc]initWithCenterImage:[UIImage imageNamed:@"chooser-button-tab"]
hilightedImage:[UIImage imageNamed:@"chooser-button-tab-highlighted"]];
dcPathButton.delegate = self;
// Configure item buttons
//
DCPathItemButton *itemButton_1 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-music"]
highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-music-highlighted"]
backgroundImage:[UIImage imageNamed:@"chooser-moment-button"]
backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]];
DCPathItemButton *itemButton_2 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-place"]
highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-place-highlighted"]
backgroundImage:[UIImage imageNamed:@"chooser-moment-button"]
backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]];
DCPathItemButton *itemButton_3 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-camera"]
highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-camera-highlighted"]
backgroundImage:[UIImage imageNamed:@"chooser-moment-button"]
backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]];
DCPathItemButton *itemButton_4 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-thought"]
highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-thought-highlighted"]
backgroundImage:[UIImage imageNamed:@"chooser-moment-button"]
backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]];
DCPathItemButton *itemButton_5 = [[DCPathItemButton alloc]initWithImage:[UIImage imageNamed:@"chooser-moment-icon-sleep"]
highlightedImage:[UIImage imageNamed:@"chooser-moment-icon-sleep-highlighted"]
backgroundImage:[UIImage imageNamed:@"chooser-moment-button"]
backgroundHighlightedImage:[UIImage imageNamed:@"chooser-moment-button-highlighted"]];
// Add the item button into the center button
//
[dcPathButton addPathItems:@[itemButton_1, itemButton_2, itemButton_3, itemButton_4, itemButton_5]];
// Change the bloom radius
//
dcPathButton.bloomRadius = 120.0f;
// Change the DCButton's center
//
dcPathButton.dcButtonCenter = CGPointMake(self.view.bounds.size.width / 2, self.view.bounds.size.height - 25.5f);
[self.view addSubview:dcPathButton];
}
#pragma mark - DCPathButton Delegate
- (void)itemButtonTappedAtIndex:(NSUInteger)index
{
NSLog(@"You tap at index : %ld", index);
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(UIStatusBarStyle)preferredStatusBarStyle{
return UIStatusBarStyleLightContent;
}
@end