├── README.md
├── .DS_Store
├── MyShow
├── .DS_Store
├── Resource
│ ├── 1.jpg
│ └── pointer.png
├── Classes
│ ├── .DS_Store
│ ├── Home
│ │ ├── .DS_Store
│ │ ├── View
│ │ │ └── .DS_Store
│ │ ├── AboutMe
│ │ │ ├── Zhangjh.m
│ │ │ ├── AboutMeViewController.h
│ │ │ ├── Zhangjh.h
│ │ │ ├── AboutMeViewController.m
│ │ │ └── AboutMeViewController.xib
│ │ ├── Controller
│ │ │ ├── JHHomeViewController.h
│ │ │ ├── JHHomeViewController.xib
│ │ │ └── JHHomeViewController.m
│ │ ├── BlueTooth
│ │ │ ├── BlueToothViewController.h
│ │ │ ├── BluetoothEncryption.h
│ │ │ ├── BluetoothEncryption.m
│ │ │ ├── BlueToothViewController.m
│ │ │ ├── BlueToothViewController.xib
│ │ │ ├── YMBlueToothTool.h
│ │ │ ├── ZBlueToothTools.h
│ │ │ ├── ZBlueToothTools.m
│ │ │ └── YMBlueToothTool.m
│ │ ├── Turntable
│ │ │ ├── TurntableViewController.h
│ │ │ ├── TurntableView
│ │ │ │ ├── TurntableView.h
│ │ │ │ └── TurntableView.m
│ │ │ ├── TurntableViewController.m
│ │ │ └── TurntableViewController.xib
│ │ └── AlertController
│ │ │ ├── ZJHAlertViewController.h
│ │ │ └── ZJHAlertViewController.m
│ ├── Configs
│ │ └── PrefixHeader.pch
│ └── Base
│ │ ├── BaseViewController
│ │ ├── BaseViewController.h
│ │ └── BaseViewController.m
│ │ └── base
│ │ ├── DefineConstant.h
│ │ └── DefineConstant.m
├── ViewController.h
├── AppDelegate.h
├── main.m
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── AppDelegate.m
├── ViewController.m
└── Base.lproj
│ ├── Main.storyboard
│ └── LaunchScreen.storyboard
├── MyShow.xcodeproj
├── xcuserdata
│ ├── zjh.xcuserdatad
│ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ │ ├── xcschememanagement.plist
│ │ │ └── MyShow.xcscheme
│ └── jianhuazhang.xcuserdatad
│ │ ├── xcschemes
│ │ └── xcschememanagement.plist
│ │ └── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ ├── zjh.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ │ └── jianhuazhang.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── project.pbxproj
├── MyShowTests
├── Info.plist
└── MyShowTests.m
└── MyShowUITests
├── Info.plist
└── MyShowUITests.m
/README.md:
--------------------------------------------------------------------------------
1 | MyShow
2 | 1.简单的转盘实现(旋转动画实现转盘旋转)
3 | 2.蓝牙使用实例(字节数组传输)
4 |
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixOutlaw/UIAnimation/HEAD/.DS_Store
--------------------------------------------------------------------------------
/MyShow/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixOutlaw/UIAnimation/HEAD/MyShow/.DS_Store
--------------------------------------------------------------------------------
/MyShow/Resource/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixOutlaw/UIAnimation/HEAD/MyShow/Resource/1.jpg
--------------------------------------------------------------------------------
/MyShow/Classes/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixOutlaw/UIAnimation/HEAD/MyShow/Classes/.DS_Store
--------------------------------------------------------------------------------
/MyShow/Classes/Home/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixOutlaw/UIAnimation/HEAD/MyShow/Classes/Home/.DS_Store
--------------------------------------------------------------------------------
/MyShow/Resource/pointer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixOutlaw/UIAnimation/HEAD/MyShow/Resource/pointer.png
--------------------------------------------------------------------------------
/MyShow/Classes/Home/View/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixOutlaw/UIAnimation/HEAD/MyShow/Classes/Home/View/.DS_Store
--------------------------------------------------------------------------------
/MyShow.xcodeproj/xcuserdata/zjh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/MyShow.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MyShow.xcodeproj/project.xcworkspace/xcuserdata/zjh.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixOutlaw/UIAnimation/HEAD/MyShow.xcodeproj/project.xcworkspace/xcuserdata/zjh.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/MyShow.xcodeproj/project.xcworkspace/xcuserdata/jianhuazhang.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matrixOutlaw/UIAnimation/HEAD/MyShow.xcodeproj/project.xcworkspace/xcuserdata/jianhuazhang.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/MyShow/Classes/Home/AboutMe/Zhangjh.m:
--------------------------------------------------------------------------------
1 | //
2 | // zhangjh.m
3 | // MyShow
4 | //
5 | // Created by jianhua zhang on 2018/2/23.
6 | // Copyright © 2018年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "Zhangjh.h"
10 |
11 | @implementation Zhangjh
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/MyShow/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 17/4/20.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/Controller/JHHomeViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // JHHomeViewController.h
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 2017/10/24.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface JHHomeViewController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/MyShow/Classes/Configs/PrefixHeader.pch:
--------------------------------------------------------------------------------
1 | //
2 | // PrefixHeader.pch
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 2017/10/24.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #ifndef PrefixHeader_pch
10 | #define PrefixHeader_pch
11 |
12 | #import "DefineConstant.h"
13 |
14 | #endif /* PrefixHeader_pch */
15 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/AboutMe/AboutMeViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // AboutMeViewController.h
3 | // MyShow
4 | //
5 | // Created by jianhua zhang on 2018/2/23.
6 | // Copyright © 2018年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface AboutMeViewController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/BlueTooth/BlueToothViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // BlueToothViewController.h
3 | // MyShow
4 | //
5 | // Created by jianhua zhang on 2018/3/30.
6 | // Copyright © 2018年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface BlueToothViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/Turntable/TurntableViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // TurntableViewController.h
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 2017/10/24.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface TurntableViewController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/MyShow/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 17/4/20.
6 | // Copyright © 2017年 花落永恒. 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 |
--------------------------------------------------------------------------------
/MyShow/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 17/4/20.
6 | // Copyright © 2017年 花落永恒. 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 |
--------------------------------------------------------------------------------
/MyShow.xcodeproj/xcuserdata/jianhuazhang.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MyShow.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/BlueTooth/BluetoothEncryption.h:
--------------------------------------------------------------------------------
1 | //
2 | // BluetoothEncryption.h
3 | // ElectromBike
4 | //
5 | // Created by jianhua zhang on 2018/3/29.
6 | // Copyright © 2018年 jianhua zhang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //上行
12 | #define upLoad @"011102"
13 | //下行
14 | #define downLoad @"A1B102"
15 |
16 | @interface BluetoothEncryption : NSObject
17 |
18 | // 将命令转换成字节数组
19 | + (NSData *)agreementWithString:(NSString *)order;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/AboutMe/Zhangjh.h:
--------------------------------------------------------------------------------
1 | //
2 | // zhangjh.h
3 | // MyShow
4 | //
5 | // Created by jianhua zhang on 2018/2/23.
6 | // Copyright © 2018年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface Zhangjh : NSObject
12 |
13 | @property (strong, nonatomic) NSString *name;
14 | @property (strong, nonatomic) NSString *gender;
15 | @property (strong, nonatomic) NSString *E_mail;
16 | @property (strong, nonatomic) NSString *mobile;
17 | @property (strong, nonatomic) NSString *adress;
18 | @property (strong, nonatomic) NSString *birthday;
19 | @property (strong, nonatomic) NSString *censusRegister;
20 | @property (strong, nonatomic) NSString *workExperience;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/BlueTooth/BluetoothEncryption.m:
--------------------------------------------------------------------------------
1 | //
2 | // BluetoothEncryption.m
3 | // ElectromBike
4 | //
5 | // Created by jianhua zhang on 2018/3/29.
6 | // Copyright © 2018年 jianhua zhang. All rights reserved.
7 | //
8 |
9 | #import "BluetoothEncryption.h"
10 | #import "YMBlueToothTool.h"
11 |
12 | @implementation BluetoothEncryption
13 |
14 | + (NSData *)agreementWithString:(NSString *)order{
15 |
16 | NSString *str1 = [order substringWithRange:NSMakeRange(6, order.length-6)];
17 | //完整指令
18 | NSString *stt = [order stringByAppendingString:[YMBlueToothTool stringToVerify:str1]];
19 | //转换成data
20 | NSData *data1 = [YMBlueToothTool hexToBytes:stt];
21 |
22 | return data1;
23 | }
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/MyShowTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/MyShowUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/MyShow.xcodeproj/xcuserdata/zjh.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MyShow.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 24FE17DD1EA88068006759D9
16 |
17 | primary
18 |
19 |
20 | 24FE17F61EA88069006759D9
21 |
22 | primary
23 |
24 |
25 | 24FE18011EA88069006759D9
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/Turntable/TurntableView/TurntableView.h:
--------------------------------------------------------------------------------
1 | //
2 | // TurntableView.h
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 2017/10/24.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef enum : NSUInteger {
12 | TurntablePointerRight,//default.指针在右
13 | TurntablePointerTop,
14 | TurntablePointerLeft,
15 | TurntablePointerBottom
16 | } TurntablePointer;
17 |
18 | @protocol TurntableViewDelegate
19 |
20 | - (void)rotationDidEnd:(NSString *)index;//选中区域
21 |
22 | @end
23 |
24 | @interface TurntableView : UIView
25 |
26 | //所有的描述
27 | @property (nonatomic, strong) NSArray *titles;
28 | //指针位置
29 | @property (nonatomic, assign) TurntablePointer turntablePointerStyle;
30 |
31 | @property (nonatomic, strong) id delegate;
32 |
33 | @property (nonatomic, assign) float index;
34 |
35 | //开始旋转转盘
36 | - (void)startRotate;
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/AboutMe/AboutMeViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // AboutMeViewController.m
3 | // MyShow
4 | //
5 | // Created by jianhua zhang on 2018/2/23.
6 | // Copyright © 2018年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "AboutMeViewController.h"
10 | #import "Zhangjh.h"
11 |
12 | @interface AboutMeViewController ()
13 |
14 | @property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
15 |
16 | @property (strong, nonatomic) Zhangjh *mySelf;
17 |
18 | @end
19 |
20 | @implementation AboutMeViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 | _mySelf.name = @"张剑华";
25 | _mySelf.gender = @"男";
26 | _mySelf.workExperience = @"2015.7-2018年";
27 | _mySelf.birthday = @"1993-6-25";
28 | _mySelf.mobile = @"18557517018";
29 | _mySelf.E_mail = @"zhangjianhua0625@163.com";
30 | _mySelf.adress = @"杭州-西湖区";
31 | _mySelf.censusRegister = @"福建-莆田";
32 |
33 | }
34 | - (void)didReceiveMemoryWarning {
35 | [super didReceiveMemoryWarning];
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/MyShowTests/MyShowTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // MyShowTests.m
3 | // MyShowTests
4 | //
5 | // Created by 花落永恒 on 17/4/20.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MyShowTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation MyShowTests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 | // Put setup code here. This method is called before the invocation of each test method in the class.
20 | }
21 |
22 | - (void)tearDown {
23 | // Put teardown code here. This method is called after the invocation of each test method in the class.
24 | [super tearDown];
25 | }
26 |
27 | - (void)testExample {
28 | // This is an example of a functional test case.
29 | // Use XCTAssert and related functions to verify your tests produce the correct results.
30 | }
31 |
32 | - (void)testPerformanceExample {
33 | // This is an example of a performance test case.
34 | [self measureBlock:^{
35 | // Put the code you want to measure the time of here.
36 | }];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/MyShow/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/MyShow/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1.0
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/MyShow/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 17/4/20.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "JHHomeViewController.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 |
19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20 | NSLog(@"划落永恒");
21 |
22 | JHHomeViewController *vc = [[JHHomeViewController alloc] init];
23 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
24 | self.window.rootViewController = nav;
25 | [self.window makeKeyAndVisible];
26 |
27 | return YES;
28 | }
29 | - (void)applicationWillResignActive:(UIApplication *)application {
30 |
31 | }
32 | - (void)applicationDidEnterBackground:(UIApplication *)application {
33 |
34 | }
35 | - (void)applicationWillEnterForeground:(UIApplication *)application {
36 |
37 | }
38 | - (void)applicationDidBecomeActive:(UIApplication *)application {
39 |
40 | }
41 | - (void)applicationWillTerminate:(UIApplication *)application {
42 |
43 | }
44 |
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/MyShow/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 17/4/20.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @property (nonatomic, strong) NSArray *listArray;
14 |
15 | @end
16 |
17 | @implementation ViewController
18 |
19 | - (void)viewDidLoad {
20 | [super viewDidLoad];
21 | self.listArray = @[@"转盘"];
22 | }
23 | #pragma mark delegate & datasource
24 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
25 | return 1;
26 | }
27 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
28 | return self.listArray.count;
29 | }
30 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
31 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
32 | if (!cell) {
33 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
34 | }
35 | cell.textLabel.text = [self.listArray objectAtIndex:indexPath.row];
36 | return cell;
37 | }
38 | - (void)didReceiveMemoryWarning {
39 | [super didReceiveMemoryWarning];
40 | }
41 |
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/MyShowUITests/MyShowUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // MyShowUITests.m
3 | // MyShowUITests
4 | //
5 | // Created by 花落永恒 on 17/4/20.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MyShowUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation MyShowUITests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 |
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 |
22 | // In UI tests it is usually best to stop immediately when a failure occurs.
23 | self.continueAfterFailure = NO;
24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
25 | [[[XCUIApplication alloc] init] launch];
26 |
27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
28 | }
29 |
30 | - (void)tearDown {
31 | // Put teardown code here. This method is called after the invocation of each test method in the class.
32 | [super tearDown];
33 | }
34 |
35 | - (void)testExample {
36 | // Use recording to get started writing UI tests.
37 | // Use XCTAssert and related functions to verify your tests produce the correct results.
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/BlueTooth/BlueToothViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // BlueToothViewController.m
3 | // MyShow
4 | //
5 | // Created by jianhua zhang on 2018/3/30.
6 | // Copyright © 2018年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "BlueToothViewController.h"
10 | #import "ZBlueToothTools.h"
11 |
12 | @interface BlueToothViewController ()
13 |
14 | @property (nonatomic, strong) ZBlueToothTools *blueTools;
15 |
16 | @end
17 |
18 | @implementation BlueToothViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 | // Do any additional setup after loading the view from its nib.
23 |
24 | self.blueTools = [[ZBlueToothTools alloc] init];
25 | self.blueTools.delegate = self;
26 |
27 | //连接mac地址为 78a50457f38b|| 78:a5:04:57:f3:8b 蓝牙
28 | [self.blueTools connectBlueToothWithMACAdress:@"78a50457f38b"];
29 | }
30 | - (void)blueToothConnectDeviceStated:(BlueToothState)state{
31 | if(state == BlueToothStateNotify){
32 | //获取蓝牙特征值后发送指令
33 | [self.blueTools sendValue:@"a1b10203ec000402010100010106" AndBlock:nil];
34 | }
35 | }
36 | - (void)blueToothWriteStatus:(BOOL)isSuccess{
37 | NSLog(@"writeIsSuccess=%d",isSuccess);
38 | }
39 |
40 | - (void)didReceiveMemoryWarning {
41 | [super didReceiveMemoryWarning];
42 | // Dispose of any resources that can be recreated.
43 | }
44 |
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/MyShow/Classes/Base/BaseViewController/BaseViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.h
3 | // DoctorApp
4 | //
5 | // Created by on 16/7/23.
6 | // Copyright © 2016年 . All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 |
13 | @interface BaseViewController : UIViewController
14 |
15 | /**
16 | * 右边按钮
17 | */
18 | @property (nonatomic,strong)UIBarButtonItem* rightButtonItem;
19 |
20 | /**
21 | * 右边按钮
22 | *
23 | * @param nonatomic
24 | * @param strong
25 | *
26 | * @return
27 | */
28 | @property (nonatomic,strong)UIButton *rightButton;
29 |
30 | /**
31 | * 导航栏返回按钮
32 | */
33 | @property (nonatomic, strong) UIButton * backButton;
34 | /**
35 | * push到下个控制器
36 | *
37 | * @param viewController
38 | */
39 | - (void)pushViewController:(UIViewController*)viewController animated:(BOOL)animated;
40 | /**
41 | * 返回
42 | */
43 | - (void)backAction;
44 | /**
45 | * 销毁
46 | */
47 | - (void)dismissViewControllerAnimated;
48 | /**
49 | * 直接返回到上个界面
50 | * @return
51 | */
52 | - (void)popViewControllerAnimated:(BOOL)animated;
53 |
54 | /**
55 | * 返回到指定界面
56 | * @param viewController
57 | * @param animated
58 | */
59 | - (void)popToViewControllerAnimated:(UIViewController*)viewController animated:(BOOL)animated;
60 |
61 | /**
62 | * 右边按钮事件
63 | */
64 | - (void)rightItemAction;
65 |
66 | - (void)showLoginViewController;
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/AlertController/ZJHAlertViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZJHAlertViewController.h
3 | // MyShow
4 | //
5 | // Created by jianhua zhang on 2018/3/27.
6 | // Copyright © 2018年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef enum : NSUInteger {
12 | ZJHAlertStyleDefault,//默认
13 | ZJHAlertStyleCommon,//普通弹窗
14 | } ZJHAlertStyle;
15 |
16 | typedef enum : NSUInteger {
17 | ZJHAlertShowStyleDefault,//默认
18 | } ZJHAlertShowStyle;
19 |
20 | typedef void(^ZJHAlertBlock)(NSInteger selectIndex);
21 |
22 |
23 | @protocol ZJHAlertViewControllerDelegate
24 |
25 | @end
26 |
27 | @interface ZJHAlertViewController : UIViewController
28 |
29 | @property (nonatomic, strong) UIView *bgView;
30 |
31 | @property (nonatomic, strong) UILabel *titleView;
32 |
33 | @property (nonatomic, strong) UILabel *messageView;
34 |
35 | @property (assign, nonatomic) ZJHAlertStyle zAlertStyle;
36 |
37 | @property (copy, nonatomic) ZJHAlertBlock selectBlock;
38 | /** ZJHAlertViewControllerDelegate
39 | */
40 | @property (strong, nonatomic) id delegate;
41 |
42 | /*
43 | * @brief init
44 | * @params style title message button
45 | */
46 | - (instancetype)initWithAlertStyle:(ZJHAlertStyle)alertStyle Title:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles clickBlock:(ZJHAlertBlock)selectBlock;
47 |
48 | - (void)alertShowWithStyle:(ZJHAlertShowStyle)alertStyle;
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/BlueTooth/BlueToothViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/AlertController/ZJHAlertViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZJHAlertViewController.m
3 | // MyShow
4 | //
5 | // Created by jianhua zhang on 2018/3/27.
6 | // Copyright © 2018年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "ZJHAlertViewController.h"
10 |
11 | @interface ZJHAlertViewController ()
12 |
13 | @property (strong, nonatomic) NSString *title;
14 | @property (strong, nonatomic) NSString *message;
15 | @property (strong, nonatomic) NSString *cancelButtonTitle;
16 | @property (strong, nonatomic) NSArray *otherButtonTitles;
17 | @property (strong, nonatomic) NSMutableArray *otherButtons;
18 |
19 | @end
20 |
21 | @implementation ZJHAlertViewController
22 |
23 | - (UIModalPresentationStyle)modalPresentationStyle{
24 | return UIModalPresentationOverFullScreen;
25 | }
26 | - (UIModalTransitionStyle)modalTransitionStyle{
27 | return UIModalTransitionStyleCrossDissolve;
28 | }
29 | - (instancetype)initWithAlertStyle:(ZJHAlertStyle)alertStyle Title:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles clickBlock:(ZJHAlertBlock)selectBlock{
30 | self = [super init];
31 | if (self) {
32 | self.title = title;
33 | self.message = message;
34 | self.cancelButtonTitle = cancelButtonTitle;
35 | self.otherButtonTitles = otherButtonTitles;
36 | self.zAlertStyle = alertStyle;
37 | self.selectBlock = selectBlock;
38 | }
39 | return self;
40 | }
41 | - (void)alertShowWithStyle:(ZJHAlertShowStyle)alertStyle{
42 |
43 | }
44 | - (void)viewDidLoad {
45 | [super viewDidLoad];
46 |
47 | }
48 | - (void)didReceiveMemoryWarning {
49 | [super didReceiveMemoryWarning];
50 |
51 | }
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/MyShow.xcodeproj/xcuserdata/jianhuazhang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
20 |
21 |
22 |
24 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/MyShow/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 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/Turntable/TurntableViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // TurntableViewController.m
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 2017/10/24.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "TurntableViewController.h"
10 | #import "TurntableView.h"
11 |
12 | @interface TurntableViewController ()
13 |
14 | @property (weak, nonatomic) IBOutlet TurntableView *turntableView;
15 | @property (weak, nonatomic) IBOutlet UILabel *lotteryLB;
16 | @property (weak, nonatomic) IBOutlet UITextField *titlesTF;
17 | @property (nonatomic, strong) NSMutableArray *titlesArray;
18 |
19 | @end
20 |
21 | @implementation TurntableViewController
22 |
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 | // @[@"好吃不如饺子",@"乐速",@"沙县小吃",@"筒骨饭",@"牛肉粉",@"肉蟹煲",@"撸串",@"烧烤",@"火锅",@"一点点"]
26 | self.titlesArray = [NSMutableArray arrayWithArray:@[@"撸串",@"烧烤",@"自助烧烤",@"自助火锅",@"麻辣香锅",@"熔鱼"]];
27 | self.titlesTF.text = [self.titlesArray componentsJoinedByString:@","];
28 | self.turntableView.titles = self.titlesArray.mutableCopy;
29 | self.turntableView.turntablePointerStyle = TurntablePointerTop;
30 | self.turntableView.delegate = self;
31 | }
32 | - (IBAction)changeAction:(UITextField *)sender {
33 | NSString *str = sender.text;
34 | NSRange range = [str rangeOfString:@","];
35 | if (range.location != NSNotFound) {
36 | sender.text = [str stringByReplacingOccurrencesOfString:@"," withString:@","];
37 | }
38 | self.titlesArray = [NSMutableArray arrayWithArray:[sender.text componentsSeparatedByString:@","]];
39 | self.turntableView.titles = self.titlesArray.mutableCopy;
40 | }
41 | - (IBAction)startRotateAction:(id)sender {
42 | }
43 | - (void)rotationDidEnd:(NSString *)index{
44 | self.lotteryLB.text = [self.turntableView.titles objectAtIndex:index.integerValue];
45 | }
46 |
47 | - (void)didReceiveMemoryWarning {
48 | [super didReceiveMemoryWarning];
49 | }
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/MyShow/Classes/Base/base/DefineConstant.h:
--------------------------------------------------------------------------------
1 | //
2 | // DefineConstant.h
3 | // OneHome
4 | //
5 | // Created by 郭强 on 16/4/7.
6 | // Copyright © 2016年 guoqiang. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 |
13 | @interface DefineConstant : NSObject
14 |
15 | /**
16 | * 从字典里获取字符串对象
17 | *
18 | * @param dic 字典
19 | * @param key 需要获取值的Key
20 | *
21 | * @return 返回一个字符对象
22 | */
23 | extern NSString* EncodeStringFromDic(NSDictionary *dic, NSString *key);
24 |
25 | /**
26 | * 从字典里获取字符串非空对象
27 | *
28 | * @param dic 字典
29 | * @param key 需要获取值的Key
30 | *
31 | * @return 返回一个字符对象
32 | */
33 | extern NSString* EncodeNoNilStringFromDic(NSDictionary *dic, NSString *key);
34 |
35 | /**
36 | * 从字典里获取NSNumber对象
37 | *
38 | * @param dic 字典
39 | * @param key 需要获取值的Key
40 | *
41 | * @return 返回一个NSNumber对象
42 | */
43 | extern NSNumber* EncodeNumberFromDic(NSDictionary *dic, NSString *key);
44 | /**
45 | * 从字典里获取字典对象
46 | *
47 | * @param dic 字典
48 | * @param key 需要获取值的Key
49 | *
50 | * @return 返回一个NSDictionary对象
51 | */
52 | extern NSDictionary *EncodeDicFromDic(NSDictionary *dic, NSString *key);
53 | /**
54 | * 从字典里获取数组对象
55 | *
56 | * @param dic 字典
57 | * @param key 需要获取值的Key
58 | *
59 | * @return 返回一个NSArray对象
60 | */
61 | extern NSArray *EncodeArrayFromDic(NSDictionary *dic, NSString *key);
62 |
63 |
64 | //extern CGFloat getStringHeight:(NSString*)text withLineSpacing:(NSInteger)spacing withFont:(CGFloat)font withWidht:(CGFloat)width;
65 |
66 |
67 | /**
68 | * 计算一串文字的高度
69 | *
70 | * @param text 字符串
71 | * @param lineSpacing 行距
72 | * @param font 字体大小
73 | * @param width 宽度
74 | *
75 | * @return
76 | */
77 | extern CGFloat GetStringHeight(NSString* text,NSInteger lineSpacing,CGFloat font,CGFloat width);
78 |
79 | /**
80 | * 获取时间戳
81 | */
82 | extern NSString *GetTimestamp();
83 | /**
84 | * 加密
85 | */
86 | extern NSString * MD5String(NSString* str);
87 |
88 | /**
89 | * 校验身份证号码
90 | */
91 | extern BOOL ValidateIDCardNumber(NSString* value);
92 |
93 | /**
94 | * 根据城市id 获取区域数据
95 | */
96 | extern NSArray* getAreaList(NSString*city_id);
97 |
98 | /**
99 | * 获取省数据
100 | */
101 | extern NSArray* getProvinceList();
102 |
103 | /**
104 | * 获市数据
105 | */
106 | extern NSArray* getCityList(NSString* provinceId);
107 |
108 |
109 | /**
110 | * 获市城市ID
111 | */
112 | NSString* getCityIdByName(NSString* name);
113 |
114 | /**
115 | * 获市地区ID
116 | */
117 | NSString* getAreaIdByName(NSString *cityId,NSString* name);
118 |
119 | @end
120 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/BlueTooth/YMBlueToothTool.h:
--------------------------------------------------------------------------------
1 | //
2 | // YMBlueToothTool.h
3 | //
4 | // Created by iOS on 2017/7/19.
5 | // Copyright © 2017年 qixiangnet. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface YMBlueToothTool : NSObject
11 |
12 | #pragma mark - 进制转换
13 |
14 | /**
15 | * short整数转换为2字节的byte数组
16 | *
17 | * @param s short整数
18 | * @return byte数组
19 | */
20 | + (Byte)intToByte2:(NSInteger)s;
21 |
22 | /**
23 | * int整数转换为1字节的byte数组
24 | *
25 | * @param -b整数
26 | * @return byte数组
27 | */
28 | + (Byte)intToByte1:(NSInteger)n;
29 |
30 | /**
31 | 十六进制 String 转 Data(bytes)
32 |
33 | @param string 十六进制 String
34 | @return Data(bytes)
35 | */
36 | + (NSData *)hexToBytes:(NSString *)string;
37 |
38 | /**
39 | Data(bytes) 转 十六进制 String
40 |
41 | @param data Data(bytes)
42 | @return 十六进制 String
43 | */
44 | + (NSString *)dataChangeToString:(NSData *)data;
45 |
46 | /**
47 | 十六进制转十进制
48 |
49 | @param hex 十六进制
50 | @return 十进制
51 | */
52 | + (NSString *)toTen:(NSString *)hex;
53 |
54 | /**
55 | 十进制转十六进制
56 |
57 | @param tmpid 十进制 int
58 | @return 十六进制
59 | */
60 | + (NSString *)toHex:(long long int)tmpid;
61 |
62 | /**
63 | 大小端数据转换
64 |
65 | @param data data
66 | @return data
67 | */
68 | + (NSData *)dataTransfromBigOrSmall:(NSData *)data;
69 |
70 | #pragma mark - 补位
71 |
72 | /**
73 | 补位
74 |
75 | @param addString 占位字符串
76 | @param length 总长度
77 | @param string 需补位的字符串
78 | @return 补位后的字符串
79 | */
80 | + (NSString *)addString:(NSString *)addString Length:(NSInteger)length OnString:(NSString *)string;
81 |
82 | #pragma mark - 获取时间大端表示
83 |
84 | /**
85 | 获取时间大端表示
86 |
87 | @param number 时间戳
88 | @param length 总长度
89 | @return 大端表示的时间
90 | */
91 | + (NSString *)intToHexString:(NSInteger)number length:(NSInteger)length;
92 |
93 | #pragma mark - 校验和
94 |
95 | /**
96 | 算出校验和
97 | @param string 十六进制字符串
98 | @return 校验和
99 | */
100 | + (NSString *)xorWithHex:(NSString *)string;
101 |
102 | #pragma mark - 分包
103 |
104 | /**
105 | 分包
106 | @param write 需要输入的字符串
107 | @return 分包数组
108 | */
109 | + (NSMutableArray *)arrayToWrite:(NSString *)write;
110 |
111 | /*
112 | * @brief 10进制转进制 按字节个数补位(每个字节占2位)
113 | * @param decimalism 十进制数字
114 | * @param addStr 添加的地址
115 | * @return 十六进制
116 | */
117 | + (NSString *)toHexByString:(NSInteger)decimalism AndByteCount:(NSInteger)count ByAddString:(NSString *)addStr;
118 | /*
119 | * @brief 10进制转进制 按字节个数补位(每个字节占2位)
120 | * @param decimalism 十进制数字
121 | * @return 十六进制
122 | */
123 | + (NSString *)toHexByString:(NSInteger)decimalism AndByteCount:(NSInteger)count;
124 | /*
125 | * @brief 校验和
126 | * @param verify输入字符串
127 | * @return 校验码
128 | */
129 | + (NSString *)stringToVerify:(NSString *)verify;
130 | /*
131 | * @brief 字节数组长度
132 | * @return 校验码
133 | */
134 | + (NSInteger)byteLengthWithString:(NSData *)byteData;
135 |
136 | @end
137 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/BlueTooth/ZBlueToothTools.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZBlueToothTools.h
3 | // ElectromBike
4 | //
5 | // Created by jianhua zhang on 2018/3/29.
6 | // Copyright © 2018年 jianhua zhang. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | #define BBLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])
13 | #define outTimes 10
14 | // 蓝牙特征值
15 | static CBCharacteristic *characteristicInstance = nil;
16 |
17 | //蓝牙状态
18 | typedef enum : NSUInteger {
19 | BlueToothStateUnknown, //0.无法识别蓝牙
20 | BlueToothStateResetting, //1.蓝牙重置
21 | BlueToothStateUnsupported, //2.不支持蓝牙
22 | BlueToothStateUnauthorized, //3.未授权
23 | BlueToothStatePoweredOff, //4.蓝牙未开启
24 | BlueToothStatePoweredOn, //5.蓝牙已开启
25 | BlueToothStateConnectSuccess, //6.蓝牙连接成功
26 | BlueToothStateNotify, //7.订阅消息 蓝牙特征值 characteristicInstance
27 | BlueToothStateConnectFail, //7.蓝牙连接失败
28 | BlueToothStateDisConnect, //8.蓝牙连接断开
29 | } BlueToothState;
30 |
31 | /*
32 | * 蓝牙读写Block
33 | */
34 | typedef void(^BlueToothWriteBlock)(BOOL writeSuccess);
35 |
36 | // delegate
37 | @protocol ZBlueToothToolsDelegate
38 |
39 | @optional
40 | /*
41 | * @param state 蓝牙状态
42 | */
43 | - (void)blueToothConnectDeviceStated:(BlueToothState)state;
44 |
45 | /*
46 | * @param state 读写状态
47 | */
48 | - (void)blueToothWriteStatus:(BOOL)isSuccess;
49 |
50 | @end
51 |
52 | // 简易蓝牙工具,读写数据等
53 | @interface ZBlueToothTools : NSObject
54 |
55 | // 蓝牙实例
56 | @property (nonatomic, strong) CBCentralManager *cMgr;
57 | // 已连接到的外设
58 | @property (nonatomic, strong) CBPeripheral *peripheral;
59 |
60 | // 附近可连接的外设列表(暂不可使用)
61 | @property (nonatomic, strong) NSMutableArray *peripherals;
62 |
63 | // 蓝牙当前连接状态
64 | @property (nonatomic, assign) BlueToothState blueToothState;
65 |
66 | // 外设返回的数据
67 | @property (nonatomic, strong) NSDictionary *advertisementData;
68 |
69 | // 需要连接的外设mac地址
70 | @property (nonatomic, strong) NSString *macAdress;
71 |
72 | // 蓝牙相应数据
73 | @property (nonatomic, strong) NSString *responseStr;
74 |
75 | @property (nonatomic, strong) NSString *responseHeadStr;
76 |
77 | // delegate
78 | @property (nonatomic, assign) id delegate;
79 |
80 | // Block
81 | @property (nonatomic, strong) BlueToothWriteBlock writeBlock;
82 |
83 | /*
84 | * @brief 连接蓝牙
85 | */
86 | - (void)connectBlueToothWithMACAdress:(NSString *)macAdress;
87 |
88 | /*
89 | * @brief 重连蓝牙
90 | */
91 | - (void)reConnectBlueTooth;
92 |
93 | /*
94 | * @brief 关闭蓝牙
95 | */
96 | - (void)closeConnectBlueTooth;
97 |
98 | /*
99 | * @brief 发送指令
100 | * @param value 指令
101 | * @param characteristic
102 | */
103 | - (void)sendValue:(NSString *)value AndBlock:(BlueToothWriteBlock)writeBlock;
104 |
105 | @end
106 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/Controller/JHHomeViewController.xib:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/Controller/JHHomeViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // JHHomeViewController.m
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 2017/10/24.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "JHHomeViewController.h"
10 | #import "TurntableViewController.h"
11 | #import "BlueToothViewController.h"
12 |
13 | @interface JHHomeViewController ()
14 |
15 | @property (nonatomic, strong) NSArray *titles;
16 | @property (nonatomic, strong) NSArray *classNames;
17 |
18 | @end
19 |
20 | @implementation JHHomeViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 | self.titles = @[@"转盘",@"蓝牙"];
25 | self.classNames = @[@"TurntableViewController",@"BlueToothViewController"];
26 | }
27 | #pragma mark delegate & datasource
28 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
29 |
30 | [tableView deselectRowAtIndexPath:indexPath animated:YES];
31 |
32 | NSString *className = self.classNames[indexPath.row];
33 |
34 | // 注意: 如果是sb来搭建, 必须以 _UIStoryboard 结尾
35 | NSUInteger classNameLength = className.length;
36 | NSUInteger storyBoardLength = @"_UIStoryboard".length;
37 | NSUInteger xibLength = @"_xib".length;
38 |
39 | NSString *suffixClassName;
40 | if (classNameLength > storyBoardLength) {
41 | suffixClassName = [className substringFromIndex:classNameLength - storyBoardLength];
42 | }
43 |
44 | if ([suffixClassName isEqualToString:@"_UIStoryboard"]) {
45 |
46 | className = [className substringToIndex:classNameLength - storyBoardLength];
47 |
48 | if ([className isEqualToString:@"RZSimpleViewController"]) { // 自定义push动画
49 |
50 | }else {
51 |
52 | // 注意: 这个storyboard的名字必须是控制器的名字
53 | UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:className bundle:nil];
54 | UIViewController *cardVC = [storyBoard instantiateInitialViewController];
55 | if (!cardVC) {
56 | cardVC = [storyBoard instantiateViewControllerWithIdentifier:className];
57 | }
58 | cardVC.title = self.titles[indexPath.row];
59 | [self.navigationController pushViewController:cardVC animated:YES ];
60 | }
61 |
62 | }else if ([[className substringFromIndex:classNameLength - xibLength] isEqualToString:@"_xib"]) {
63 |
64 | className = [className substringToIndex:classNameLength - xibLength];
65 |
66 | UIViewController *vc = [[NSClassFromString(className) alloc]initWithNibName:className bundle:nil];
67 | vc.title = self.titles[indexPath.row];
68 | [self.navigationController pushViewController:vc animated:YES];
69 |
70 | }else {
71 | NSLog(@"className = %@", className);
72 | UIViewController *vc = [[NSClassFromString(className) alloc] init];
73 | vc.title = self.titles[indexPath.row];
74 | [self.navigationController pushViewController:vc animated:YES];
75 | }
76 | }
77 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
78 | return 1;
79 | }
80 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
81 | return self.titles.count;
82 | }
83 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
84 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
85 | if (!cell) {
86 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
87 | }
88 | cell.textLabel.text = [self.titles objectAtIndex:indexPath.row];
89 | return cell;
90 | }
91 |
92 | - (void)didReceiveMemoryWarning {
93 | [super didReceiveMemoryWarning];
94 | // Dispose of any resources that can be recreated.
95 | }
96 |
97 |
98 | @end
99 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/AboutMe/AboutMeViewController.xib:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/MyShow.xcodeproj/xcuserdata/zjh.xcuserdatad/xcschemes/MyShow.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/MyShow/Base.lproj/LaunchScreen.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 |
27 |
28 |
29 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/Turntable/TurntableViewController.xib:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/MyShow/Classes/Base/BaseViewController/BaseViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.m
3 | // DoctorApp
4 | //
5 | // Created by 花落永恒 on 16/7/23.
6 | // Copyright © 2016年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | #pragma mark 记录登录次数 以防二次出现
12 | static NSInteger loginCount = 0;
13 |
14 | @interface BaseViewController ()
15 |
16 | /**
17 | * 第一次的push 时间
18 | */
19 | @property(nonatomic,assign)double firstPushTimestamp;
20 | /**
21 | * 第二次push 的时间
22 | */
23 | @property(nonatomic,assign)double secondPushTimestampl;
24 |
25 | @end
26 |
27 | @implementation BaseViewController
28 |
29 | //状态栏字体颜色
30 | - (UIStatusBarStyle)preferredStatusBarStyle {
31 | return UIStatusBarStyleLightContent;
32 | }
33 |
34 | - (void)viewDidLoad {
35 | [super viewDidLoad];
36 | // Do any additional setup after loading the view.
37 |
38 | self.automaticallyAdjustsScrollViewInsets = NO;
39 | UINavigationBar *navigationBar = [[self navigationController] navigationBar];
40 | CGRect frame = [navigationBar frame];
41 | frame.size.height = 44.f;
42 | [navigationBar setFrame:frame];
43 |
44 | self.firstPushTimestamp = 0;
45 | self.secondPushTimestampl = 0;
46 | loginCount = 0;
47 | [self withBackView];
48 |
49 | [self withRightItem];
50 |
51 | self.navigationController.navigationBar.translucent = NO;
52 |
53 | self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
54 | [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17],NSForegroundColorAttributeName:[UIColor whiteColor]}];
55 |
56 | }
57 |
58 |
59 | - (void)viewWillAppear:(BOOL)animated{
60 |
61 | [super viewWillAppear:animated];
62 |
63 | }
64 |
65 | - (void)viewDidAppear:(BOOL)animated{
66 |
67 | [super viewDidAppear:YES];
68 |
69 | }
70 |
71 | - (void)viewDidDisappear:(BOOL)animated{
72 | [super viewDidDisappear:YES];
73 | }
74 |
75 | #pragma mark 弹出登录界面
76 | - (void)popLoginViewController{
77 | if (loginCount >= 1) {
78 | return;
79 | }
80 | loginCount = 1;
81 | [self showLoginViewController];
82 | }
83 |
84 | #pragma mark 弹出无网络提示
85 | - (void)popNoNetWork{
86 |
87 | }
88 |
89 | #pragma mark 返回按钮
90 | - (void)withBackView{
91 |
92 | self.automaticallyAdjustsScrollViewInsets = NO;
93 | [self setEdgesForExtendedLayout:UIRectEdgeNone];
94 |
95 | UIBarButtonItem *flexSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];
96 | flexSpacer.width = -15;
97 | self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
98 | self.backButton.frame =CGRectMake(0, 0, 44, 44);
99 | [self.backButton setImage:[UIImage imageNamed:@"icon_nav_back"] forState:UIControlStateNormal];
100 | [self.backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
101 | UIBarButtonItem* leftItem=[[UIBarButtonItem alloc] initWithCustomView:self.backButton];
102 |
103 | self.navigationItem.leftBarButtonItems = [NSArray arrayWithObjects:flexSpacer, leftItem, nil];
104 | }
105 |
106 | #pragma mark 创建右边Item
107 | - (void)withRightItem{
108 |
109 | self.rightButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
110 |
111 | self.rightButton.titleLabel.font = [UIFont systemFontOfSize:13];
112 | [self.rightButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
113 | [self.rightButton setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
114 | [self.rightButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 10, 0, -10)];
115 | [self.rightButton setImageEdgeInsets:UIEdgeInsetsMake(0, 10, 0, -10)];
116 | [self.rightButton addTarget:self action:@selector(rightItemAction) forControlEvents:UIControlEventTouchUpInside];
117 |
118 | UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:self.rightButton];
119 | self.rightButtonItem = rightItem;
120 |
121 | }
122 |
123 |
124 | #pragma mark 右边按钮
125 | - (void)rightItemAction{
126 |
127 | }
128 |
129 | - (void)backAction{
130 | [self.navigationController popViewControllerAnimated:YES];
131 | }
132 |
133 | - (void)dismissViewControllerAnimated{
134 |
135 | [self.navigationController dismissViewControllerAnimated:YES completion:nil];
136 | }
137 |
138 |
139 | - (void)pushViewController:(UIViewController*)viewController animated:(BOOL)animated{
140 |
141 | NSDate * date = [NSDate date];
142 | if(self.firstPushTimestamp==0){
143 | self.firstPushTimestamp = [date timeIntervalSinceReferenceDate];
144 | }else{
145 | self.secondPushTimestampl = [date timeIntervalSinceReferenceDate];
146 | }
147 | if(self.secondPushTimestampl > 0 ){
148 | double timestampl = self.secondPushTimestampl - self.firstPushTimestamp;
149 | if(timestampl < 3){
150 | return;
151 | }
152 | }
153 | viewController.hidesBottomBarWhenPushed = YES;
154 | [self.navigationController pushViewController:viewController animated:animated];
155 | }
156 | - (void)popViewControllerAnimated:(BOOL)animated{
157 | [self.navigationController popViewControllerAnimated:animated];
158 | }
159 |
160 | - (void)didReceiveMemoryWarning {
161 | [super didReceiveMemoryWarning];
162 | // Dispose of any resources that can be recreated.
163 | }
164 | - (void)dealloc{
165 | self.firstPushTimestamp = 0;
166 | self.secondPushTimestampl = 0;
167 | }
168 | @end
169 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/Turntable/TurntableView/TurntableView.m:
--------------------------------------------------------------------------------
1 | //
2 | // TurntableView.m
3 | // MyShow
4 | //
5 | // Created by 花落永恒 on 2017/10/24.
6 | // Copyright © 2017年 花落永恒. All rights reserved.
7 | //
8 |
9 | #import "TurntableView.h"
10 |
11 | //动画持续时间
12 | static NSInteger animationDuration = 3.0;
13 | //旋转的半圈 数
14 | static NSInteger circle = 6;
15 |
16 | @implementation TurntableView
17 |
18 | //开始旋转转盘
19 | - (void)startRotate{
20 |
21 | self.userInteractionEnabled = NO;
22 |
23 | CABasicAnimation* rotationAnimation;
24 | //随机数 除以个数取余,获得中奖区间
25 | _index = arc4random() % self.titles.count / (float)self.titles.count;
26 | float section = 1.f / self.titles.count;
27 | float value = _index + (arc4random() % 9 + 1) * section / 10;
28 |
29 | NSLog(@"%@",[NSNumber numberWithFloat:value]);
30 | rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
31 | rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.f * (circle * 2 + value)];
32 | rotationAnimation.duration = animationDuration;
33 | rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
34 | rotationAnimation.removedOnCompletion = NO;
35 | rotationAnimation.fillMode = kCAFillModeForwards;
36 | rotationAnimation.delegate = self;
37 | [self.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
38 | }
39 | #pragma mark 动画停止
40 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{
41 |
42 | self.userInteractionEnabled = YES;
43 |
44 | NSLog(@"%@ %@",[NSNumber numberWithFloat:self.titles.count - _index * self.titles.count].stringValue,self.titles[self.titles.count - [NSNumber numberWithFloat:_index * self.titles.count].integerValue - 1]);
45 | if (flag) {
46 | if ([self.delegate respondsToSelector:@selector(rotationDidEnd:)]) {
47 | [self.delegate rotationDidEnd:[NSNumber numberWithInteger:self.titles.count - [NSNumber numberWithFloat:_index * self.titles.count].integerValue - 1].stringValue];
48 | }
49 | }
50 | }
51 | - (void)setTitles:(NSArray *)titles{
52 | _titles = titles;
53 | [self setNeedsDisplay];
54 | }
55 | - (void)setTurntablePointerStyle:(TurntablePointer)turntablePointerStyle{
56 | _turntablePointerStyle = turntablePointerStyle;
57 | [self setNeedsDisplay];
58 | }
59 | - (void)drawRect:(CGRect)rect
60 | {
61 | for (UIView *view in [self subviews]) {
62 | if ([view isKindOfClass:[UILabel class]]) {
63 | [view removeFromSuperview];
64 | }
65 | }
66 | //开始角度
67 | float beginningAngle;
68 | if (self.turntablePointerStyle == TurntablePointerTop) {
69 | beginningAngle = 3.f / 2.f * M_PI;
70 | }else if (self.turntablePointerStyle == TurntablePointerLeft) {
71 | beginningAngle = M_PI;
72 | }else if (self.turntablePointerStyle == TurntablePointerBottom) {
73 | beginningAngle = M_PI_2;
74 | }else{
75 | beginningAngle = 0;
76 | }
77 | //平均角度
78 | float averageAngle = 1 / (float)self.titles.count * 2 * M_PI;
79 | float startAngle = 0;
80 | //半径
81 | float radius = self.frame.size.width / 2 - 1;
82 | //创建扇形区域
83 | for (int i = 0; i < self.titles.count; i ++) {
84 | UIBezierPath *linePath = [UIBezierPath bezierPath];
85 |
86 | startAngle = beginningAngle + (float)i / (float)self.titles.count * 2 * M_PI;
87 | [linePath moveToPoint:CGPointMake(self.frame.size.width/2, self.frame.size.height/2)];
88 | [linePath addArcWithCenter:CGPointMake(self.frame.size.width/2, self.frame.size.height/2) radius:radius startAngle:startAngle endAngle:startAngle + averageAngle clockwise:YES];
89 |
90 | NSInteger index = arc4random() % 255;
91 | float red = (arc4random() - index) / 255.f;
92 | float green = arc4random_uniform(255) / 255.f;
93 | float blue = arc4random_uniform(255) / 255.f;
94 | [[UIColor colorWithRed:red green:green blue:blue alpha:1] set];
95 | [linePath fill];
96 |
97 | [[UIColor whiteColor] set];
98 | [linePath stroke];
99 |
100 | NSString *title = [self.titles objectAtIndex:i];
101 | UILabel *titleLB = [[UILabel alloc] initWithFrame:CGRectMake(radius * (cos(startAngle + averageAngle / 2.f) + 1), radius * (sin(startAngle + averageAngle / 2.f) + 1), 15, radius)];
102 | titleLB.text = title;
103 | titleLB.numberOfLines = 0;
104 | titleLB.backgroundColor = [UIColor clearColor];
105 | titleLB.textColor = [UIColor whiteColor];
106 | titleLB.layer.anchorPoint = CGPointMake(0.5, 1);
107 | titleLB.layer.position = CGPointMake(radius + 1, radius + 1);
108 | titleLB.textAlignment = NSTextAlignmentCenter;
109 | titleLB.adjustsFontSizeToFitWidth = YES;
110 | titleLB.transform = CGAffineTransformMakeRotation(averageAngle / 2.f + i * averageAngle);
111 | [self addSubview:titleLB];
112 |
113 |
114 | }
115 | //添加手势
116 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(startRotate)];
117 | [self addGestureRecognizer:tap];
118 | }
119 | #pragma mark 计算圆圈上点在IOS系统中的坐标
120 | - (CGPoint)calcCircleCoordinateWithCenter:(CGPoint)center angle:(CGFloat)angle radius:(CGFloat)radius
121 | {
122 | CGFloat x2 = radius * cosf(angle * M_PI / 180);
123 | CGFloat y2 = radius * sinf(angle * M_PI / 180);
124 | return CGPointMake(center.x + x2, center.y - y2);
125 | }
126 | - (instancetype)initWithFrame:(CGRect)frame
127 | {
128 | if (self = [super initWithFrame:frame]) {
129 |
130 | }
131 | return self;
132 | }
133 | - (id)initWithCoder:(NSCoder *)aDecoder
134 | {
135 | if (self = [super initWithCoder:aDecoder]) {
136 |
137 | }
138 | return self;
139 | }
140 | - (void)awakeFromNib
141 | {
142 | [super awakeFromNib];
143 | }
144 | @end
145 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/BlueTooth/ZBlueToothTools.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZBlueToothTools.m
3 | // ElectromBike
4 | //
5 | // Created by jianhua zhang on 2018/3/29.
6 | // Copyright © 2018年 jianhua zhang. All rights reserved.
7 | //
8 |
9 | #import "ZBlueToothTools.h"
10 | #import "YMBlueToothTool.h"
11 |
12 | //是否返回数据
13 | static bool returned = NO;
14 |
15 | @interface ZBlueToothTools()
16 |
17 | @property (nonatomic, strong) NSTimer *timer;
18 |
19 | @end
20 |
21 | @implementation ZBlueToothTools
22 |
23 | // 初始化
24 | - (instancetype)init{
25 | self = [super init];
26 | if (self) {
27 | [self cmgr];
28 | }
29 | return self;
30 | }
31 |
32 | #pragma mark -建立一个Central Manager实例
33 | - (CBCentralManager *)cmgr{
34 | if(!_cMgr){
35 | _cMgr = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
36 | }else{
37 | //创建实例的判断是否连接过设备
38 | if(self.peripheral){
39 | [_cMgr cancelPeripheralConnection:self.peripheral];
40 | }
41 | [self centralManagerDidUpdateState:_cMgr];
42 | }
43 | self.peripherals = [NSMutableArray array];
44 | return _cMgr;
45 | }
46 |
47 | - (void)connectBlueToothWithMACAdress:(NSString *)macAdress{
48 | if([macAdress containsString:@":"] || [macAdress containsString:@":"]){
49 | [macAdress stringByReplacingOccurrencesOfString:@":" withString:@""];
50 | [macAdress stringByReplacingOccurrencesOfString:@":" withString:@""];
51 | }
52 | _macAdress = macAdress;
53 | [self.cMgr scanForPeripheralsWithServices:nil options:nil];
54 | }
55 |
56 | - (void)reConnectBlueTooth{
57 | // 蓝牙是否断开连接
58 | if(self.peripheral.state == CBPeripheralStateDisconnecting || self.peripheral.state == CBPeripheralStateDisconnected){
59 | //扫描是否可连接
60 | [self centralManagerDidUpdateState:_cMgr];
61 | }
62 | }
63 |
64 | - (void)closeConnectBlueTooth{
65 | //关闭蓝牙连接
66 | [self.cMgr cancelPeripheralConnection:self.peripheral];
67 | self.peripheral = nil;
68 | }
69 |
70 | - (void)sendValue:(NSString *)value AndBlock:(BlueToothWriteBlock)writeBlock{
71 | self.writeBlock = writeBlock;
72 | returned = NO;
73 | NSData *data = [YMBlueToothTool hexToBytes:value];
74 | NSLog(@"%s,line = %d,writeValue = %@",__FUNCTION__,__LINE__,data);
75 | if(characteristicInstance){
76 | [self.peripheral writeValue:data forCharacteristic:characteristicInstance type:CBCharacteristicWriteWithResponse];
77 | }
78 | [self timerCountDown];
79 | }
80 | static int limitTime = 0;
81 | - (void)timerCountDown{
82 | limitTime = outTimes;
83 | self.timer = [NSTimer scheduledTimerWithTimeInterval:outTimes target:self selector:@selector(timeCutDown) userInfo:nil repeats:YES];
84 | }
85 | - (void)timeCutDown{
86 | limitTime --;
87 | if(limitTime == 0 && !returned){
88 | //写入超时
89 | if(self.writeBlock){
90 | self.writeBlock(NO);
91 | }
92 | if([self.delegate respondsToSelector:@selector(blueToothWriteStatus:)]){
93 | [self.delegate blueToothWriteStatus:NO];
94 | }
95 | [self.timer invalidate];
96 | returned = YES;
97 | }
98 | }
99 | //写入成功
100 | - (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CBCharacteristic *)characteristic error:(nullable NSError *)error {
101 | if([self.delegate respondsToSelector:@selector(blueToothWriteStatus:)]){
102 | [self.delegate blueToothWriteStatus:!error];
103 | }
104 | if(self.writeBlock){
105 | self.writeBlock(!error);
106 | }
107 | NSLog(@"Write state = %d",!error);
108 | }
109 |
110 | #pragma mark -只要中心管理者初始化 就会触发此代理方法 判断手机蓝牙状态
111 | - (void)centralManagerDidUpdateState:(CBCentralManager *)central
112 | {
113 | switch (central.state) {
114 | case 0:
115 | NSLog(@"CBCentralManagerStateUnknown");
116 | break;
117 | case 1:
118 | NSLog(@"CBCentralManagerStateResetting");
119 | break;
120 | case 2:
121 | NSLog(@"CBCentralManagerStateUnsupported");//不支持蓝牙
122 | break;
123 | case 3:
124 | NSLog(@"CBCentralManagerStateUnauthorized");
125 | break;
126 | case 4:
127 | NSLog(@"CBCentralManagerStatePoweredOff");//蓝牙未开启
128 | break;
129 | case 5:{
130 | NSLog(@"CBCentralManagerStatePoweredOn");//蓝牙已开启
131 | if(self.macAdress){
132 | [self.cMgr scanForPeripheralsWithServices:nil // 通过某些服务筛选外设
133 | options:nil]; // dict,条件
134 | }
135 | }
136 | break;
137 | default:
138 | break;
139 | }
140 | [self connectState:(NSInteger)central.state];
141 | }
142 |
143 | #pragma mark - 中心管理者连接外设成功
144 | - (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral
145 | {
146 | NSLog(@"%s, line = %d, %@=连接成功", __FUNCTION__, __LINE__, peripheral.name);
147 | // 连接成功之后,可以进行服务和特征的发现
148 | self.peripheral.delegate = self;
149 | // 外设发现服务,传nil代表不过滤
150 | // 这里会触发外设的代理方法 - (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error
151 | [self.peripheral discoverServices:EncodeArrayFromDic(self.advertisementData, @"kCBAdvDataServiceUUIDs")];
152 | [self connectState:BlueToothStateConnectSuccess];
153 | }
154 |
155 | #pragma mark - 发现外设服务里的特征的时候调用的代理方法(这个是比较重要的方法,你在这里可以通过事先知道UUID找到你需要的特征,订阅特征,或者这里写入数据给特征也可以)
156 | //获取外围设备的服务特征
157 | - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error
158 | {
159 | NSLog(@"%s, line = %d", __FUNCTION__, __LINE__);
160 | for (CBCharacteristic *characteristic in service.characteristics) {
161 | characteristicInstance = characteristic;
162 | [peripheral readValueForCharacteristic:characteristic];
163 | if ([characteristic.UUID isEqual:[CBUUID UUIDWithString:@"FFE1"]]) {
164 | [self.peripheral setNotifyValue:YES forCharacteristic:characteristic];
165 | }
166 | }
167 | [self connectState:BlueToothStateNotify];
168 | }
169 |
170 | #pragma mark - 发现外设后调用的方法
171 | - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
172 | {
173 | if (peripheral.name) {
174 | /*
175 | * 将符合的所有的蓝牙设备都存储到本地 peripherals
176 | */
177 | NSString *ManufacturerData = [YMBlueToothTool dataChangeToString:advertisementData[@"kCBAdvDataManufacturerData"]];
178 | NSLog(@"ManufacturerData:%@,配对Mac:%@,success:%d",ManufacturerData,[[self.macAdress stringByReplacingOccurrencesOfString:@":" withString:@""] lowercaseString],[ManufacturerData hasSuffix:[[self.macAdress stringByReplacingOccurrencesOfString:@":" withString:@""] lowercaseString]]);
179 |
180 | if([self.macAdress stringByReplacingOccurrencesOfString:@":" withString:@""] && [ManufacturerData hasSuffix:[[self.macAdress stringByReplacingOccurrencesOfString:@":" withString:@""] lowercaseString]]){
181 | NSDictionary *data = @{@"peripheral":peripheral,@"advertisementData":advertisementData,@"RSSI":RSSI,};
182 | [self.peripherals addObject:data];
183 | self.peripheral = peripheral;
184 | self.advertisementData = advertisementData;
185 |
186 | NSLog(@"%s, line = %d, 连接设备=%@", __FUNCTION__, __LINE__, peripheral.name);
187 | [self.cMgr connectPeripheral:peripheral options:nil];
188 | [self.cMgr stopScan];
189 | }
190 | }
191 | }
192 |
193 | #pragma mark - 外设连接失败
194 | - (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error
195 | {
196 | NSLog(@"%s, line = %d, %@=连接失败", __FUNCTION__, __LINE__, peripheral.name);
197 | [self connectState:BlueToothStateConnectFail];
198 | }
199 |
200 | #pragma mark - 丢失连接
201 | - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error
202 | {
203 | NSLog(@"%s, line = %d, %@=断开连接", __FUNCTION__, __LINE__, peripheral.name);
204 | [self connectState:BlueToothStateDisConnect];
205 | }
206 | // 连接状态
207 | - (void)connectState:(BlueToothState)state{
208 | NSLog(@"%s, line = %d, 当前状态:%ld", __FUNCTION__, __LINE__,state);
209 | self.blueToothState = state;
210 | if([self.delegate respondsToSelector:@selector(blueToothConnectDeviceStated:)]){
211 | [self.delegate blueToothConnectDeviceStated:state];
212 | }
213 | }
214 | #pragma mark -发现服务
215 | - (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error{
216 | NSLog(@"%s, line = %d", __FUNCTION__, __LINE__);
217 | for (CBService *service in peripheral.services) {
218 | NSLog(@"Discovered service %@", service);
219 | [peripheral discoverCharacteristics:nil forService:service];
220 | }
221 | }
222 |
223 | @end
224 |
--------------------------------------------------------------------------------
/MyShow/Classes/Base/base/DefineConstant.m:
--------------------------------------------------------------------------------
1 | //
2 | // DefineConstant.m
3 | // OneHome
4 | //
5 | // Created by 郭强 on 16/4/7.
6 | // Copyright © 2016年 guoqiang. A· ll rights reserved.
7 | //
8 |
9 | #import "DefineConstant.h"
10 | #import
11 |
12 | @implementation DefineConstant
13 |
14 |
15 | #pragma mark 从字典 获取String///
16 | NSString* EncodeStringFromDic(NSDictionary *dic, NSString *key)
17 | {
18 | @try {
19 | id temp = [dic objectForKey:key];
20 | if ([temp isKindOfClass:[NSString class]])
21 | {
22 | return [NSString stringWithFormat:@"%@",temp];
23 | }
24 | else if ([temp isKindOfClass:[NSNumber class]])
25 | {
26 | return [NSString stringWithFormat:@"%@",[temp stringValue]];
27 | }
28 | }
29 | @catch (NSException *exception) {
30 | return nil;
31 | }
32 | return nil;
33 | }
34 | #pragma mark 从字典 获取String///
35 | NSString* EncodeNoNilStringFromDic(NSDictionary *dic, NSString *key)
36 | {
37 | @try {
38 | id temp = [dic objectForKey:key];
39 | if ([temp isKindOfClass:[NSString class]])
40 | {
41 | return [NSString stringWithFormat:@"%@",temp];
42 | }
43 | else if ([temp isKindOfClass:[NSNumber class]])
44 | {
45 | return [NSString stringWithFormat:@"%@",[temp stringValue]];
46 | }
47 | }
48 | @catch (NSException *exception) {
49 | return @"";
50 | }
51 | return @"";
52 | }
53 |
54 | #pragma mark 从字典 获取Number
55 | NSNumber* EncodeNumberFromDic(NSDictionary *dic, NSString *key)
56 | {
57 |
58 | @try {
59 | id temp = [dic objectForKey:key];
60 | if ([temp isKindOfClass:[NSString class]])
61 | {
62 | return [NSNumber numberWithDouble:[temp doubleValue]];
63 | }
64 | else if ([temp isKindOfClass:[NSNumber class]])
65 | {
66 | return temp;
67 | }
68 | }
69 | @catch (NSException *exception) {
70 | return nil;
71 | }
72 | return nil;
73 | }
74 |
75 | #pragma mark 从字典到字典
76 | NSDictionary *EncodeDicFromDic(NSDictionary *dic, NSString *key)
77 | {
78 | @try {
79 | id temp = [dic objectForKey:key];
80 | if ([temp isKindOfClass:[NSDictionary class]])
81 | {
82 | return temp;
83 | }
84 | }
85 | @catch (NSException *exception) {
86 | return nil;
87 | }
88 | return nil;
89 | }
90 | #pragma mark 从字典到数组
91 | NSArray *EncodeArrayFromDic(NSDictionary *dic, NSString *key)
92 | {
93 | @try {
94 | id temp = [dic objectForKey:key];
95 | if ([temp isKindOfClass:[NSArray class]])
96 | {
97 | return temp;
98 | }
99 | }
100 | @catch (NSException *exception) {
101 | return nil;
102 | }
103 | return nil;
104 | }
105 |
106 |
107 | #pragma mark 计算文字度高度
108 | CGFloat GetStringHeight(NSString* text,NSInteger lineSpacing,CGFloat font,CGFloat width){
109 |
110 | NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
111 | paraStyle.lineBreakMode = NSLineBreakByCharWrapping;
112 | paraStyle.lineSpacing = lineSpacing;
113 | NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:font], NSParagraphStyleAttributeName:paraStyle, NSKernAttributeName:@1.5};
114 |
115 | return [text boundingRectWithSize:CGSizeMake(width, 1000) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:dic context:nil].size.height;
116 |
117 | }
118 |
119 |
120 | NSString *GetTimestamp(){
121 |
122 | NSDate * date = [NSDate date];
123 | NSString * timestamp = [NSString stringWithFormat:@"%ld", (long)[date timeIntervalSince1970]];
124 |
125 | return timestamp;
126 | }
127 |
128 | #pragma mark md5 加密
129 | NSString * MD5String(NSString* str){
130 |
131 | const char * original_str = [str UTF8String];
132 | unsigned char result[CC_MD5_DIGEST_LENGTH];
133 |
134 | CC_MD5(original_str, strlen(original_str), result);
135 | NSMutableString *hash = [NSMutableString string];
136 | for (int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
137 | [hash appendFormat:@"%02X", result[i]];
138 |
139 | return [hash lowercaseString];
140 |
141 | }
142 |
143 | #pragma mark 校验身份证
144 | BOOL ValidateIDCardNumber(NSString* cardNo){
145 |
146 | if (cardNo.length != 18) {
147 | return NO;
148 | }
149 | NSArray* codeArray = [NSArray arrayWithObjects:@"7",@"9",@"10",@"5",@"8",@"4",@"2",@"1",@"6",@"3",@"7",@"9",@"10",@"5",@"8",@"4",@"2", nil];
150 | NSDictionary* checkCodeDic = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"1",@"0",@"X",@"9",@"8",@"7",@"6",@"5",@"4",@"3",@"2", nil] forKeys:[NSArray arrayWithObjects:@"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10", nil]];
151 |
152 | NSScanner* scan = [NSScanner scannerWithString:[cardNo substringToIndex:17]];
153 |
154 | int val;
155 | BOOL isNum = [scan scanInt:&val] && [scan isAtEnd];
156 | if (!isNum) {
157 | return NO;
158 | }
159 | int sumValue = 0;
160 |
161 | for (int i =0; i<17; i++) {
162 | sumValue+=[[cardNo substringWithRange:NSMakeRange(i , 1) ] intValue]* [[codeArray objectAtIndex:i] intValue];
163 | }
164 |
165 | NSString* strlast = [checkCodeDic objectForKey:[NSString stringWithFormat:@"%d",sumValue%11]];
166 |
167 | if ([strlast isEqualToString: [[cardNo substringWithRange:NSMakeRange(17, 1)]uppercaseString]]) {
168 | return YES;
169 | }
170 | return NO;
171 |
172 | }
173 |
174 | //#pragma mark 获取省份
175 | //NSArray* getProvinceList(){
176 | //
177 | // // 读取并加载对照表
178 | // NSString *path = [[NSBundle mainBundle] pathForResource:@"area" ofType:@"txt"];
179 | //
180 | // NSString* areaJson = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
181 | //
182 | // NSArray* addressArray = [areaJson JSONValue];
183 | //
184 | // return addressArray;
185 | //}
186 | //
187 | //
188 | //NSString* getCityIdByName(NSString* name){
189 | //
190 | // // 读取并加载
191 | // NSString *path = [[NSBundle mainBundle] pathForResource:@"area" ofType:@"txt"];
192 | // NSString* areaJson = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
193 | // NSArray* addressArray = [areaJson JSONValue];
194 | //
195 | // NSString* city_id;
196 | // for(NSDictionary* p_dict in addressArray){
197 | // NSArray* c_array = EncodeArrayFromDic(p_dict,@"children");
198 | // for(NSDictionary* c_dict in c_array){
199 | // NSString* c_name = EncodeStringFromDic(c_dict,@"name");
200 | // if([c_name isEqualToString:name]){
201 | // city_id = EncodeStringFromDic(c_dict,@"id");
202 | // }
203 | // }
204 | // }
205 | // return city_id;
206 | //}
207 | ///**
208 | // * 获市地区ID
209 | // */
210 | //NSString* getAreaIdByName(NSString *cityId,NSString* name){
211 | // // 读取并加载
212 | // NSString *path = [[NSBundle mainBundle] pathForResource:@"area" ofType:@"txt"];
213 | // NSString* areaJson = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
214 | // NSArray* addressArray = [areaJson JSONValue];
215 | //
216 | // NSString* a_id;
217 | // for(NSDictionary* p_dict in addressArray){
218 | // NSArray* c_array = EncodeArrayFromDic(p_dict,@"children");
219 | // for(NSDictionary* c_dict in c_array){
220 | // NSString* c_id = EncodeStringFromDic(c_dict,@"id");
221 | // if([c_id isEqualToString:cityId]){
222 | // NSArray *a_array = EncodeArrayFromDic(c_dict, @"children");
223 | // for (NSDictionary *a_dict in a_array) {
224 | // NSString *a_name = EncodeStringFromDic(a_dict,@"name");
225 | // if ([a_name isEqualToString:name]) {
226 | // a_id = EncodeStringFromDic(a_dict,@"id");
227 | // break;
228 | // }
229 | // }
230 | // break;
231 | // }
232 | // }
233 | // }
234 | // return a_id;
235 | //}
236 | //
237 | //NSArray* getCityList(NSString* provinceId){
238 | //
239 | // // 读取并加载
240 | // NSString *path = [[NSBundle mainBundle] pathForResource:@"area" ofType:@"txt"];
241 | // NSString* areaJson = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
242 | // NSArray* addressArray = [areaJson JSONValue];
243 | //
244 | // NSArray* cityArray;
245 | //
246 | // for(NSDictionary* p_dict in addressArray){
247 | // NSString* p_id = EncodeStringFromDic(p_dict,@"id");
248 | // if([p_id isEqualToString:provinceId]){
249 | // cityArray = EncodeArrayFromDic(p_dict,@"children");
250 | // break;
251 | // }
252 | // }
253 | // return cityArray;
254 | //}
255 | //
256 | //#pragma mark 获取区域数据
257 | //NSArray* getAreaList(NSString*city_id){
258 | //
259 | // // 读取并加载对照表
260 | // NSString *path = [[NSBundle mainBundle] pathForResource:@"area" ofType:@"txt"];
261 | //
262 | // NSString* areaJson = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
263 | //
264 | // NSArray* addressArray = [areaJson JSONValue];
265 | // NSArray* areaArray;
266 | // for(NSDictionary* p_dict in addressArray){
267 | // NSArray* c_array = EncodeArrayFromDic(p_dict,@"children");
268 | // for(NSDictionary* c_dict in c_array){
269 | // NSString* c_id = EncodeStringFromDic(c_dict,@"id");
270 | // if([city_id integerValue] == [c_id integerValue]){
271 | // areaArray = EncodeArrayFromDic(c_dict,@"children");
272 | // break;
273 | // }
274 | // }
275 | // }
276 | //
277 | // return (NSArray*)[[areaArray objectEnumerator] allObjects];;
278 | //}
279 |
280 | @end
281 |
--------------------------------------------------------------------------------
/MyShow/Classes/Home/BlueTooth/YMBlueToothTool.m:
--------------------------------------------------------------------------------
1 | //
2 | // YMBlueToothTool.m
3 | //
4 | // Created by iOS on 2017/7/19.
5 | // Copyright © 2017年 qixiangnet. All rights reserved.
6 | //
7 |
8 | #import "YMBlueToothTool.h"
9 |
10 | @implementation YMBlueToothTool
11 |
12 |
13 | /**
14 | * short整数转换为2字节的byte数组
15 | *
16 | * @param s short整数
17 | * @return byte数组
18 | */
19 | + (Byte)intToByte2:(NSInteger)s{
20 | Byte target[2] = {};
21 | target[0] = (Byte) (s >> 8 & 0xFF);
22 | target[1] = (Byte) (s & 0xFF);
23 | return target;
24 | }
25 | /**
26 | * int整数转换为1字节的byte数组
27 | *
28 | * @param -b整数
29 | * @return byte数组
30 | */
31 | + (Byte)intToByte1:(NSInteger)n{
32 | Byte b[1] = {};
33 | b[0] = (Byte) (n & 0xff);
34 | return b;
35 | }
36 |
37 | #pragma mark - 进制转换
38 | + (NSString *)decodeHexWithData:(NSData *)data{
39 | const unsigned char *dataBuffer = (const unsigned char *)[data bytes];
40 |
41 | if(!dataBuffer)
42 | {
43 | return [NSString string];
44 | }
45 | NSUInteger dataLength = [data length];
46 | NSMutableString *hexString = [NSMutableString stringWithCapacity:(dataLength * 2)];
47 |
48 | for (int i = 0; i < dataLength; i++) {
49 | [hexString appendFormat:@"%02X",(unsigned int)dataBuffer[i]];
50 | }
51 | return [NSString stringWithString:hexString];
52 | }
53 |
54 | /**
55 | 十六进制 String 转 Data(bytes)
56 | @param string 十六进制 String
57 | @return Data(bytes)
58 | */
59 | + (NSData *)hexToBytes:(NSString *)string {
60 | NSMutableData *data = [NSMutableData data];
61 | int idx;
62 | for (idx = 0; idx+2 <= string.length; idx+=2) {
63 | NSRange range = NSMakeRange(idx, 2);
64 | NSString *hexString = [string substringWithRange:range];
65 | NSScanner *scanner = [NSScanner scannerWithString:hexString];
66 | unsigned int intValue;
67 | [scanner scanHexInt:&intValue];
68 | [data appendBytes:&intValue length:1];
69 | }
70 | return [data copy];
71 | }
72 | + (NSData *)encodeHexWithHexString:(NSString *)hexStr{
73 | if(!hexStr || [hexStr length] == 0){
74 | return nil;
75 | }
76 | NSMutableData *hexData = [[NSMutableData alloc] initWithCapacity:8];
77 | NSRange range;
78 | if([hexStr length] % 2 ==0){
79 | range = NSMakeRange(0, 2);
80 | }else{
81 | range = NSMakeRange(0, 1);
82 | }
83 | for (NSInteger i = range.location;i < [hexStr length]; i += 2) {
84 | unsigned int anInt;
85 | NSString *hexCharStr = [hexStr substringWithRange:range];
86 | NSScanner *scanner = [[NSScanner alloc] initWithString:hexCharStr];
87 |
88 | [scanner scanInt:&anInt];
89 | NSData *entity = [[NSData alloc] initWithBytes:&anInt length:1];
90 | [hexData appendData:entity];
91 |
92 | range.location +=range.length;
93 | range.length = 2;
94 | }
95 |
96 | return hexData;
97 | }
98 |
99 | /**
100 | Data(bytes) 转 十六进制 String
101 |
102 | @param data Data(bytes)
103 | @return 十六进制 String
104 | */
105 | + (NSString *)dataChangeToString:(NSData *)data {
106 | NSString *string = [NSString stringWithFormat:@"%@",data];
107 | string = [string stringByReplacingOccurrencesOfString:@"<" withString:@""];
108 | string = [string stringByReplacingOccurrencesOfString:@">" withString:@""];
109 | string = [string stringByReplacingOccurrencesOfString:@" " withString:@""];
110 | return string;
111 | }
112 |
113 | /**
114 | 十六进制转十进制
115 |
116 | @param hex 十六进制
117 | @return 十进制
118 | */
119 | + (NSString *)toTen:(NSString *)hex {
120 | NSString *ten = [NSString stringWithFormat:@"%lu",strtoul([hex UTF8String],0,16)];
121 | return ten;
122 | }
123 |
124 | /**
125 | 十进制转十六进制
126 |
127 | @param tmpid 十进制 int
128 | @return 十六进制
129 | */
130 | + (NSString *)toHex:(long long int)tmpid {
131 | NSString *nLetterValue;
132 | NSString *str = @"";
133 | long long int ttmpig;
134 | for (int i = 0; i < 9; i++) {
135 | ttmpig = tmpid % 16;
136 | tmpid = tmpid / 16;
137 | switch (ttmpig) {
138 | case 10: {
139 | nLetterValue = @"A";
140 | break;
141 | }
142 | case 11: {
143 | nLetterValue = @"B";
144 | break;
145 | }
146 | case 12: {
147 | nLetterValue = @"C";
148 | break;
149 | }
150 | case 13: {
151 | nLetterValue = @"D";
152 | break;
153 | }
154 | case 14: {
155 | nLetterValue = @"E";
156 | break;
157 | }
158 | case 15: {
159 | nLetterValue = @"F";
160 | break;
161 | }
162 | default: {
163 | nLetterValue = [[NSString alloc] initWithFormat:@"%lli",ttmpig];
164 | break;
165 | }
166 | }
167 | str = [nLetterValue stringByAppendingString:str];
168 | if (tmpid == 0) {
169 | break;
170 | }
171 | }
172 | return str;
173 | }
174 |
175 | /**
176 | 大小端数据转换
177 |
178 | @param data data
179 | @return data
180 | */
181 | + (NSData *)dataTransfromBigOrSmall:(NSData *)data {
182 | NSString *tempString = [self dataChangeToString:data];
183 |
184 | NSMutableArray *tmpArray = [NSMutableArray array];
185 | for (int i = 0; i < data.length * 2 ; i+=2) {
186 | NSString *string = [tempString substringWithRange:NSMakeRange(i, 2)];
187 | [tmpArray addObject:string];
188 | }
189 |
190 | NSArray *lastArray = [[tmpArray reverseObjectEnumerator] allObjects];
191 | NSMutableString *lastString = [NSMutableString string];
192 |
193 | for (NSString *string in lastArray) {
194 | [lastString appendString:string];
195 | }
196 |
197 | NSData *lastData = [self hexToBytes:lastString];
198 | return lastData;
199 | }
200 |
201 | #pragma mark - 补位
202 |
203 | /**
204 | 补位
205 |
206 | @param addString 占位字符串
207 | @param length 总长度
208 | @param string 需补位的字符串
209 | @return 补位后的字符串
210 | */
211 | + (NSString *)addString:(NSString *)addString Length:(NSInteger)length OnString:(NSString *)string {
212 | NSMutableString *nullString = [[NSMutableString alloc] initWithString:@""];
213 | if ((length - string.length) > 0) {
214 | for (int i = 0; i < (length - string.length); i++) {
215 | [nullString appendString:addString];
216 | }
217 | }
218 | return [NSString stringWithFormat:@"%@%@",nullString,string];
219 | }
220 |
221 | #pragma mark - 获取时间大端表示
222 |
223 | /**
224 | 获取时间大端表示
225 |
226 | @param number 时间戳
227 | @param length 总长度
228 | @return 大端表示的时间
229 | */
230 | + (NSString *)intToHexString:(NSInteger)number length:(NSInteger)length {
231 | NSString *result = [self addString:@"0" Length:length OnString:[self toHex:(long long int)number]];
232 | NSData *data = [self hexToBytes:result];
233 | NSData *lastData = [self dataTransfromBigOrSmall:data];
234 |
235 | result = [self dataChangeToString:lastData];
236 | return result;
237 | }
238 |
239 | #pragma mark - 校验和
240 |
241 | /**
242 | 算出校验和
243 |
244 | @param string 十六进制字符串
245 | @return 校验和
246 | */
247 | + (NSString *)xorWithHex:(NSString *)string {
248 | int idx;
249 | unsigned long result = 00;
250 | for (idx = 0; idx+2 <= string.length; idx+=2) {
251 | NSRange range = NSMakeRange(idx, 2);
252 | NSString *hexStr = [string substringWithRange:range];
253 | unsigned long hex = strtoul([hexStr UTF8String], 0, 16);
254 | result = result ^ hex;
255 | }
256 | return [NSString stringWithFormat:@"%@",[self toHex:result]];
257 | }
258 |
259 | #pragma mark - 分包
260 |
261 | /**
262 | 分包
263 |
264 | @param write 需要输入的字符串
265 | @return 分包数组
266 | */
267 | + (NSMutableArray *)arrayToWrite:(NSString *)write {
268 | write = [write uppercaseStringWithLocale:[NSLocale currentLocale]];
269 | float limit = 40; //一个字节2位数,蓝牙通讯限制20字节
270 | NSMutableArray *array = [NSMutableArray array];
271 | NSInteger count = ceilf(write.length / limit);
272 | NSInteger left = write.length % (int)limit == 0 ? limit : write.length % (int)limit;
273 | for (int i = 0; i < count; i++) {
274 | NSString *string;
275 | if (i != (count - 1)) {
276 | string = [write substringWithRange:NSMakeRange(i * limit, limit)];
277 | }else {
278 | string = [write substringWithRange:NSMakeRange(i * limit, left)];
279 | }
280 | [array addObject:string];
281 | }
282 | return array;
283 | }
284 |
285 | /*
286 | * @brief 10进制转进制 按字节个数补位(每个字节占2位)
287 | * @param decimalism 十进制数字
288 | * @param addStr 添加的地址
289 | * @return 十六进制
290 | */
291 | + (NSString *)toHexByString:(NSInteger)decimalism AndByteCount:(NSInteger)count ByAddString:(NSString *)addStr{
292 | addStr = (addStr == nil) ? @"0":addStr;
293 | if(decimalism){
294 | return [YMBlueToothTool addString:addStr Length:count*2 OnString:[YMBlueToothTool toHex:decimalism]];
295 | }
296 | return nil;
297 | }
298 | /*
299 | * @brief 10进制转进制 按字节个数补位(每个字节占2位)
300 | * @param decimalism 十进制数字
301 | * @return 十六进制
302 | */
303 | + (NSString *)toHexByString:(NSInteger)decimalism AndByteCount:(NSInteger)count{
304 | if(decimalism){
305 | return [YMBlueToothTool addString:@"0" Length:count*2 OnString:[YMBlueToothTool toHex:decimalism]];
306 | }
307 | return @"00";
308 | }
309 | /*
310 | * @brief 校验和
311 | * @param verify输入字符串
312 | * @return 校验码
313 | */
314 | + (NSString *)stringToVerify:(NSString *)verify{
315 | Byte A;
316 | for (int i = 0;i < verify.length / 2; i++) {
317 | NSString *u = [verify substringWithRange:NSMakeRange(2 * i, 2)];
318 | unsigned long num1 = strtoul([u UTF8String],0,16);
319 | A = num1 + A;
320 | }
321 | //校验
322 | Byte B = ~A;
323 | return [NSString stringWithFormat:@"%02X",B];
324 | }
325 | @end
326 |
--------------------------------------------------------------------------------
/MyShow.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 247DE9191FA200E50005B455 /* pointer.png in Resources */ = {isa = PBXBuildFile; fileRef = 247DE9181FA200E40005B455 /* pointer.png */; };
11 | 24E56BAB1F9F1F4D009A616D /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24E56BA91F9F1F4D009A616D /* BaseViewController.m */; };
12 | 24E56BAF1F9F1F65009A616D /* JHHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24E56BAD1F9F1F65009A616D /* JHHomeViewController.m */; };
13 | 24E56BB01F9F1F65009A616D /* JHHomeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24E56BAE1F9F1F65009A616D /* JHHomeViewController.xib */; };
14 | 24E56BB31F9F2180009A616D /* libobjc.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 24E56BB21F9F2180009A616D /* libobjc.tbd */; };
15 | 24E56BB81F9F22F6009A616D /* TurntableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24E56BB61F9F22F6009A616D /* TurntableViewController.m */; };
16 | 24E56BB91F9F22F6009A616D /* TurntableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24E56BB71F9F22F6009A616D /* TurntableViewController.xib */; };
17 | 24E56BC01F9F23D3009A616D /* TurntableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 24E56BBF1F9F23D3009A616D /* TurntableView.m */; };
18 | 24FE17E31EA88068006759D9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 24FE17E21EA88068006759D9 /* main.m */; };
19 | 24FE17E61EA88068006759D9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 24FE17E51EA88068006759D9 /* AppDelegate.m */; };
20 | 24FE17E91EA88068006759D9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24FE17E81EA88068006759D9 /* ViewController.m */; };
21 | 24FE17EC1EA88068006759D9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 24FE17EA1EA88068006759D9 /* Main.storyboard */; };
22 | 24FE17EE1EA88068006759D9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 24FE17ED1EA88068006759D9 /* Assets.xcassets */; };
23 | 24FE17F11EA88068006759D9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 24FE17EF1EA88068006759D9 /* LaunchScreen.storyboard */; };
24 | 24FE17FC1EA88069006759D9 /* MyShowTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 24FE17FB1EA88069006759D9 /* MyShowTests.m */; };
25 | 24FE18071EA88069006759D9 /* MyShowUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 24FE18061EA88069006759D9 /* MyShowUITests.m */; };
26 | 2ED12387203FF39400A82C36 /* AboutMeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ED12385203FF39400A82C36 /* AboutMeViewController.m */; };
27 | 2ED12388203FF39400A82C36 /* AboutMeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2ED12386203FF39400A82C36 /* AboutMeViewController.xib */; };
28 | 2ED1238B203FF5F500A82C36 /* Zhangjh.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ED1238A203FF5F500A82C36 /* Zhangjh.m */; };
29 | 2ED48547206A3E66005A78A8 /* ZJHAlertViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ED48546206A3E66005A78A8 /* ZJHAlertViewController.m */; };
30 | 2ED48FF9206DCFD100B92093 /* BluetoothEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ED48FF7206DCFD100B92093 /* BluetoothEncryption.m */; };
31 | 2ED48FFC206DCFDB00B92093 /* ZBlueToothTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ED48FFB206DCFDB00B92093 /* ZBlueToothTools.m */; };
32 | 2ED48FFF206DD05D00B92093 /* YMBlueToothTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ED48FFD206DD05D00B92093 /* YMBlueToothTool.m */; };
33 | 2ED49003206DD3C200B92093 /* BlueToothViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ED49001206DD3C200B92093 /* BlueToothViewController.m */; };
34 | 2ED49004206DD3C200B92093 /* BlueToothViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2ED49002206DD3C200B92093 /* BlueToothViewController.xib */; };
35 | 2ED49008206DD95F00B92093 /* DefineConstant.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ED49007206DD95F00B92093 /* DefineConstant.m */; };
36 | /* End PBXBuildFile section */
37 |
38 | /* Begin PBXContainerItemProxy section */
39 | 24FE17F81EA88069006759D9 /* PBXContainerItemProxy */ = {
40 | isa = PBXContainerItemProxy;
41 | containerPortal = 24FE17D61EA88068006759D9 /* Project object */;
42 | proxyType = 1;
43 | remoteGlobalIDString = 24FE17DD1EA88068006759D9;
44 | remoteInfo = MyShow;
45 | };
46 | 24FE18031EA88069006759D9 /* PBXContainerItemProxy */ = {
47 | isa = PBXContainerItemProxy;
48 | containerPortal = 24FE17D61EA88068006759D9 /* Project object */;
49 | proxyType = 1;
50 | remoteGlobalIDString = 24FE17DD1EA88068006759D9;
51 | remoteInfo = MyShow;
52 | };
53 | /* End PBXContainerItemProxy section */
54 |
55 | /* Begin PBXFileReference section */
56 | 247DE9181FA200E40005B455 /* pointer.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pointer.png; sourceTree = ""; };
57 | 24E56B9C1F9F12A8009A616D /* 1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 1.jpg; sourceTree = ""; };
58 | 24E56B9D1F9F1308009A616D /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; };
59 | 24E56BA91F9F1F4D009A616D /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = ""; };
60 | 24E56BAA1F9F1F4D009A616D /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = ""; };
61 | 24E56BAC1F9F1F65009A616D /* JHHomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JHHomeViewController.h; sourceTree = ""; };
62 | 24E56BAD1F9F1F65009A616D /* JHHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JHHomeViewController.m; sourceTree = ""; };
63 | 24E56BAE1F9F1F65009A616D /* JHHomeViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = JHHomeViewController.xib; sourceTree = ""; };
64 | 24E56BB21F9F2180009A616D /* libobjc.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libobjc.tbd; path = usr/lib/libobjc.tbd; sourceTree = SDKROOT; };
65 | 24E56BB51F9F22F6009A616D /* TurntableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TurntableViewController.h; sourceTree = ""; };
66 | 24E56BB61F9F22F6009A616D /* TurntableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TurntableViewController.m; sourceTree = ""; };
67 | 24E56BB71F9F22F6009A616D /* TurntableViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TurntableViewController.xib; sourceTree = ""; };
68 | 24E56BBE1F9F23D3009A616D /* TurntableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TurntableView.h; sourceTree = ""; };
69 | 24E56BBF1F9F23D3009A616D /* TurntableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TurntableView.m; sourceTree = ""; };
70 | 24FE17DE1EA88068006759D9 /* MyShow.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MyShow.app; sourceTree = BUILT_PRODUCTS_DIR; };
71 | 24FE17E21EA88068006759D9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
72 | 24FE17E41EA88068006759D9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
73 | 24FE17E51EA88068006759D9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
74 | 24FE17E71EA88068006759D9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
75 | 24FE17E81EA88068006759D9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
76 | 24FE17EB1EA88068006759D9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
77 | 24FE17ED1EA88068006759D9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
78 | 24FE17F01EA88068006759D9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
79 | 24FE17F21EA88068006759D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
80 | 24FE17F71EA88069006759D9 /* MyShowTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MyShowTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
81 | 24FE17FB1EA88069006759D9 /* MyShowTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyShowTests.m; sourceTree = ""; };
82 | 24FE17FD1EA88069006759D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
83 | 24FE18021EA88069006759D9 /* MyShowUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MyShowUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
84 | 24FE18061EA88069006759D9 /* MyShowUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyShowUITests.m; sourceTree = ""; };
85 | 24FE18081EA88069006759D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
86 | 2ED12384203FF39400A82C36 /* AboutMeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AboutMeViewController.h; sourceTree = ""; };
87 | 2ED12385203FF39400A82C36 /* AboutMeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AboutMeViewController.m; sourceTree = ""; };
88 | 2ED12386203FF39400A82C36 /* AboutMeViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AboutMeViewController.xib; sourceTree = ""; };
89 | 2ED12389203FF5F500A82C36 /* Zhangjh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Zhangjh.h; sourceTree = ""; };
90 | 2ED1238A203FF5F500A82C36 /* Zhangjh.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Zhangjh.m; sourceTree = ""; };
91 | 2ED48545206A3E66005A78A8 /* ZJHAlertViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZJHAlertViewController.h; sourceTree = ""; };
92 | 2ED48546206A3E66005A78A8 /* ZJHAlertViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZJHAlertViewController.m; sourceTree = ""; };
93 | 2ED48FF7206DCFD100B92093 /* BluetoothEncryption.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BluetoothEncryption.m; sourceTree = ""; };
94 | 2ED48FF8206DCFD100B92093 /* BluetoothEncryption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BluetoothEncryption.h; sourceTree = ""; };
95 | 2ED48FFA206DCFDB00B92093 /* ZBlueToothTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZBlueToothTools.h; sourceTree = ""; };
96 | 2ED48FFB206DCFDB00B92093 /* ZBlueToothTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZBlueToothTools.m; sourceTree = ""; };
97 | 2ED48FFD206DD05D00B92093 /* YMBlueToothTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YMBlueToothTool.m; sourceTree = ""; };
98 | 2ED48FFE206DD05D00B92093 /* YMBlueToothTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YMBlueToothTool.h; sourceTree = ""; };
99 | 2ED49000206DD3C200B92093 /* BlueToothViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BlueToothViewController.h; sourceTree = ""; };
100 | 2ED49001206DD3C200B92093 /* BlueToothViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BlueToothViewController.m; sourceTree = ""; };
101 | 2ED49002206DD3C200B92093 /* BlueToothViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BlueToothViewController.xib; sourceTree = ""; };
102 | 2ED49006206DD95F00B92093 /* DefineConstant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DefineConstant.h; sourceTree = ""; };
103 | 2ED49007206DD95F00B92093 /* DefineConstant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DefineConstant.m; sourceTree = ""; };
104 | /* End PBXFileReference section */
105 |
106 | /* Begin PBXFrameworksBuildPhase section */
107 | 24FE17DB1EA88068006759D9 /* Frameworks */ = {
108 | isa = PBXFrameworksBuildPhase;
109 | buildActionMask = 2147483647;
110 | files = (
111 | 24E56BB31F9F2180009A616D /* libobjc.tbd in Frameworks */,
112 | );
113 | runOnlyForDeploymentPostprocessing = 0;
114 | };
115 | 24FE17F41EA88069006759D9 /* Frameworks */ = {
116 | isa = PBXFrameworksBuildPhase;
117 | buildActionMask = 2147483647;
118 | files = (
119 | );
120 | runOnlyForDeploymentPostprocessing = 0;
121 | };
122 | 24FE17FF1EA88069006759D9 /* Frameworks */ = {
123 | isa = PBXFrameworksBuildPhase;
124 | buildActionMask = 2147483647;
125 | files = (
126 | );
127 | runOnlyForDeploymentPostprocessing = 0;
128 | };
129 | /* End PBXFrameworksBuildPhase section */
130 |
131 | /* Begin PBXGroup section */
132 | 24E56B971F9F11D1009A616D /* Classes */ = {
133 | isa = PBXGroup;
134 | children = (
135 | 24E56BA31F9F1E56009A616D /* Home */,
136 | 24E56B9B1F9F11EB009A616D /* Configs */,
137 | 24E56B981F9F11D1009A616D /* Base */,
138 | );
139 | path = Classes;
140 | sourceTree = "";
141 | };
142 | 24E56B981F9F11D1009A616D /* Base */ = {
143 | isa = PBXGroup;
144 | children = (
145 | 2ED49005206DD95500B92093 /* base */,
146 | 24E56B9E1F9F1643009A616D /* BaseViewController */,
147 | );
148 | path = Base;
149 | sourceTree = "";
150 | };
151 | 24E56B9A1F9F11D1009A616D /* Resource */ = {
152 | isa = PBXGroup;
153 | children = (
154 | 247DE9181FA200E40005B455 /* pointer.png */,
155 | 24E56B9C1F9F12A8009A616D /* 1.jpg */,
156 | );
157 | path = Resource;
158 | sourceTree = "";
159 | };
160 | 24E56B9B1F9F11EB009A616D /* Configs */ = {
161 | isa = PBXGroup;
162 | children = (
163 | 24E56B9D1F9F1308009A616D /* PrefixHeader.pch */,
164 | );
165 | path = Configs;
166 | sourceTree = "";
167 | };
168 | 24E56B9E1F9F1643009A616D /* BaseViewController */ = {
169 | isa = PBXGroup;
170 | children = (
171 | 24E56BAA1F9F1F4D009A616D /* BaseViewController.h */,
172 | 24E56BA91F9F1F4D009A616D /* BaseViewController.m */,
173 | );
174 | path = BaseViewController;
175 | sourceTree = "";
176 | };
177 | 24E56BA31F9F1E56009A616D /* Home */ = {
178 | isa = PBXGroup;
179 | children = (
180 | 2ED48FF6206DCFAA00B92093 /* BlueTooth */,
181 | 2ED48544206A3E3F005A78A8 /* AlertController */,
182 | 2ED12383203FF36400A82C36 /* AboutMe */,
183 | 24E56BB41F9F22E8009A616D /* Turntable */,
184 | 24E56BA51F9F1E79009A616D /* View */,
185 | 24E56BA41F9F1E70009A616D /* Controller */,
186 | );
187 | path = Home;
188 | sourceTree = "";
189 | };
190 | 24E56BA41F9F1E70009A616D /* Controller */ = {
191 | isa = PBXGroup;
192 | children = (
193 | 24E56BAC1F9F1F65009A616D /* JHHomeViewController.h */,
194 | 24E56BAD1F9F1F65009A616D /* JHHomeViewController.m */,
195 | 24E56BAE1F9F1F65009A616D /* JHHomeViewController.xib */,
196 | );
197 | path = Controller;
198 | sourceTree = "";
199 | };
200 | 24E56BA51F9F1E79009A616D /* View */ = {
201 | isa = PBXGroup;
202 | children = (
203 | );
204 | path = View;
205 | sourceTree = "";
206 | };
207 | 24E56BB11F9F217F009A616D /* Frameworks */ = {
208 | isa = PBXGroup;
209 | children = (
210 | 24E56BB21F9F2180009A616D /* libobjc.tbd */,
211 | );
212 | name = Frameworks;
213 | sourceTree = "";
214 | };
215 | 24E56BB41F9F22E8009A616D /* Turntable */ = {
216 | isa = PBXGroup;
217 | children = (
218 | 24E56BBD1F9F23C1009A616D /* TurntableView */,
219 | 24E56BB51F9F22F6009A616D /* TurntableViewController.h */,
220 | 24E56BB61F9F22F6009A616D /* TurntableViewController.m */,
221 | 24E56BB71F9F22F6009A616D /* TurntableViewController.xib */,
222 | );
223 | path = Turntable;
224 | sourceTree = "";
225 | };
226 | 24E56BBD1F9F23C1009A616D /* TurntableView */ = {
227 | isa = PBXGroup;
228 | children = (
229 | 24E56BBE1F9F23D3009A616D /* TurntableView.h */,
230 | 24E56BBF1F9F23D3009A616D /* TurntableView.m */,
231 | );
232 | path = TurntableView;
233 | sourceTree = "";
234 | };
235 | 24FE17D51EA88068006759D9 = {
236 | isa = PBXGroup;
237 | children = (
238 | 24FE17E01EA88068006759D9 /* MyShow */,
239 | 24FE17FA1EA88069006759D9 /* MyShowTests */,
240 | 24FE18051EA88069006759D9 /* MyShowUITests */,
241 | 24FE17DF1EA88068006759D9 /* Products */,
242 | 24E56BB11F9F217F009A616D /* Frameworks */,
243 | );
244 | sourceTree = "";
245 | };
246 | 24FE17DF1EA88068006759D9 /* Products */ = {
247 | isa = PBXGroup;
248 | children = (
249 | 24FE17DE1EA88068006759D9 /* MyShow.app */,
250 | 24FE17F71EA88069006759D9 /* MyShowTests.xctest */,
251 | 24FE18021EA88069006759D9 /* MyShowUITests.xctest */,
252 | );
253 | name = Products;
254 | sourceTree = "";
255 | };
256 | 24FE17E01EA88068006759D9 /* MyShow */ = {
257 | isa = PBXGroup;
258 | children = (
259 | 24E56B971F9F11D1009A616D /* Classes */,
260 | 24E56B9A1F9F11D1009A616D /* Resource */,
261 | 24FE17E41EA88068006759D9 /* AppDelegate.h */,
262 | 24FE17E51EA88068006759D9 /* AppDelegate.m */,
263 | 24FE17E71EA88068006759D9 /* ViewController.h */,
264 | 24FE17E81EA88068006759D9 /* ViewController.m */,
265 | 24FE17EA1EA88068006759D9 /* Main.storyboard */,
266 | 24FE17ED1EA88068006759D9 /* Assets.xcassets */,
267 | 24FE17EF1EA88068006759D9 /* LaunchScreen.storyboard */,
268 | 24FE17F21EA88068006759D9 /* Info.plist */,
269 | 24FE17E11EA88068006759D9 /* Supporting Files */,
270 | );
271 | path = MyShow;
272 | sourceTree = "";
273 | };
274 | 24FE17E11EA88068006759D9 /* Supporting Files */ = {
275 | isa = PBXGroup;
276 | children = (
277 | 24FE17E21EA88068006759D9 /* main.m */,
278 | );
279 | name = "Supporting Files";
280 | sourceTree = "";
281 | };
282 | 24FE17FA1EA88069006759D9 /* MyShowTests */ = {
283 | isa = PBXGroup;
284 | children = (
285 | 24FE17FB1EA88069006759D9 /* MyShowTests.m */,
286 | 24FE17FD1EA88069006759D9 /* Info.plist */,
287 | );
288 | path = MyShowTests;
289 | sourceTree = "";
290 | };
291 | 24FE18051EA88069006759D9 /* MyShowUITests */ = {
292 | isa = PBXGroup;
293 | children = (
294 | 24FE18061EA88069006759D9 /* MyShowUITests.m */,
295 | 24FE18081EA88069006759D9 /* Info.plist */,
296 | );
297 | path = MyShowUITests;
298 | sourceTree = "";
299 | };
300 | 2ED12383203FF36400A82C36 /* AboutMe */ = {
301 | isa = PBXGroup;
302 | children = (
303 | 2ED12384203FF39400A82C36 /* AboutMeViewController.h */,
304 | 2ED12385203FF39400A82C36 /* AboutMeViewController.m */,
305 | 2ED12386203FF39400A82C36 /* AboutMeViewController.xib */,
306 | 2ED12389203FF5F500A82C36 /* Zhangjh.h */,
307 | 2ED1238A203FF5F500A82C36 /* Zhangjh.m */,
308 | );
309 | path = AboutMe;
310 | sourceTree = "";
311 | };
312 | 2ED48544206A3E3F005A78A8 /* AlertController */ = {
313 | isa = PBXGroup;
314 | children = (
315 | 2ED48545206A3E66005A78A8 /* ZJHAlertViewController.h */,
316 | 2ED48546206A3E66005A78A8 /* ZJHAlertViewController.m */,
317 | );
318 | path = AlertController;
319 | sourceTree = "";
320 | };
321 | 2ED48FF6206DCFAA00B92093 /* BlueTooth */ = {
322 | isa = PBXGroup;
323 | children = (
324 | 2ED48FFE206DD05D00B92093 /* YMBlueToothTool.h */,
325 | 2ED48FFD206DD05D00B92093 /* YMBlueToothTool.m */,
326 | 2ED48FFA206DCFDB00B92093 /* ZBlueToothTools.h */,
327 | 2ED48FFB206DCFDB00B92093 /* ZBlueToothTools.m */,
328 | 2ED48FF8206DCFD100B92093 /* BluetoothEncryption.h */,
329 | 2ED48FF7206DCFD100B92093 /* BluetoothEncryption.m */,
330 | 2ED49000206DD3C200B92093 /* BlueToothViewController.h */,
331 | 2ED49001206DD3C200B92093 /* BlueToothViewController.m */,
332 | 2ED49002206DD3C200B92093 /* BlueToothViewController.xib */,
333 | );
334 | path = BlueTooth;
335 | sourceTree = "";
336 | };
337 | 2ED49005206DD95500B92093 /* base */ = {
338 | isa = PBXGroup;
339 | children = (
340 | 2ED49006206DD95F00B92093 /* DefineConstant.h */,
341 | 2ED49007206DD95F00B92093 /* DefineConstant.m */,
342 | );
343 | path = base;
344 | sourceTree = "";
345 | };
346 | /* End PBXGroup section */
347 |
348 | /* Begin PBXNativeTarget section */
349 | 24FE17DD1EA88068006759D9 /* MyShow */ = {
350 | isa = PBXNativeTarget;
351 | buildConfigurationList = 24FE180B1EA88069006759D9 /* Build configuration list for PBXNativeTarget "MyShow" */;
352 | buildPhases = (
353 | 24FE17DA1EA88068006759D9 /* Sources */,
354 | 24FE17DB1EA88068006759D9 /* Frameworks */,
355 | 24FE17DC1EA88068006759D9 /* Resources */,
356 | );
357 | buildRules = (
358 | );
359 | dependencies = (
360 | );
361 | name = MyShow;
362 | productName = MyShow;
363 | productReference = 24FE17DE1EA88068006759D9 /* MyShow.app */;
364 | productType = "com.apple.product-type.application";
365 | };
366 | 24FE17F61EA88069006759D9 /* MyShowTests */ = {
367 | isa = PBXNativeTarget;
368 | buildConfigurationList = 24FE180E1EA88069006759D9 /* Build configuration list for PBXNativeTarget "MyShowTests" */;
369 | buildPhases = (
370 | 24FE17F31EA88069006759D9 /* Sources */,
371 | 24FE17F41EA88069006759D9 /* Frameworks */,
372 | 24FE17F51EA88069006759D9 /* Resources */,
373 | );
374 | buildRules = (
375 | );
376 | dependencies = (
377 | 24FE17F91EA88069006759D9 /* PBXTargetDependency */,
378 | );
379 | name = MyShowTests;
380 | productName = MyShowTests;
381 | productReference = 24FE17F71EA88069006759D9 /* MyShowTests.xctest */;
382 | productType = "com.apple.product-type.bundle.unit-test";
383 | };
384 | 24FE18011EA88069006759D9 /* MyShowUITests */ = {
385 | isa = PBXNativeTarget;
386 | buildConfigurationList = 24FE18111EA88069006759D9 /* Build configuration list for PBXNativeTarget "MyShowUITests" */;
387 | buildPhases = (
388 | 24FE17FE1EA88069006759D9 /* Sources */,
389 | 24FE17FF1EA88069006759D9 /* Frameworks */,
390 | 24FE18001EA88069006759D9 /* Resources */,
391 | );
392 | buildRules = (
393 | );
394 | dependencies = (
395 | 24FE18041EA88069006759D9 /* PBXTargetDependency */,
396 | );
397 | name = MyShowUITests;
398 | productName = MyShowUITests;
399 | productReference = 24FE18021EA88069006759D9 /* MyShowUITests.xctest */;
400 | productType = "com.apple.product-type.bundle.ui-testing";
401 | };
402 | /* End PBXNativeTarget section */
403 |
404 | /* Begin PBXProject section */
405 | 24FE17D61EA88068006759D9 /* Project object */ = {
406 | isa = PBXProject;
407 | attributes = {
408 | LastUpgradeCheck = 0820;
409 | ORGANIZATIONNAME = "花落永恒";
410 | TargetAttributes = {
411 | 24FE17DD1EA88068006759D9 = {
412 | CreatedOnToolsVersion = 8.2.1;
413 | DevelopmentTeam = 66R335K49S;
414 | ProvisioningStyle = Automatic;
415 | };
416 | 24FE17F61EA88069006759D9 = {
417 | CreatedOnToolsVersion = 8.2.1;
418 | ProvisioningStyle = Automatic;
419 | TestTargetID = 24FE17DD1EA88068006759D9;
420 | };
421 | 24FE18011EA88069006759D9 = {
422 | CreatedOnToolsVersion = 8.2.1;
423 | ProvisioningStyle = Automatic;
424 | TestTargetID = 24FE17DD1EA88068006759D9;
425 | };
426 | };
427 | };
428 | buildConfigurationList = 24FE17D91EA88068006759D9 /* Build configuration list for PBXProject "MyShow" */;
429 | compatibilityVersion = "Xcode 3.2";
430 | developmentRegion = English;
431 | hasScannedForEncodings = 0;
432 | knownRegions = (
433 | en,
434 | Base,
435 | );
436 | mainGroup = 24FE17D51EA88068006759D9;
437 | productRefGroup = 24FE17DF1EA88068006759D9 /* Products */;
438 | projectDirPath = "";
439 | projectRoot = "";
440 | targets = (
441 | 24FE17DD1EA88068006759D9 /* MyShow */,
442 | 24FE17F61EA88069006759D9 /* MyShowTests */,
443 | 24FE18011EA88069006759D9 /* MyShowUITests */,
444 | );
445 | };
446 | /* End PBXProject section */
447 |
448 | /* Begin PBXResourcesBuildPhase section */
449 | 24FE17DC1EA88068006759D9 /* Resources */ = {
450 | isa = PBXResourcesBuildPhase;
451 | buildActionMask = 2147483647;
452 | files = (
453 | 24FE17F11EA88068006759D9 /* LaunchScreen.storyboard in Resources */,
454 | 2ED49004206DD3C200B92093 /* BlueToothViewController.xib in Resources */,
455 | 24FE17EE1EA88068006759D9 /* Assets.xcassets in Resources */,
456 | 24E56BB91F9F22F6009A616D /* TurntableViewController.xib in Resources */,
457 | 2ED12388203FF39400A82C36 /* AboutMeViewController.xib in Resources */,
458 | 24FE17EC1EA88068006759D9 /* Main.storyboard in Resources */,
459 | 24E56BB01F9F1F65009A616D /* JHHomeViewController.xib in Resources */,
460 | 247DE9191FA200E50005B455 /* pointer.png in Resources */,
461 | );
462 | runOnlyForDeploymentPostprocessing = 0;
463 | };
464 | 24FE17F51EA88069006759D9 /* Resources */ = {
465 | isa = PBXResourcesBuildPhase;
466 | buildActionMask = 2147483647;
467 | files = (
468 | );
469 | runOnlyForDeploymentPostprocessing = 0;
470 | };
471 | 24FE18001EA88069006759D9 /* Resources */ = {
472 | isa = PBXResourcesBuildPhase;
473 | buildActionMask = 2147483647;
474 | files = (
475 | );
476 | runOnlyForDeploymentPostprocessing = 0;
477 | };
478 | /* End PBXResourcesBuildPhase section */
479 |
480 | /* Begin PBXSourcesBuildPhase section */
481 | 24FE17DA1EA88068006759D9 /* Sources */ = {
482 | isa = PBXSourcesBuildPhase;
483 | buildActionMask = 2147483647;
484 | files = (
485 | 2ED48FF9206DCFD100B92093 /* BluetoothEncryption.m in Sources */,
486 | 2ED48547206A3E66005A78A8 /* ZJHAlertViewController.m in Sources */,
487 | 24E56BAF1F9F1F65009A616D /* JHHomeViewController.m in Sources */,
488 | 2ED48FFF206DD05D00B92093 /* YMBlueToothTool.m in Sources */,
489 | 24FE17E91EA88068006759D9 /* ViewController.m in Sources */,
490 | 2ED49003206DD3C200B92093 /* BlueToothViewController.m in Sources */,
491 | 24E56BC01F9F23D3009A616D /* TurntableView.m in Sources */,
492 | 24E56BAB1F9F1F4D009A616D /* BaseViewController.m in Sources */,
493 | 24FE17E61EA88068006759D9 /* AppDelegate.m in Sources */,
494 | 24E56BB81F9F22F6009A616D /* TurntableViewController.m in Sources */,
495 | 2ED12387203FF39400A82C36 /* AboutMeViewController.m in Sources */,
496 | 2ED48FFC206DCFDB00B92093 /* ZBlueToothTools.m in Sources */,
497 | 2ED1238B203FF5F500A82C36 /* Zhangjh.m in Sources */,
498 | 2ED49008206DD95F00B92093 /* DefineConstant.m in Sources */,
499 | 24FE17E31EA88068006759D9 /* main.m in Sources */,
500 | );
501 | runOnlyForDeploymentPostprocessing = 0;
502 | };
503 | 24FE17F31EA88069006759D9 /* Sources */ = {
504 | isa = PBXSourcesBuildPhase;
505 | buildActionMask = 2147483647;
506 | files = (
507 | 24FE17FC1EA88069006759D9 /* MyShowTests.m in Sources */,
508 | );
509 | runOnlyForDeploymentPostprocessing = 0;
510 | };
511 | 24FE17FE1EA88069006759D9 /* Sources */ = {
512 | isa = PBXSourcesBuildPhase;
513 | buildActionMask = 2147483647;
514 | files = (
515 | 24FE18071EA88069006759D9 /* MyShowUITests.m in Sources */,
516 | );
517 | runOnlyForDeploymentPostprocessing = 0;
518 | };
519 | /* End PBXSourcesBuildPhase section */
520 |
521 | /* Begin PBXTargetDependency section */
522 | 24FE17F91EA88069006759D9 /* PBXTargetDependency */ = {
523 | isa = PBXTargetDependency;
524 | target = 24FE17DD1EA88068006759D9 /* MyShow */;
525 | targetProxy = 24FE17F81EA88069006759D9 /* PBXContainerItemProxy */;
526 | };
527 | 24FE18041EA88069006759D9 /* PBXTargetDependency */ = {
528 | isa = PBXTargetDependency;
529 | target = 24FE17DD1EA88068006759D9 /* MyShow */;
530 | targetProxy = 24FE18031EA88069006759D9 /* PBXContainerItemProxy */;
531 | };
532 | /* End PBXTargetDependency section */
533 |
534 | /* Begin PBXVariantGroup section */
535 | 24FE17EA1EA88068006759D9 /* Main.storyboard */ = {
536 | isa = PBXVariantGroup;
537 | children = (
538 | 24FE17EB1EA88068006759D9 /* Base */,
539 | );
540 | name = Main.storyboard;
541 | sourceTree = "";
542 | };
543 | 24FE17EF1EA88068006759D9 /* LaunchScreen.storyboard */ = {
544 | isa = PBXVariantGroup;
545 | children = (
546 | 24FE17F01EA88068006759D9 /* Base */,
547 | );
548 | name = LaunchScreen.storyboard;
549 | sourceTree = "";
550 | };
551 | /* End PBXVariantGroup section */
552 |
553 | /* Begin XCBuildConfiguration section */
554 | 24FE18091EA88069006759D9 /* Debug */ = {
555 | isa = XCBuildConfiguration;
556 | buildSettings = {
557 | ALWAYS_SEARCH_USER_PATHS = NO;
558 | CLANG_ANALYZER_NONNULL = YES;
559 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
560 | CLANG_CXX_LIBRARY = "libc++";
561 | CLANG_ENABLE_MODULES = YES;
562 | CLANG_ENABLE_OBJC_ARC = YES;
563 | CLANG_WARN_BOOL_CONVERSION = YES;
564 | CLANG_WARN_CONSTANT_CONVERSION = YES;
565 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
566 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
567 | CLANG_WARN_EMPTY_BODY = YES;
568 | CLANG_WARN_ENUM_CONVERSION = YES;
569 | CLANG_WARN_INFINITE_RECURSION = YES;
570 | CLANG_WARN_INT_CONVERSION = YES;
571 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
572 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
573 | CLANG_WARN_UNREACHABLE_CODE = YES;
574 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
575 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
576 | COPY_PHASE_STRIP = NO;
577 | DEBUG_INFORMATION_FORMAT = dwarf;
578 | ENABLE_STRICT_OBJC_MSGSEND = YES;
579 | ENABLE_TESTABILITY = YES;
580 | GCC_C_LANGUAGE_STANDARD = gnu99;
581 | GCC_DYNAMIC_NO_PIC = NO;
582 | GCC_NO_COMMON_BLOCKS = YES;
583 | GCC_OPTIMIZATION_LEVEL = 0;
584 | GCC_PREPROCESSOR_DEFINITIONS = (
585 | "DEBUG=1",
586 | "$(inherited)",
587 | );
588 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
589 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
590 | GCC_WARN_UNDECLARED_SELECTOR = YES;
591 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
592 | GCC_WARN_UNUSED_FUNCTION = YES;
593 | GCC_WARN_UNUSED_VARIABLE = YES;
594 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
595 | MTL_ENABLE_DEBUG_INFO = YES;
596 | ONLY_ACTIVE_ARCH = YES;
597 | SDKROOT = iphoneos;
598 | };
599 | name = Debug;
600 | };
601 | 24FE180A1EA88069006759D9 /* Release */ = {
602 | isa = XCBuildConfiguration;
603 | buildSettings = {
604 | ALWAYS_SEARCH_USER_PATHS = NO;
605 | CLANG_ANALYZER_NONNULL = YES;
606 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
607 | CLANG_CXX_LIBRARY = "libc++";
608 | CLANG_ENABLE_MODULES = YES;
609 | CLANG_ENABLE_OBJC_ARC = YES;
610 | CLANG_WARN_BOOL_CONVERSION = YES;
611 | CLANG_WARN_CONSTANT_CONVERSION = YES;
612 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
613 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
614 | CLANG_WARN_EMPTY_BODY = YES;
615 | CLANG_WARN_ENUM_CONVERSION = YES;
616 | CLANG_WARN_INFINITE_RECURSION = YES;
617 | CLANG_WARN_INT_CONVERSION = YES;
618 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
619 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
620 | CLANG_WARN_UNREACHABLE_CODE = YES;
621 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
622 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
623 | COPY_PHASE_STRIP = NO;
624 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
625 | ENABLE_NS_ASSERTIONS = NO;
626 | ENABLE_STRICT_OBJC_MSGSEND = YES;
627 | GCC_C_LANGUAGE_STANDARD = gnu99;
628 | GCC_NO_COMMON_BLOCKS = YES;
629 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
630 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
631 | GCC_WARN_UNDECLARED_SELECTOR = YES;
632 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
633 | GCC_WARN_UNUSED_FUNCTION = YES;
634 | GCC_WARN_UNUSED_VARIABLE = YES;
635 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
636 | MTL_ENABLE_DEBUG_INFO = NO;
637 | SDKROOT = iphoneos;
638 | VALIDATE_PRODUCT = YES;
639 | };
640 | name = Release;
641 | };
642 | 24FE180C1EA88069006759D9 /* Debug */ = {
643 | isa = XCBuildConfiguration;
644 | buildSettings = {
645 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
646 | DEVELOPMENT_TEAM = 66R335K49S;
647 | GCC_PREFIX_HEADER = "$(SRCROOT)/MyShow/Classes/Configs/PrefixHeader.pch";
648 | INFOPLIST_FILE = MyShow/Info.plist;
649 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
650 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
651 | PRODUCT_BUNDLE_IDENTIFIER = com.hualuoyongheng.MyShow;
652 | PRODUCT_NAME = "$(TARGET_NAME)";
653 | };
654 | name = Debug;
655 | };
656 | 24FE180D1EA88069006759D9 /* Release */ = {
657 | isa = XCBuildConfiguration;
658 | buildSettings = {
659 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
660 | DEVELOPMENT_TEAM = 66R335K49S;
661 | GCC_PREFIX_HEADER = "$(SRCROOT)/MyShow/Classes/Configs/PrefixHeader.pch";
662 | INFOPLIST_FILE = MyShow/Info.plist;
663 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
664 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
665 | PRODUCT_BUNDLE_IDENTIFIER = com.hualuoyongheng.MyShow;
666 | PRODUCT_NAME = "$(TARGET_NAME)";
667 | };
668 | name = Release;
669 | };
670 | 24FE180F1EA88069006759D9 /* Debug */ = {
671 | isa = XCBuildConfiguration;
672 | buildSettings = {
673 | BUNDLE_LOADER = "$(TEST_HOST)";
674 | INFOPLIST_FILE = MyShowTests/Info.plist;
675 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
676 | PRODUCT_BUNDLE_IDENTIFIER = com.hualuoyongheng.MyShowTests;
677 | PRODUCT_NAME = "$(TARGET_NAME)";
678 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MyShow.app/MyShow";
679 | };
680 | name = Debug;
681 | };
682 | 24FE18101EA88069006759D9 /* Release */ = {
683 | isa = XCBuildConfiguration;
684 | buildSettings = {
685 | BUNDLE_LOADER = "$(TEST_HOST)";
686 | INFOPLIST_FILE = MyShowTests/Info.plist;
687 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
688 | PRODUCT_BUNDLE_IDENTIFIER = com.hualuoyongheng.MyShowTests;
689 | PRODUCT_NAME = "$(TARGET_NAME)";
690 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MyShow.app/MyShow";
691 | };
692 | name = Release;
693 | };
694 | 24FE18121EA88069006759D9 /* Debug */ = {
695 | isa = XCBuildConfiguration;
696 | buildSettings = {
697 | INFOPLIST_FILE = MyShowUITests/Info.plist;
698 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
699 | PRODUCT_BUNDLE_IDENTIFIER = com.hualuoyongheng.MyShowUITests;
700 | PRODUCT_NAME = "$(TARGET_NAME)";
701 | TEST_TARGET_NAME = MyShow;
702 | };
703 | name = Debug;
704 | };
705 | 24FE18131EA88069006759D9 /* Release */ = {
706 | isa = XCBuildConfiguration;
707 | buildSettings = {
708 | INFOPLIST_FILE = MyShowUITests/Info.plist;
709 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
710 | PRODUCT_BUNDLE_IDENTIFIER = com.hualuoyongheng.MyShowUITests;
711 | PRODUCT_NAME = "$(TARGET_NAME)";
712 | TEST_TARGET_NAME = MyShow;
713 | };
714 | name = Release;
715 | };
716 | /* End XCBuildConfiguration section */
717 |
718 | /* Begin XCConfigurationList section */
719 | 24FE17D91EA88068006759D9 /* Build configuration list for PBXProject "MyShow" */ = {
720 | isa = XCConfigurationList;
721 | buildConfigurations = (
722 | 24FE18091EA88069006759D9 /* Debug */,
723 | 24FE180A1EA88069006759D9 /* Release */,
724 | );
725 | defaultConfigurationIsVisible = 0;
726 | defaultConfigurationName = Release;
727 | };
728 | 24FE180B1EA88069006759D9 /* Build configuration list for PBXNativeTarget "MyShow" */ = {
729 | isa = XCConfigurationList;
730 | buildConfigurations = (
731 | 24FE180C1EA88069006759D9 /* Debug */,
732 | 24FE180D1EA88069006759D9 /* Release */,
733 | );
734 | defaultConfigurationIsVisible = 0;
735 | defaultConfigurationName = Release;
736 | };
737 | 24FE180E1EA88069006759D9 /* Build configuration list for PBXNativeTarget "MyShowTests" */ = {
738 | isa = XCConfigurationList;
739 | buildConfigurations = (
740 | 24FE180F1EA88069006759D9 /* Debug */,
741 | 24FE18101EA88069006759D9 /* Release */,
742 | );
743 | defaultConfigurationIsVisible = 0;
744 | defaultConfigurationName = Release;
745 | };
746 | 24FE18111EA88069006759D9 /* Build configuration list for PBXNativeTarget "MyShowUITests" */ = {
747 | isa = XCConfigurationList;
748 | buildConfigurations = (
749 | 24FE18121EA88069006759D9 /* Debug */,
750 | 24FE18131EA88069006759D9 /* Release */,
751 | );
752 | defaultConfigurationIsVisible = 0;
753 | defaultConfigurationName = Release;
754 | };
755 | /* End XCConfigurationList section */
756 | };
757 | rootObject = 24FE17D61EA88068006759D9 /* Project object */;
758 | }
759 |
--------------------------------------------------------------------------------