├── SCREENSHOT.gif
├── Demo
├── DBSphereTagCloud.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcuserdata
│ │ │ └── desolate.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ └── xcshareddata
│ │ │ └── DBSphereTagCloud.xccheckout
│ ├── xcuserdata
│ │ └── desolate.xcuserdatad
│ │ │ └── xcschemes
│ │ │ ├── xcschememanagement.plist
│ │ │ └── DBSphereTagCloud.xcscheme
│ └── project.pbxproj
├── DBSphereTagCloud
│ ├── ViewController.h
│ ├── AppDelegate.h
│ ├── main.m
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ ├── Info.plist
│ ├── Base.lproj
│ │ └── Main.storyboard
│ ├── ViewController.m
│ └── AppDelegate.m
└── DBSphereTagCloudTests
│ ├── Info.plist
│ └── DBSphereTagCloudTests.m
├── DBSphereTagCloud
├── DBPoint.h
├── DBSphereView.h
├── DBMatrix.h
└── DBSphereView.m
├── README.md
├── LICENSE
└── DBSphereTagCloud.podspec
/SCREENSHOT.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dongxinb/DBSphereTagCloud/HEAD/SCREENSHOT.gif
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud.xcodeproj/project.xcworkspace/xcuserdata/desolate.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dongxinb/DBSphereTagCloud/HEAD/Demo/DBSphereTagCloud.xcodeproj/project.xcworkspace/xcuserdata/desolate.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // DBSphereTagCloud
4 | //
5 | // Created by Xinbao Dong on 14/9/1.
6 | // Copyright (c) 2014年 Xinbao Dong. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // DBSphereTagCloud
4 | //
5 | // Created by Xinbao Dong on 14/9/1.
6 | // Copyright (c) 2014年 Xinbao Dong. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // DBSphereTagCloud
4 | //
5 | // Created by Xinbao Dong on 14/9/1.
6 | // Copyright (c) 2014年 Xinbao Dong. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/DBSphereTagCloud/DBPoint.h:
--------------------------------------------------------------------------------
1 | //
2 | // DBPoint.h
3 | // sphereTagCloud
4 | //
5 | // Created by Xinbao Dong on 14/8/31.
6 | // Copyright (c) 2014年 Xinbao Dong. All rights reserved.
7 | //
8 |
9 | #ifndef sphereTagCloud_DBPoint_h
10 | #define sphereTagCloud_DBPoint_h
11 |
12 | struct DBPoint {
13 | CGFloat x;
14 | CGFloat y;
15 | CGFloat z;
16 | };
17 |
18 | typedef struct DBPoint DBPoint;
19 |
20 |
21 | DBPoint DBPointMake(CGFloat x, CGFloat y, CGFloat z) {
22 | DBPoint point;
23 | point.x = x;
24 | point.y = y;
25 | point.z = z;
26 | return point;
27 | }
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/DBSphereTagCloud/DBSphereView.h:
--------------------------------------------------------------------------------
1 | //
2 | // DBSphereView.h
3 | // sphereTagCloud
4 | //
5 | // Created by Xinbao Dong on 14/8/31.
6 | // Copyright (c) 2014年 Xinbao Dong. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface DBSphereView : UIView
12 |
13 | /**
14 | * Sets the cloud's tag views.
15 | *
16 | * @remarks Any @c UIView subview can be passed in the array.
17 | *
18 | * @param array The array of tag views.
19 | */
20 | - (void)setCloudTags:(NSArray *)array;
21 |
22 | /**
23 | * Starts the cloud autorotation animation.
24 | */
25 | - (void)timerStart;
26 |
27 | /**
28 | * Stops the cloud autorotation animation.
29 | */
30 | - (void)timerStop;
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud.xcodeproj/xcuserdata/desolate.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | DBSphereTagCloud.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 9880A37D19B4972000227960
16 |
17 | primary
18 |
19 |
20 | 9880A39319B4972000227960
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloudTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.dongxinbao.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | DBSphereTagCloud
2 | ================
3 |
4 | A 3D spherical tag cloud view of iOS.
5 |
6 | [Here](https://github.com/apparition47/DBSphereTagCloudSwift) is the *Swift* version of the cloud view. Thanks for [apparition47](https://github.com/apparition47).
7 |
8 | ## Introduction
9 |
10 | DBSphereTagCloud is a 3D spherical tag cloud view using UIKit.
11 |
12 | You can customize the code easily because the code is simple.
13 |
14 | 
15 |
16 | ## Features
17 |
18 | * 3D effect 3D效果
19 | * auto rotation 自动旋转效果
20 | * inertial effect after rotation 惯性滚动效果
21 |
22 | ## Installation
23 |
24 | ```pod "DBSphereTagCloud"```
25 |
26 | ## Usage
27 | ```Objective-C
28 | DBSphereView *view = [[DBSphereView alloc] initWithFrame:CGRectMake(0, 100, 320, 320)];
29 | [view setCloudTags:buttonArray];
30 | [self.view addSubView:view];
31 | ```
32 |
33 | ## License
34 |
35 | Under MIT License.
36 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloudTests/DBSphereTagCloudTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // DBSphereTagCloudTests.m
3 | // DBSphereTagCloudTests
4 | //
5 | // Created by Xinbao Dong on 14/9/1.
6 | // Copyright (c) 2014年 Xinbao Dong. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface DBSphereTagCloudTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation DBSphereTagCloudTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013 Path, Inc.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.dongxinbao.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud.xcodeproj/project.xcworkspace/xcshareddata/DBSphereTagCloud.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | A011ADAA-FB47-4310-88AC-DAF91C4E0802
9 | IDESourceControlProjectName
10 | DBSphereTagCloud
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | AEA233ED2B5BFB582ABC16E3B78522508684D30E
14 | https://github.com/dongxinb/DBSphereTagCloud.git
15 |
16 | IDESourceControlProjectPath
17 | DBSphereTagCloud.xcodeproj
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | AEA233ED2B5BFB582ABC16E3B78522508684D30E
21 | ../..
22 |
23 | IDESourceControlProjectURL
24 | https://github.com/dongxinb/DBSphereTagCloud.git
25 | IDESourceControlProjectVersion
26 | 111
27 | IDESourceControlProjectWCCIdentifier
28 | AEA233ED2B5BFB582ABC16E3B78522508684D30E
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | AEA233ED2B5BFB582ABC16E3B78522508684D30E
36 | IDESourceControlWCCName
37 | DBSphereTagCloud
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // DBSphereTagCloud
4 | //
5 | // Created by Xinbao Dong on 14/9/1.
6 | // Copyright (c) 2014年 Xinbao Dong. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "DBSphereView.h"
11 |
12 | @interface ViewController ()
13 |
14 | @property (nonatomic, retain) DBSphereView *sphereView;
15 |
16 | @end
17 |
18 | @implementation ViewController
19 |
20 | @synthesize sphereView;
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 | sphereView = [[DBSphereView alloc] initWithFrame:CGRectMake(0, 100, 320, 320)];
25 | NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:0];
26 | for (NSInteger i = 0; i < 50; i ++) {
27 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
28 | [btn setTitle:[NSString stringWithFormat:@"P%ld", i] forState:UIControlStateNormal];
29 | [btn setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
30 | btn.titleLabel.font = [UIFont systemFontOfSize:24.];
31 | btn.frame = CGRectMake(0, 0, 60, 20);
32 | [btn addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
33 | [array addObject:btn];
34 | [sphereView addSubview:btn];
35 | }
36 | [sphereView setCloudTags:array];
37 | sphereView.backgroundColor = [UIColor whiteColor];
38 | [self.view addSubview:sphereView];
39 |
40 | // Do any additional setup after loading the view, typically from a nib.
41 | }
42 |
43 | - (void)buttonPressed:(UIButton *)btn
44 | {
45 | [sphereView timerStop];
46 |
47 | [UIView animateWithDuration:0.3 animations:^{
48 | btn.transform = CGAffineTransformMakeScale(2., 2.);
49 | } completion:^(BOOL finished) {
50 | [UIView animateWithDuration:0.3 animations:^{
51 | btn.transform = CGAffineTransformMakeScale(1., 1.);
52 | } completion:^(BOOL finished) {
53 | [sphereView timerStart];
54 | }];
55 | }];
56 | }
57 |
58 | - (void)didReceiveMemoryWarning
59 | {
60 | [super didReceiveMemoryWarning];
61 | // Dispose of any resources that can be recreated.
62 | }
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // DBSphereTagCloud
4 | //
5 | // Created by Xinbao Dong on 14/9/1.
6 | // Copyright (c) 2014年 Xinbao Dong. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 | - (void)applicationWillResignActive:(UIApplication *)application {
24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application {
29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31 | }
32 |
33 | - (void)applicationWillEnterForeground:(UIApplication *)application {
34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
35 | }
36 |
37 | - (void)applicationDidBecomeActive:(UIApplication *)application {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application {
42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud.xcodeproj/xcuserdata/desolate.xcuserdatad/xcschemes/DBSphereTagCloud.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
94 |
100 |
101 |
102 |
103 |
105 |
106 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/DBSphereTagCloud/DBMatrix.h:
--------------------------------------------------------------------------------
1 | //
2 | // DBMatrix.h
3 | // sphereTagCloud
4 | //
5 | // Created by Xinbao Dong on 14/8/31.
6 | // Copyright (c) 2014年 Xinbao Dong. All rights reserved.
7 | //
8 |
9 | #ifndef sphereTagCloud_DBMatrix_h
10 | #define sphereTagCloud_DBMatrix_h
11 |
12 | #import "DBPoint.h"
13 |
14 | struct DBMatrix {
15 | NSInteger column;
16 | NSInteger row;
17 | CGFloat matrix[4][4];
18 | };
19 |
20 | typedef struct DBMatrix DBMatrix;
21 |
22 | static DBMatrix DBMatrixMake(NSInteger column, NSInteger row) {
23 | DBMatrix matrix;
24 | matrix.column = column;
25 | matrix.row = row;
26 | for(NSInteger i = 0; i < column; i++){
27 | for(NSInteger j = 0; j < row; j++){
28 | matrix.matrix[i][j] = 0;
29 | }
30 | }
31 |
32 | return matrix;
33 | }
34 |
35 | static DBMatrix DBMatrixMakeFromArray(NSInteger column, NSInteger row, CGFloat *data) {
36 | DBMatrix matrix = DBMatrixMake(column, row);
37 | for (int i = 0; i < column; i ++) {
38 | CGFloat *t = data + (i * row);
39 | for (int j = 0; j < row; j++) {
40 | matrix.matrix[i][j] = *(t + j);
41 | }
42 | }
43 | return matrix;
44 | }
45 |
46 | static DBMatrix DBMatrixMutiply(DBMatrix a, DBMatrix b) {
47 | DBMatrix result = DBMatrixMake(a.column, b.row);
48 | for(NSInteger i = 0; i < a.column; i ++){
49 | for(NSInteger j = 0; j < b.row; j ++){
50 | for(NSInteger k = 0; k < a.row; k++){
51 | result.matrix[i][j] += a.matrix[i][k] * b.matrix[k][j];
52 | }
53 | }
54 | }
55 | return result;
56 | }
57 |
58 | static DBPoint DBPointMakeRotation(DBPoint point, DBPoint direction, CGFloat angle) {
59 | // CGFloat temp1[4] = {direction.x, direction.y, direction.z, 1};
60 | // DBMatrix directionM = DBMatrixMakeFromArray(1, 4, temp1);
61 | if (angle == 0) {
62 | return point;
63 | }
64 |
65 | CGFloat temp2[1][4] = {point.x, point.y, point.z, 1};
66 | // DBMatrix pointM = DBMatrixMakeFromArray(1, 4, *temp2);
67 |
68 | DBMatrix result = DBMatrixMakeFromArray(1, 4, *temp2);
69 |
70 | if (direction.z * direction.z + direction.y * direction.y != 0) {
71 | CGFloat cos1 = direction.z / sqrt(direction.z * direction.z + direction.y * direction.y);
72 | CGFloat sin1 = direction.y / sqrt(direction.z * direction.z + direction.y * direction.y);
73 | CGFloat t1[4][4] = {{1, 0, 0, 0}, {0, cos1, sin1, 0}, {0, -sin1, cos1, 0}, {0, 0, 0, 1}};
74 | DBMatrix m1 = DBMatrixMakeFromArray(4, 4, *t1);
75 | result = DBMatrixMutiply(result, m1);
76 | }
77 |
78 | if (direction.x * direction.x + direction.y * direction.y + direction.z * direction.z != 0) {
79 | CGFloat cos2 = sqrt(direction.y * direction.y + direction.z * direction.z) / sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z);
80 | CGFloat sin2 = -direction.x / sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z);
81 | CGFloat t2[4][4] = {{cos2, 0, -sin2, 0}, {0, 1, 0, 0}, {sin2, 0, cos2, 0}, {0, 0, 0, 1}};
82 | DBMatrix m2 = DBMatrixMakeFromArray(4, 4, *t2);
83 | result = DBMatrixMutiply(result, m2);
84 | }
85 |
86 | CGFloat cos3 = cos(angle);
87 | CGFloat sin3 = sin(angle);
88 | CGFloat t3[4][4] = {{cos3, sin3, 0, 0}, {-sin3, cos3, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};
89 | DBMatrix m3 = DBMatrixMakeFromArray(4, 4, *t3);
90 | result = DBMatrixMutiply(result, m3);
91 |
92 | if (direction.x * direction.x + direction.y * direction.y + direction.z * direction.z != 0) {
93 | CGFloat cos2 = sqrt(direction.y * direction.y + direction.z * direction.z) / sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z);
94 | CGFloat sin2 = -direction.x / sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z);
95 | CGFloat t2_[4][4] = {{cos2, 0, sin2, 0}, {0, 1, 0, 0}, {-sin2, 0, cos2, 0}, {0, 0, 0, 1}};
96 | DBMatrix m2_ = DBMatrixMakeFromArray(4, 4, *t2_);
97 | result = DBMatrixMutiply(result, m2_);
98 | }
99 |
100 | if (direction.z * direction.z + direction.y * direction.y != 0) {
101 | CGFloat cos1 = direction.z / sqrt(direction.z * direction.z + direction.y * direction.y);
102 | CGFloat sin1 = direction.y / sqrt(direction.z * direction.z + direction.y * direction.y);
103 | CGFloat t1_[4][4] = {{1, 0, 0, 0}, {0, cos1, -sin1, 0}, {0, sin1, cos1, 0}, {0, 0, 0, 1}};
104 | DBMatrix m1_ = DBMatrixMakeFromArray(4, 4, *t1_);
105 | result = DBMatrixMutiply(result, m1_);
106 | }
107 |
108 | DBPoint resultPoint = DBPointMake(result.matrix[0][0], result.matrix[0][1], result.matrix[0][2]);
109 |
110 | return resultPoint;
111 | }
112 |
113 | #endif
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/DBSphereTagCloud.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod spec lint DBSphereTagCloud.podspec' to ensure this is a
3 | # valid spec and to remove all comments including this before submitting the spec.
4 | #
5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
7 | #
8 |
9 | Pod::Spec.new do |s|
10 |
11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
12 | #
13 | # These will help people to find your library, and whilst it
14 | # can feel like a chore to fill in it's definitely to your advantage. The
15 | # summary should be tweet-length, and the description more in depth.
16 | #
17 |
18 | s.name = "DBSphereTagCloud"
19 | s.version = "1.0.0"
20 | s.summary = "A 3D spherical tag cloud view of iOS."
21 |
22 | s.description = <<-DESC
23 | DBSphereTagCloud is a 3D spherical tag cloud view using UIKit.
24 |
25 | DESC
26 |
27 | s.homepage = "https://github.com/dongxinb/DBSphereTagCloud"
28 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
29 |
30 |
31 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
32 | #
33 | # Licensing your code is important. See http://choosealicense.com for more info.
34 | # CocoaPods will detect a license file if there is a named LICENSE*
35 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
36 | #
37 |
38 | s.license = "MIT"
39 | # s.license = { :type => "MIT", :file => "LICENSE" }
40 |
41 |
42 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
43 | #
44 | # Specify the authors of the library, with email addresses. Email addresses
45 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
46 | # accepts just a name if you'd rather not provide an email address.
47 | #
48 | # Specify a social_media_url where others can refer to, for example a twitter
49 | # profile URL.
50 | #
51 |
52 | s.author = { "Dong Xinbao" => "dongxinb@gmail.com" }
53 | # Or just: s.author = "Dong Xinbao"
54 | # s.authors = { "Dong Xinbao" => "dongxinb@gmail.com" }
55 | # s.social_media_url = "http://twitter.com/Dong Xinbao"
56 |
57 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
58 | #
59 | # If this Pod runs only on iOS or OS X, then specify the platform and
60 | # the deployment target. You can optionally include the target after the platform.
61 | #
62 |
63 | # s.platform = :ios
64 | s.platform = :ios, "6.0"
65 |
66 | # When using multiple platforms
67 | # s.ios.deployment_target = "5.0"
68 | # s.osx.deployment_target = "10.7"
69 |
70 |
71 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
72 | #
73 | # Specify the location from where the source should be retrieved.
74 | # Supports git, hg, bzr, svn and HTTP.
75 | #
76 |
77 | s.source = { :git => "https://github.com/dongxinb/DBSphereTagCloud.git", :tag => "1.0.0" }
78 |
79 |
80 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
81 | #
82 | # CocoaPods is smart about how it includes source code. For source files
83 | # giving a folder will include any h, m, mm, c & cpp files. For header
84 | # files it will include any header in the folder.
85 | # Not including the public_header_files will make all headers public.
86 | #
87 |
88 | s.source_files = "DBSphereTagCloud/*"
89 |
90 | # s.public_header_files = "Classes/**/*.h"
91 |
92 |
93 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
94 | #
95 | # A list of resources included with the Pod. These are copied into the
96 | # target bundle with a build phase script. Anything else will be cleaned.
97 | # You can preserve files from being cleaned, please don't preserve
98 | # non-essential files like tests, examples and documentation.
99 | #
100 |
101 | # s.resource = "icon.png"
102 | # s.resources = "Resources/*.png"
103 |
104 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave"
105 |
106 |
107 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
108 | #
109 | # Link your library with frameworks, or libraries. Libraries do not include
110 | # the lib prefix of their name.
111 | #
112 |
113 | # s.framework = "SomeFramework"
114 | s.frameworks = 'Foundation', 'CoreGraphics', 'UIKit'
115 |
116 | # s.library = "iconv"
117 | # s.libraries = "iconv", "xml2"
118 |
119 |
120 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
121 | #
122 | # If your library depends on compiler flags you can set them in the xcconfig hash
123 | # where they will only apply to your library. If you depend on other Podspecs
124 | # you can include multiple dependencies to ensure it works.
125 |
126 | s.requires_arc = true
127 |
128 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
129 | # s.dependency "JSONKit", "~> 1.4"
130 |
131 | end
132 |
--------------------------------------------------------------------------------
/DBSphereTagCloud/DBSphereView.m:
--------------------------------------------------------------------------------
1 | //
2 | // DBSphereView.m
3 | // sphereTagCloud
4 | //
5 | // Created by Xinbao Dong on 14/8/31.
6 | // Copyright (c) 2014年 Xinbao Dong. All rights reserved.
7 | //
8 |
9 | #import "DBSphereView.h"
10 | #import "DBMatrix.h"
11 |
12 | @interface DBSphereView()
13 |
14 | @end
15 |
16 | @implementation DBSphereView
17 | {
18 | NSMutableArray *tags;
19 | NSMutableArray *coordinate;
20 | DBPoint normalDirection;
21 | CGPoint last;
22 |
23 | CGFloat velocity;
24 |
25 | CADisplayLink *timer;
26 | CADisplayLink *inertia;
27 | }
28 |
29 | - (void)setup {
30 | UIPanGestureRecognizer *gesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
31 | [self addGestureRecognizer:gesture];
32 |
33 | inertia = [CADisplayLink displayLinkWithTarget:self selector:@selector(inertiaStep)];
34 | [inertia addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
35 |
36 | timer = [CADisplayLink displayLinkWithTarget:self selector:@selector(autoTurnRotation)];
37 | [timer addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
38 | }
39 |
40 | - (id)initWithCoder:(NSCoder*)aDecoder
41 | {
42 | if(self = [super initWithCoder:aDecoder]) {
43 | [self setup];
44 | }
45 | return self;
46 | }
47 |
48 | - (id)initWithFrame:(CGRect)frame
49 | {
50 | self = [super initWithFrame:frame];
51 | if (self) {
52 | [self setup];
53 | }
54 | return self;
55 | }
56 |
57 | #pragma mark - initial set
58 |
59 | - (void)setCloudTags:(NSArray *)array
60 | {
61 | tags = [NSMutableArray arrayWithArray:array];
62 | coordinate = [[NSMutableArray alloc] initWithCapacity:0];
63 |
64 | for (NSInteger i = 0; i < tags.count; i ++) {
65 | UIView *view = [tags objectAtIndex:i];
66 | view.center = CGPointMake(self.frame.size.width / 2., self.frame.size.height / 2.);
67 | }
68 |
69 | CGFloat p1 = M_PI * (3 - sqrt(5));
70 | CGFloat p2 = 2. / tags.count;
71 |
72 | for (NSInteger i = 0; i < tags.count; i ++) {
73 |
74 | CGFloat y = i * p2 - 1 + (p2 / 2);
75 | CGFloat r = sqrt(1 - y * y);
76 | CGFloat p3 = i * p1;
77 | CGFloat x = cos(p3) * r;
78 | CGFloat z = sin(p3) * r;
79 |
80 |
81 | DBPoint point = DBPointMake(x, y, z);
82 | NSValue *value = [NSValue value:&point withObjCType:@encode(DBPoint)];
83 | [coordinate addObject:value];
84 |
85 | CGFloat time = (arc4random() % 10 + 10.) / 20.;
86 | [UIView animateWithDuration:time delay:0. options:UIViewAnimationOptionCurveEaseOut animations:^{
87 | [self setTagOfPoint:point andIndex:i];
88 | } completion:^(BOOL finished) {
89 |
90 | }];
91 |
92 | }
93 |
94 | NSInteger a = arc4random() % 10 - 5;
95 | NSInteger b = arc4random() % 10 - 5;
96 | normalDirection = DBPointMake(a, b, 0);
97 | [self timerStart];
98 | }
99 |
100 | #pragma mark - set frame of point
101 |
102 | - (void)updateFrameOfPoint:(NSInteger)index direction:(DBPoint)direction andAngle:(CGFloat)angle
103 | {
104 |
105 | NSValue *value = [coordinate objectAtIndex:index];
106 | DBPoint point;
107 | [value getValue:&point];
108 |
109 | DBPoint rPoint = DBPointMakeRotation(point, direction, angle);
110 | value = [NSValue value:&rPoint withObjCType:@encode(DBPoint)];
111 | coordinate[index] = value;
112 |
113 | [self setTagOfPoint:rPoint andIndex:index];
114 |
115 | }
116 |
117 | - (void)setTagOfPoint: (DBPoint)point andIndex:(NSInteger)index
118 | {
119 | UIView *view = [tags objectAtIndex:index];
120 | view.center = CGPointMake((point.x + 1) * (self.frame.size.width / 2.), (point.y + 1) * self.frame.size.width / 2.);
121 |
122 | CGFloat transform = (point.z + 2) / 3;
123 | view.transform = CGAffineTransformScale(CGAffineTransformIdentity, transform, transform);
124 | view.layer.zPosition = transform;
125 | view.alpha = transform;
126 | if (point.z < 0) {
127 | view.userInteractionEnabled = NO;
128 | }else {
129 | view.userInteractionEnabled = YES;
130 | }
131 | }
132 |
133 | #pragma mark - autoTurnRotation
134 |
135 | - (void)timerStart
136 | {
137 | timer.paused = NO;
138 | }
139 |
140 | - (void)timerStop
141 | {
142 | timer.paused = YES;
143 | }
144 |
145 | - (void)autoTurnRotation
146 | {
147 | for (NSInteger i = 0; i < tags.count; i ++) {
148 | [self updateFrameOfPoint:i direction:normalDirection andAngle:0.002];
149 | }
150 |
151 | }
152 |
153 | #pragma mark - inertia
154 |
155 | - (void)inertiaStart
156 | {
157 | [self timerStop];
158 | inertia.paused = NO;
159 | }
160 |
161 | - (void)inertiaStop
162 | {
163 | [self timerStart];
164 | inertia.paused = YES;
165 | }
166 |
167 | - (void)inertiaStep
168 | {
169 | if (velocity <= 0) {
170 | [self inertiaStop];
171 | }else {
172 | velocity -= 70.;
173 | CGFloat angle = velocity / self.frame.size.width * 2. * inertia.duration;
174 | for (NSInteger i = 0; i < tags.count; i ++) {
175 | [self updateFrameOfPoint:i direction:normalDirection andAngle:angle];
176 | }
177 | }
178 |
179 | }
180 |
181 | #pragma mark - gesture selector
182 |
183 | - (void)handlePanGesture:(UIPanGestureRecognizer *)gesture
184 | {
185 | if (gesture.state == UIGestureRecognizerStateBegan) {
186 | last = [gesture locationInView:self];
187 | [self timerStop];
188 | [self inertiaStop];
189 |
190 | }else if (gesture.state == UIGestureRecognizerStateChanged) {
191 | CGPoint current = [gesture locationInView:self];
192 | DBPoint direction = DBPointMake(last.y - current.y, current.x - last.x, 0);
193 |
194 | CGFloat distance = sqrt(direction.x * direction.x + direction.y * direction.y);
195 |
196 | CGFloat angle = distance / (self.frame.size.width / 2.);
197 |
198 | for (NSInteger i = 0; i < tags.count; i ++) {
199 | [self updateFrameOfPoint:i direction:direction andAngle:angle];
200 | }
201 | normalDirection = direction;
202 | last = current;
203 | }else if (gesture.state == UIGestureRecognizerStateEnded) {
204 | CGPoint velocityP = [gesture velocityInView:self];
205 | velocity = sqrt(velocityP.x * velocityP.x + velocityP.y * velocityP.y);
206 | [self inertiaStart];
207 |
208 | }
209 |
210 |
211 | }
212 |
213 | @end
214 |
215 |
216 |
--------------------------------------------------------------------------------
/Demo/DBSphereTagCloud.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 98145DBC19B6A0E800CFBB12 /* DBSphereView.m in Sources */ = {isa = PBXBuildFile; fileRef = 98145DBB19B6A0E800CFBB12 /* DBSphereView.m */; };
11 | 9880A38419B4972000227960 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9880A38319B4972000227960 /* main.m */; };
12 | 9880A38719B4972000227960 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9880A38619B4972000227960 /* AppDelegate.m */; };
13 | 9880A38A19B4972000227960 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9880A38919B4972000227960 /* ViewController.m */; };
14 | 9880A38D19B4972000227960 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9880A38B19B4972000227960 /* Main.storyboard */; };
15 | 9880A38F19B4972000227960 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9880A38E19B4972000227960 /* Images.xcassets */; };
16 | 9880A39B19B4972000227960 /* DBSphereTagCloudTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9880A39A19B4972000227960 /* DBSphereTagCloudTests.m */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXContainerItemProxy section */
20 | 9880A39519B4972000227960 /* PBXContainerItemProxy */ = {
21 | isa = PBXContainerItemProxy;
22 | containerPortal = 9880A37619B4972000227960 /* Project object */;
23 | proxyType = 1;
24 | remoteGlobalIDString = 9880A37D19B4972000227960;
25 | remoteInfo = DBSphereTagCloud;
26 | };
27 | /* End PBXContainerItemProxy section */
28 |
29 | /* Begin PBXFileReference section */
30 | 98145DB819B6A0E800CFBB12 /* DBMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DBMatrix.h; path = ../../DBSphereTagCloud/DBMatrix.h; sourceTree = ""; };
31 | 98145DB919B6A0E800CFBB12 /* DBPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DBPoint.h; path = ../../DBSphereTagCloud/DBPoint.h; sourceTree = ""; };
32 | 98145DBA19B6A0E800CFBB12 /* DBSphereView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DBSphereView.h; path = ../../DBSphereTagCloud/DBSphereView.h; sourceTree = ""; };
33 | 98145DBB19B6A0E800CFBB12 /* DBSphereView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DBSphereView.m; path = ../../DBSphereTagCloud/DBSphereView.m; sourceTree = ""; };
34 | 9880A37E19B4972000227960 /* DBSphereTagCloud.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DBSphereTagCloud.app; sourceTree = BUILT_PRODUCTS_DIR; };
35 | 9880A38219B4972000227960 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
36 | 9880A38319B4972000227960 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
37 | 9880A38519B4972000227960 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
38 | 9880A38619B4972000227960 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
39 | 9880A38819B4972000227960 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
40 | 9880A38919B4972000227960 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
41 | 9880A38C19B4972000227960 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 9880A38E19B4972000227960 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
43 | 9880A39419B4972000227960 /* DBSphereTagCloudTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DBSphereTagCloudTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
44 | 9880A39919B4972000227960 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | 9880A39A19B4972000227960 /* DBSphereTagCloudTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DBSphereTagCloudTests.m; sourceTree = ""; };
46 | /* End PBXFileReference section */
47 |
48 | /* Begin PBXFrameworksBuildPhase section */
49 | 9880A37B19B4972000227960 /* Frameworks */ = {
50 | isa = PBXFrameworksBuildPhase;
51 | buildActionMask = 2147483647;
52 | files = (
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | 9880A39119B4972000227960 /* Frameworks */ = {
57 | isa = PBXFrameworksBuildPhase;
58 | buildActionMask = 2147483647;
59 | files = (
60 | );
61 | runOnlyForDeploymentPostprocessing = 0;
62 | };
63 | /* End PBXFrameworksBuildPhase section */
64 |
65 | /* Begin PBXGroup section */
66 | 9880A37519B4972000227960 = {
67 | isa = PBXGroup;
68 | children = (
69 | 9880A38019B4972000227960 /* DBSphereTagCloud */,
70 | 9880A39719B4972000227960 /* DBSphereTagCloudTests */,
71 | 9880A37F19B4972000227960 /* Products */,
72 | );
73 | sourceTree = "";
74 | };
75 | 9880A37F19B4972000227960 /* Products */ = {
76 | isa = PBXGroup;
77 | children = (
78 | 9880A37E19B4972000227960 /* DBSphereTagCloud.app */,
79 | 9880A39419B4972000227960 /* DBSphereTagCloudTests.xctest */,
80 | );
81 | name = Products;
82 | sourceTree = "";
83 | };
84 | 9880A38019B4972000227960 /* DBSphereTagCloud */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 9880A3A919B4981F00227960 /* class */,
88 | 9880A38519B4972000227960 /* AppDelegate.h */,
89 | 9880A38619B4972000227960 /* AppDelegate.m */,
90 | 9880A38819B4972000227960 /* ViewController.h */,
91 | 9880A38919B4972000227960 /* ViewController.m */,
92 | 9880A38B19B4972000227960 /* Main.storyboard */,
93 | 9880A38E19B4972000227960 /* Images.xcassets */,
94 | 9880A38119B4972000227960 /* Supporting Files */,
95 | );
96 | path = DBSphereTagCloud;
97 | sourceTree = "";
98 | };
99 | 9880A38119B4972000227960 /* Supporting Files */ = {
100 | isa = PBXGroup;
101 | children = (
102 | 9880A38219B4972000227960 /* Info.plist */,
103 | 9880A38319B4972000227960 /* main.m */,
104 | );
105 | name = "Supporting Files";
106 | sourceTree = "";
107 | };
108 | 9880A39719B4972000227960 /* DBSphereTagCloudTests */ = {
109 | isa = PBXGroup;
110 | children = (
111 | 9880A39A19B4972000227960 /* DBSphereTagCloudTests.m */,
112 | 9880A39819B4972000227960 /* Supporting Files */,
113 | );
114 | path = DBSphereTagCloudTests;
115 | sourceTree = "";
116 | };
117 | 9880A39819B4972000227960 /* Supporting Files */ = {
118 | isa = PBXGroup;
119 | children = (
120 | 9880A39919B4972000227960 /* Info.plist */,
121 | );
122 | name = "Supporting Files";
123 | sourceTree = "";
124 | };
125 | 9880A3A919B4981F00227960 /* class */ = {
126 | isa = PBXGroup;
127 | children = (
128 | 98145DB819B6A0E800CFBB12 /* DBMatrix.h */,
129 | 98145DB919B6A0E800CFBB12 /* DBPoint.h */,
130 | 98145DBA19B6A0E800CFBB12 /* DBSphereView.h */,
131 | 98145DBB19B6A0E800CFBB12 /* DBSphereView.m */,
132 | );
133 | name = class;
134 | sourceTree = "";
135 | };
136 | /* End PBXGroup section */
137 |
138 | /* Begin PBXNativeTarget section */
139 | 9880A37D19B4972000227960 /* DBSphereTagCloud */ = {
140 | isa = PBXNativeTarget;
141 | buildConfigurationList = 9880A39E19B4972000227960 /* Build configuration list for PBXNativeTarget "DBSphereTagCloud" */;
142 | buildPhases = (
143 | 9880A37A19B4972000227960 /* Sources */,
144 | 9880A37B19B4972000227960 /* Frameworks */,
145 | 9880A37C19B4972000227960 /* Resources */,
146 | );
147 | buildRules = (
148 | );
149 | dependencies = (
150 | );
151 | name = DBSphereTagCloud;
152 | productName = DBSphereTagCloud;
153 | productReference = 9880A37E19B4972000227960 /* DBSphereTagCloud.app */;
154 | productType = "com.apple.product-type.application";
155 | };
156 | 9880A39319B4972000227960 /* DBSphereTagCloudTests */ = {
157 | isa = PBXNativeTarget;
158 | buildConfigurationList = 9880A3A119B4972000227960 /* Build configuration list for PBXNativeTarget "DBSphereTagCloudTests" */;
159 | buildPhases = (
160 | 9880A39019B4972000227960 /* Sources */,
161 | 9880A39119B4972000227960 /* Frameworks */,
162 | 9880A39219B4972000227960 /* Resources */,
163 | );
164 | buildRules = (
165 | );
166 | dependencies = (
167 | 9880A39619B4972000227960 /* PBXTargetDependency */,
168 | );
169 | name = DBSphereTagCloudTests;
170 | productName = DBSphereTagCloudTests;
171 | productReference = 9880A39419B4972000227960 /* DBSphereTagCloudTests.xctest */;
172 | productType = "com.apple.product-type.bundle.unit-test";
173 | };
174 | /* End PBXNativeTarget section */
175 |
176 | /* Begin PBXProject section */
177 | 9880A37619B4972000227960 /* Project object */ = {
178 | isa = PBXProject;
179 | attributes = {
180 | LastUpgradeCheck = 0600;
181 | ORGANIZATIONNAME = "Xinbao Dong";
182 | TargetAttributes = {
183 | 9880A37D19B4972000227960 = {
184 | CreatedOnToolsVersion = 6.0;
185 | };
186 | 9880A39319B4972000227960 = {
187 | CreatedOnToolsVersion = 6.0;
188 | TestTargetID = 9880A37D19B4972000227960;
189 | };
190 | };
191 | };
192 | buildConfigurationList = 9880A37919B4972000227960 /* Build configuration list for PBXProject "DBSphereTagCloud" */;
193 | compatibilityVersion = "Xcode 3.2";
194 | developmentRegion = English;
195 | hasScannedForEncodings = 0;
196 | knownRegions = (
197 | en,
198 | Base,
199 | );
200 | mainGroup = 9880A37519B4972000227960;
201 | productRefGroup = 9880A37F19B4972000227960 /* Products */;
202 | projectDirPath = "";
203 | projectRoot = "";
204 | targets = (
205 | 9880A37D19B4972000227960 /* DBSphereTagCloud */,
206 | 9880A39319B4972000227960 /* DBSphereTagCloudTests */,
207 | );
208 | };
209 | /* End PBXProject section */
210 |
211 | /* Begin PBXResourcesBuildPhase section */
212 | 9880A37C19B4972000227960 /* Resources */ = {
213 | isa = PBXResourcesBuildPhase;
214 | buildActionMask = 2147483647;
215 | files = (
216 | 9880A38D19B4972000227960 /* Main.storyboard in Resources */,
217 | 9880A38F19B4972000227960 /* Images.xcassets in Resources */,
218 | );
219 | runOnlyForDeploymentPostprocessing = 0;
220 | };
221 | 9880A39219B4972000227960 /* Resources */ = {
222 | isa = PBXResourcesBuildPhase;
223 | buildActionMask = 2147483647;
224 | files = (
225 | );
226 | runOnlyForDeploymentPostprocessing = 0;
227 | };
228 | /* End PBXResourcesBuildPhase section */
229 |
230 | /* Begin PBXSourcesBuildPhase section */
231 | 9880A37A19B4972000227960 /* Sources */ = {
232 | isa = PBXSourcesBuildPhase;
233 | buildActionMask = 2147483647;
234 | files = (
235 | 9880A38A19B4972000227960 /* ViewController.m in Sources */,
236 | 98145DBC19B6A0E800CFBB12 /* DBSphereView.m in Sources */,
237 | 9880A38719B4972000227960 /* AppDelegate.m in Sources */,
238 | 9880A38419B4972000227960 /* main.m in Sources */,
239 | );
240 | runOnlyForDeploymentPostprocessing = 0;
241 | };
242 | 9880A39019B4972000227960 /* Sources */ = {
243 | isa = PBXSourcesBuildPhase;
244 | buildActionMask = 2147483647;
245 | files = (
246 | 9880A39B19B4972000227960 /* DBSphereTagCloudTests.m in Sources */,
247 | );
248 | runOnlyForDeploymentPostprocessing = 0;
249 | };
250 | /* End PBXSourcesBuildPhase section */
251 |
252 | /* Begin PBXTargetDependency section */
253 | 9880A39619B4972000227960 /* PBXTargetDependency */ = {
254 | isa = PBXTargetDependency;
255 | target = 9880A37D19B4972000227960 /* DBSphereTagCloud */;
256 | targetProxy = 9880A39519B4972000227960 /* PBXContainerItemProxy */;
257 | };
258 | /* End PBXTargetDependency section */
259 |
260 | /* Begin PBXVariantGroup section */
261 | 9880A38B19B4972000227960 /* Main.storyboard */ = {
262 | isa = PBXVariantGroup;
263 | children = (
264 | 9880A38C19B4972000227960 /* Base */,
265 | );
266 | name = Main.storyboard;
267 | sourceTree = "";
268 | };
269 | /* End PBXVariantGroup section */
270 |
271 | /* Begin XCBuildConfiguration section */
272 | 9880A39C19B4972000227960 /* Debug */ = {
273 | isa = XCBuildConfiguration;
274 | buildSettings = {
275 | ALWAYS_SEARCH_USER_PATHS = NO;
276 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
277 | CLANG_CXX_LIBRARY = "libc++";
278 | CLANG_ENABLE_MODULES = YES;
279 | CLANG_ENABLE_OBJC_ARC = YES;
280 | CLANG_WARN_BOOL_CONVERSION = YES;
281 | CLANG_WARN_CONSTANT_CONVERSION = YES;
282 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
283 | CLANG_WARN_EMPTY_BODY = YES;
284 | CLANG_WARN_ENUM_CONVERSION = YES;
285 | CLANG_WARN_INT_CONVERSION = YES;
286 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
287 | CLANG_WARN_UNREACHABLE_CODE = YES;
288 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
289 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
290 | COPY_PHASE_STRIP = NO;
291 | ENABLE_STRICT_OBJC_MSGSEND = YES;
292 | GCC_C_LANGUAGE_STANDARD = gnu99;
293 | GCC_DYNAMIC_NO_PIC = NO;
294 | GCC_OPTIMIZATION_LEVEL = 0;
295 | GCC_PREPROCESSOR_DEFINITIONS = (
296 | "DEBUG=1",
297 | "$(inherited)",
298 | );
299 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
300 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
301 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
302 | GCC_WARN_UNDECLARED_SELECTOR = YES;
303 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
304 | GCC_WARN_UNUSED_FUNCTION = YES;
305 | GCC_WARN_UNUSED_VARIABLE = YES;
306 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
307 | MTL_ENABLE_DEBUG_INFO = YES;
308 | ONLY_ACTIVE_ARCH = YES;
309 | SDKROOT = iphoneos;
310 | };
311 | name = Debug;
312 | };
313 | 9880A39D19B4972000227960 /* Release */ = {
314 | isa = XCBuildConfiguration;
315 | buildSettings = {
316 | ALWAYS_SEARCH_USER_PATHS = NO;
317 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
318 | CLANG_CXX_LIBRARY = "libc++";
319 | CLANG_ENABLE_MODULES = YES;
320 | CLANG_ENABLE_OBJC_ARC = YES;
321 | CLANG_WARN_BOOL_CONVERSION = YES;
322 | CLANG_WARN_CONSTANT_CONVERSION = YES;
323 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
324 | CLANG_WARN_EMPTY_BODY = YES;
325 | CLANG_WARN_ENUM_CONVERSION = YES;
326 | CLANG_WARN_INT_CONVERSION = YES;
327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
328 | CLANG_WARN_UNREACHABLE_CODE = YES;
329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
331 | COPY_PHASE_STRIP = YES;
332 | ENABLE_NS_ASSERTIONS = NO;
333 | ENABLE_STRICT_OBJC_MSGSEND = YES;
334 | GCC_C_LANGUAGE_STANDARD = gnu99;
335 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
336 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
337 | GCC_WARN_UNDECLARED_SELECTOR = YES;
338 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
339 | GCC_WARN_UNUSED_FUNCTION = YES;
340 | GCC_WARN_UNUSED_VARIABLE = YES;
341 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
342 | MTL_ENABLE_DEBUG_INFO = NO;
343 | SDKROOT = iphoneos;
344 | VALIDATE_PRODUCT = YES;
345 | };
346 | name = Release;
347 | };
348 | 9880A39F19B4972000227960 /* Debug */ = {
349 | isa = XCBuildConfiguration;
350 | buildSettings = {
351 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
352 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
353 | INFOPLIST_FILE = DBSphereTagCloud/Info.plist;
354 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
355 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
356 | PRODUCT_NAME = "$(TARGET_NAME)";
357 | };
358 | name = Debug;
359 | };
360 | 9880A3A019B4972000227960 /* Release */ = {
361 | isa = XCBuildConfiguration;
362 | buildSettings = {
363 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
364 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
365 | INFOPLIST_FILE = DBSphereTagCloud/Info.plist;
366 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
367 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
368 | PRODUCT_NAME = "$(TARGET_NAME)";
369 | };
370 | name = Release;
371 | };
372 | 9880A3A219B4972000227960 /* Debug */ = {
373 | isa = XCBuildConfiguration;
374 | buildSettings = {
375 | BUNDLE_LOADER = "$(TEST_HOST)";
376 | FRAMEWORK_SEARCH_PATHS = (
377 | "$(SDKROOT)/Developer/Library/Frameworks",
378 | "$(inherited)",
379 | );
380 | GCC_PREPROCESSOR_DEFINITIONS = (
381 | "DEBUG=1",
382 | "$(inherited)",
383 | );
384 | INFOPLIST_FILE = DBSphereTagCloudTests/Info.plist;
385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
386 | PRODUCT_NAME = "$(TARGET_NAME)";
387 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DBSphereTagCloud.app/DBSphereTagCloud";
388 | };
389 | name = Debug;
390 | };
391 | 9880A3A319B4972000227960 /* Release */ = {
392 | isa = XCBuildConfiguration;
393 | buildSettings = {
394 | BUNDLE_LOADER = "$(TEST_HOST)";
395 | FRAMEWORK_SEARCH_PATHS = (
396 | "$(SDKROOT)/Developer/Library/Frameworks",
397 | "$(inherited)",
398 | );
399 | INFOPLIST_FILE = DBSphereTagCloudTests/Info.plist;
400 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
401 | PRODUCT_NAME = "$(TARGET_NAME)";
402 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DBSphereTagCloud.app/DBSphereTagCloud";
403 | };
404 | name = Release;
405 | };
406 | /* End XCBuildConfiguration section */
407 |
408 | /* Begin XCConfigurationList section */
409 | 9880A37919B4972000227960 /* Build configuration list for PBXProject "DBSphereTagCloud" */ = {
410 | isa = XCConfigurationList;
411 | buildConfigurations = (
412 | 9880A39C19B4972000227960 /* Debug */,
413 | 9880A39D19B4972000227960 /* Release */,
414 | );
415 | defaultConfigurationIsVisible = 0;
416 | defaultConfigurationName = Release;
417 | };
418 | 9880A39E19B4972000227960 /* Build configuration list for PBXNativeTarget "DBSphereTagCloud" */ = {
419 | isa = XCConfigurationList;
420 | buildConfigurations = (
421 | 9880A39F19B4972000227960 /* Debug */,
422 | 9880A3A019B4972000227960 /* Release */,
423 | );
424 | defaultConfigurationIsVisible = 0;
425 | defaultConfigurationName = Release;
426 | };
427 | 9880A3A119B4972000227960 /* Build configuration list for PBXNativeTarget "DBSphereTagCloudTests" */ = {
428 | isa = XCConfigurationList;
429 | buildConfigurations = (
430 | 9880A3A219B4972000227960 /* Debug */,
431 | 9880A3A319B4972000227960 /* Release */,
432 | );
433 | defaultConfigurationIsVisible = 0;
434 | defaultConfigurationName = Release;
435 | };
436 | /* End XCConfigurationList section */
437 | };
438 | rootObject = 9880A37619B4972000227960 /* Project object */;
439 | }
440 |
--------------------------------------------------------------------------------