├── SZFoldawayButton ├── .DS_Store ├── SZFoldawayButton_demo │ ├── .DS_Store │ ├── backgroundStar@2x.png │ ├── foregroundStar@2x.png │ ├── SZFoldawayButton │ │ ├── .DS_Store │ │ ├── SZButton.h │ │ ├── SZButton.m │ │ ├── UIView+SZFrame.h │ │ ├── SZFoldawayModel.m │ │ ├── SZFoldawayModel.h │ │ ├── UIView+SZFrame.m │ │ ├── SZFoldawayButton.h │ │ └── SZFoldawayButton.m │ ├── AddViewController.h │ ├── AddImageController.h │ ├── AddWindowController.h │ ├── MoveLineController.h │ ├── MoveCircleController.h │ ├── FixPlaceLineController.h │ ├── FixPlaceCircleController.h │ ├── AppDelegate.h │ ├── main.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── MoveLineController.m │ ├── MoveCircleController.m │ ├── AppDelegate.m │ ├── AddImageController.m │ ├── AddViewController.m │ ├── AddWindowController.m │ ├── FixPlaceLineController.m │ └── FixPlaceCircleController.m ├── SZFoldawayButton_demo.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj ├── SZFoldawayButton_demoTests │ ├── Info.plist │ └── SZFoldawayButton_demoTests.m └── SZFoldawayButton_demoUITests │ ├── Info.plist │ └── SZFoldawayButton_demoUITests.m ├── README.md └── .gitignore /SZFoldawayButton/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanzhong538/SZFoldawayButton/HEAD/SZFoldawayButton/.DS_Store -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanzhong538/SZFoldawayButton/HEAD/SZFoldawayButton/SZFoldawayButton_demo/.DS_Store -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/backgroundStar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanzhong538/SZFoldawayButton/HEAD/SZFoldawayButton/SZFoldawayButton_demo/backgroundStar@2x.png -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/foregroundStar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanzhong538/SZFoldawayButton/HEAD/SZFoldawayButton/SZFoldawayButton_demo/foregroundStar@2x.png -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/SZFoldawayButton/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanzhong538/SZFoldawayButton/HEAD/SZFoldawayButton/SZFoldawayButton_demo/SZFoldawayButton/.DS_Store -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/AddViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AddViewController.h 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AddViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/AddImageController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AddImageController.h 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AddImageController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/AddWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AddWindowController.h 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AddWindowController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/MoveLineController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MoveLineController.h 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MoveLineController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/SZFoldawayButton/SZButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // SZButton.h 3 | // 4 | // Created by 吴三忠 on 16/5/23. 5 | // Copyright © 2016年 吴三忠. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SZButton : UIButton 11 | 12 | @property (nonatomic, assign) int index; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/MoveCircleController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MoveCircleController.h 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MoveCircleController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/FixPlaceLineController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FixPlaceLineController.h 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FixPlaceLineController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/FixPlaceCircleController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FixPlaceCircleController.h 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FixPlaceCircleController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SZFoldawayButton 2 | ================ 3 | ##折叠按钮组 4 | 5 | ![image](http://code.cocoachina.com/uploads/attachments/20160525/131156/02fccf90d25cb4bb6e54a328e8dcc2ff.gif) 6 | 7 | * 可添加到window上 8 | 9 | * 可添加到view上 10 | 11 | * 可拖拽移动 12 | 13 | * 可弧形展示 14 | 15 | * 可直线展示 16 | 17 | * 可自动计算展示方向 18 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/24. 6 | // Copyright © 2016年 吴三忠. 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 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/24. 6 | // Copyright © 2016年 吴三忠. 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 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/SZFoldawayButton/SZButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // SZButton.m 3 | // 4 | // Created by 吴三忠 on 16/5/23. 5 | // Copyright © 2016年 吴三忠. All rights reserved. 6 | // 7 | 8 | #import "SZButton.h" 9 | 10 | @implementation SZButton 11 | 12 | /* 13 | // Only override drawRect: if you perform custom drawing. 14 | // An empty implementation adversely affects performance during animation. 15 | - (void)drawRect:(CGRect)rect { 16 | // Drawing code 17 | } 18 | */ 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/SZFoldawayButton/UIView+SZFrame.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+SZFrame.h 3 | // 4 | // Created by WUSANZHONG on 15/8/6. 5 | // Copyright (c) 2015年 WUSANZHONG. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface UIView (SZFrame) 11 | 12 | @property (nonatomic, assign) CGFloat centerX; 13 | 14 | @property (nonatomic, assign) CGFloat centerY; 15 | 16 | @property (nonatomic, assign) CGFloat x; 17 | 18 | @property (nonatomic, assign) CGFloat y; 19 | 20 | @property (nonatomic, assign) CGSize size; 21 | 22 | @property (nonatomic, assign) CGPoint origin; 23 | 24 | @property (nonatomic, assign) CGFloat width; 25 | 26 | @property (nonatomic, assign) CGFloat height; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demoTests/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demoUITests/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demoTests/SZFoldawayButton_demoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SZFoldawayButton_demoTests.m 3 | // SZFoldawayButton_demoTests 4 | // 5 | // Created by 吴三忠 on 16/5/24. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SZFoldawayButton_demoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SZFoldawayButton_demoTests 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 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/SZFoldawayButton/SZFoldawayModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // SZFoldawayModel.m 3 | // SZGesture_test 4 | // 5 | // Created by 吴三忠 on 16/5/24. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import "SZFoldawayModel.h" 10 | 11 | @implementation SZFoldawayModel 12 | 13 | - (instancetype)initWithmMainBtnTitle:(NSString *)title selectTitle:(NSString *)selectTitle backColor:(UIColor *)color image:(NSString *)image selectImage:(NSString *)selectImage { 14 | 15 | self = [super init]; 16 | 17 | self.mainBtnTitle = title; 18 | self.mainBtnSelectTitle = selectTitle; 19 | self.mainBtnColor = color; 20 | self.mainBtnImage = image; 21 | self.mainBtnSelectImage = selectImage; 22 | 23 | return self; 24 | } 25 | 26 | - (instancetype)initWithmMainBtnTitle:(NSString *)title selectTitle:(NSString *)selectTitle backColor:(UIColor *)color { 27 | 28 | return [self initWithmMainBtnTitle:title selectTitle:selectTitle backColor:color image:nil selectImage:nil]; 29 | } 30 | 31 | - (instancetype)initWithmMainBtnTitle:(NSString *)title selectTitle:(NSString *)selectTitle image:(NSString *)image selectImage:(NSString *)selectImage { 32 | 33 | return [self initWithmMainBtnTitle:title selectTitle:selectTitle backColor:nil image:image selectImage:selectImage]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demoUITests/SZFoldawayButton_demoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SZFoldawayButton_demoUITests.m 3 | // SZFoldawayButton_demoUITests 4 | // 5 | // Created by 吴三忠 on 16/5/24. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SZFoldawayButton_demoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SZFoldawayButton_demoUITests 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 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarHidden 34 | 35 | UIStatusBarStyle 36 | UIStatusBarStyleLightContent 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/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 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/SZFoldawayButton/SZFoldawayModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // SZFoldawayModel.h 3 | // SZGesture_test 4 | // 5 | // Created by 吴三忠 on 16/5/24. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SZFoldawayModel : NSObject 12 | 13 | /** 14 | * 主按钮名 15 | */ 16 | @property (nonatomic, copy) NSString *mainBtnTitle; 17 | 18 | /** 19 | * 主按钮选择显示名 20 | */ 21 | @property (nonatomic, copy) NSString *mainBtnSelectTitle; 22 | 23 | /** 24 | * 主按钮背景图片 25 | */ 26 | @property (nonatomic, copy) NSString *mainBtnImage; 27 | 28 | /** 29 | * 主按钮选择背景图片 30 | */ 31 | @property (nonatomic, copy) NSString *mainBtnSelectImage; 32 | 33 | /** 34 | * 主按钮背景颜色 35 | */ 36 | @property (nonatomic, strong) UIColor *mainBtnColor; 37 | 38 | /** 39 | * 子按钮名数组 40 | */ 41 | @property (nonatomic, strong) NSArray *subBtnTitles; 42 | 43 | /** 44 | * 子按钮选择名数组 45 | */ 46 | @property (nonatomic, strong) NSArray *subBtnSelectTitles; 47 | 48 | /** 49 | * 子按钮背景颜色 50 | */ 51 | @property (nonatomic, strong) NSArray *subBtnColors; 52 | 53 | /** 54 | * 子按钮背景图片 55 | */ 56 | @property (nonatomic, strong) NSArray *subBtnImages; 57 | 58 | /** 59 | * 子按钮选择背景图片 60 | */ 61 | @property (nonatomic, strong) NSArray *subBtnSelectImages; 62 | 63 | /** 64 | * 子按钮高亮背景图片 65 | */ 66 | @property (nonatomic, strong) NSArray *subBtnHighLightImages; 67 | 68 | 69 | - (instancetype)initWithmMainBtnTitle:(NSString *)title selectTitle:(NSString *)selectTitle backColor:(UIColor *)color image:(NSString *)image selectImage:(NSString *)selectImage; 70 | 71 | - (instancetype)initWithmMainBtnTitle:(NSString *)title selectTitle:(NSString *)selectTitle backColor:(UIColor *)color; 72 | 73 | - (instancetype)initWithmMainBtnTitle:(NSString *)title selectTitle:(NSString *)selectTitle image:(NSString *)image selectImage:(NSString *)selectImage; 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/MoveLineController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MoveLineController.m 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import "MoveLineController.h" 10 | #import "SZFoldawayButton.h" 11 | 12 | @interface MoveLineController () 13 | 14 | @property (nonatomic, strong) SZFoldawayButton *szBtn; 15 | 16 | @end 17 | 18 | @implementation MoveLineController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | SZFoldawayModel *model = [[SZFoldawayModel alloc] initWithmMainBtnTitle:@"动" selectTitle:@"返" backColor:[UIColor redColor]]; 24 | model.subBtnTitles = @[@"我", @"就", @"是", @"按", @"钮"]; 25 | model.subBtnColors = @[[UIColor purpleColor], [UIColor greenColor], [UIColor blueColor], [UIColor orangeColor], [UIColor lightGrayColor]]; 26 | 27 | self.szBtn = [[SZFoldawayButton alloc] initWithRect:CGRectMake(0, 100, 40, 40) andFoldAwayModel:model]; 28 | self.szBtn.showType = showTypeOfLine; 29 | self.szBtn.automaticShowDirection = YES; 30 | self.szBtn.disperseDistance = 60; 31 | [self.szBtn showInView:self.view]; 32 | self.szBtn.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 33 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 34 | }; 35 | 36 | } 37 | 38 | - (void)didReceiveMemoryWarning { 39 | [super didReceiveMemoryWarning]; 40 | // Dispose of any resources that can be recreated. 41 | } 42 | 43 | - (IBAction)dismiss:(id)sender { 44 | 45 | [self.szBtn remove]; 46 | [self dismissViewControllerAnimated:YES completion:nil]; 47 | } 48 | 49 | /* 50 | #pragma mark - Navigation 51 | 52 | // In a storyboard-based application, you will often want to do a little preparation before navigation 53 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 54 | // Get the new view controller using [segue destinationViewController]. 55 | // Pass the selected object to the new view controller. 56 | } 57 | */ 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/MoveCircleController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MoveCircleController.m 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import "MoveCircleController.h" 10 | #import "SZFoldawayButton.h" 11 | 12 | @interface MoveCircleController () 13 | 14 | @property (nonatomic, strong) SZFoldawayButton *szBtn; 15 | 16 | @end 17 | 18 | @implementation MoveCircleController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | SZFoldawayModel *model = [[SZFoldawayModel alloc] initWithmMainBtnTitle:@"动" selectTitle:@"返" backColor:[UIColor redColor]]; 24 | model.subBtnTitles = @[@"我", @"就", @"是", @"按", @"钮"]; 25 | model.subBtnColors = @[[UIColor purpleColor], [UIColor greenColor], [UIColor blueColor], [UIColor orangeColor], [UIColor lightGrayColor]]; 26 | 27 | self.szBtn = [[SZFoldawayButton alloc] initWithRect:CGRectMake(0, 100, 40, 40) andFoldAwayModel:model]; 28 | self.szBtn.showType = showTypeOfCircle; 29 | self.szBtn.automaticShowDirection = YES; 30 | self.szBtn.disperseDistance = 100; 31 | [self.szBtn showInView:self.view]; 32 | self.szBtn.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 33 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 34 | }; 35 | 36 | } 37 | 38 | - (void)didReceiveMemoryWarning { 39 | [super didReceiveMemoryWarning]; 40 | // Dispose of any resources that can be recreated. 41 | } 42 | 43 | - (IBAction)dismiss:(id)sender { 44 | 45 | [self.szBtn remove]; 46 | [self dismissViewControllerAnimated:YES completion:nil]; 47 | } 48 | 49 | /* 50 | #pragma mark - Navigation 51 | 52 | // In a storyboard-based application, you will often want to do a little preparation before navigation 53 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 54 | // Get the new view controller using [segue destinationViewController]. 55 | // Pass the selected object to the new view controller. 56 | } 57 | */ 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/24. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/SZFoldawayButton/UIView+SZFrame.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+SZFrame.m 3 | // 4 | // Created by WUSANZHONG on 15/8/6. 5 | // Copyright (c) 2015年 WUSANZHONG. All rights reserved. 6 | // 7 | 8 | #import "UIView+SZFrame.h" 9 | 10 | @implementation UIView (SZFrame) 11 | 12 | 13 | - (CGFloat)centerX{ 14 | 15 | return self.center.x; 16 | } 17 | 18 | //修改中心点center的x 19 | - (void)setCenterX:(CGFloat)centerX{ 20 | 21 | CGPoint center = self.center; 22 | 23 | center.x = centerX; 24 | 25 | self.center = center; 26 | } 27 | 28 | - (CGFloat)centerY{ 29 | 30 | return self.center.y; 31 | } 32 | 33 | //修改中心点center的y 34 | - (void)setCenterY:(CGFloat)centerY{ 35 | 36 | CGPoint center = self.center; 37 | 38 | center.y = centerY; 39 | 40 | self.center = center; 41 | } 42 | 43 | - (CGFloat)x{ 44 | 45 | return self.frame.origin.x; 46 | } 47 | 48 | //修改frame的x值 49 | - (void)setX:(CGFloat)x{ 50 | 51 | CGRect frame = self.frame; 52 | 53 | frame.origin.x = x; 54 | 55 | self.frame = frame; 56 | } 57 | 58 | - (CGFloat)y{ 59 | 60 | return self.frame.origin.y; 61 | } 62 | 63 | //修改frame的y值 64 | - (void)setY:(CGFloat)y{ 65 | 66 | CGRect frame = self.frame; 67 | 68 | frame.origin.y = y; 69 | 70 | self.frame = frame; 71 | } 72 | 73 | //修改frame的size 74 | - (CGSize)size{ 75 | 76 | return self.frame.size; 77 | } 78 | 79 | - (void)setSize:(CGSize)size{ 80 | 81 | CGRect frame = self.frame; 82 | 83 | frame.size = size; 84 | 85 | self.frame = frame; 86 | } 87 | 88 | //修改frame的origin 89 | - (CGPoint)origin{ 90 | 91 | return self.frame.origin; 92 | } 93 | 94 | - (void)setOrigin:(CGPoint)origin{ 95 | 96 | CGRect frame = self.frame; 97 | 98 | frame.origin = origin; 99 | 100 | self.frame = frame; 101 | } 102 | 103 | //修改frame的width 104 | - (CGFloat)width{ 105 | 106 | return self.frame.size.width; 107 | } 108 | 109 | - (void)setWidth:(CGFloat)width{ 110 | 111 | CGRect frame = self.frame; 112 | 113 | frame.size.width = width; 114 | 115 | self.frame = frame; 116 | } 117 | 118 | //修改frame的height 119 | - (CGFloat)height{ 120 | 121 | return self.frame.size.height; 122 | } 123 | 124 | - (void)setHeight:(CGFloat)height{ 125 | 126 | CGRect frame = self.frame; 127 | 128 | frame.size.height = height; 129 | 130 | self.frame = frame; 131 | } 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/AddImageController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AddImageController.m 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import "AddImageController.h" 10 | #import "SZFoldawayButton.h" 11 | 12 | @interface AddImageController () 13 | 14 | @property (nonatomic, strong) SZFoldawayButton *szBtn; 15 | @property (nonatomic, strong) SZFoldawayButton *szBtn1; 16 | 17 | @end 18 | 19 | @implementation AddImageController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | SZFoldawayModel *model = [[SZFoldawayModel alloc] initWithmMainBtnTitle:@"动" selectTitle:@"返" backColor:[UIColor redColor]]; 25 | // model.subBtnTitles = @[@"我", @"就", @"是", @"按", @"钮"]; 26 | model.subBtnImages = @[@"foregroundStar", @"foregroundStar", @"foregroundStar", @"foregroundStar", @"foregroundStar"]; 27 | model.subBtnSelectImages = @[@"backgroundStar", @"backgroundStar", @"backgroundStar", @"backgroundStar", @"backgroundStar"]; 28 | 29 | self.szBtn = [[SZFoldawayButton alloc] initWithRect:CGRectMake(0, 100, 40, 40) andFoldAwayModel:model]; 30 | self.szBtn.showType = showTypeOfLine; 31 | self.szBtn.automaticShowDirection = YES; 32 | self.szBtn.disperseDistance = 60; 33 | [self.szBtn showInView:self.view]; 34 | self.szBtn.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 35 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 36 | }; 37 | 38 | self.szBtn1 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(self.view.frame.size.width - 40, 100, 40, 40) andFoldAwayModel:model]; 39 | self.szBtn1.showType = showTypeOfCircle; 40 | self.szBtn1.automaticShowDirection = YES; 41 | self.szBtn1.disperseDistance = 160; 42 | [self.szBtn1 showInView:self.view]; 43 | self.szBtn1.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 44 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 45 | }; 46 | } 47 | 48 | - (IBAction)dismiss:(id)sender { 49 | 50 | [self.szBtn remove]; 51 | [self.szBtn1 remove]; 52 | [self dismissViewControllerAnimated:YES completion:nil]; 53 | } 54 | 55 | - (void)didReceiveMemoryWarning { 56 | [super didReceiveMemoryWarning]; 57 | // Dispose of any resources that can be recreated. 58 | } 59 | 60 | /* 61 | #pragma mark - Navigation 62 | 63 | // In a storyboard-based application, you will often want to do a little preparation before navigation 64 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 65 | // Get the new view controller using [segue destinationViewController]. 66 | // Pass the selected object to the new view controller. 67 | } 68 | */ 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/AddViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AddViewController.m 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import "AddViewController.h" 10 | #import "SZFoldawayButton.h" 11 | 12 | @interface AddViewController () 13 | 14 | @property (nonatomic, strong) SZFoldawayButton *szBtn; 15 | @property (nonatomic, strong) SZFoldawayButton *szBtn1; 16 | 17 | @end 18 | 19 | @implementation AddViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | SZFoldawayModel *model = [[SZFoldawayModel alloc] initWithmMainBtnTitle:@"动" selectTitle:@"返" backColor:[UIColor redColor]]; 25 | model.subBtnTitles = @[@"我", @"就", @"是", @"按", @"钮"]; 26 | model.subBtnColors = @[[UIColor purpleColor]]; 27 | 28 | // 有弹簧效果 默认 29 | self.szBtn1 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(self.view.frame.size.width - 40, 100, 40, 40) andFoldAwayModel:model]; 30 | self.szBtn1.showType = showTypeOfCircle; 31 | self.szBtn1.showSuperViewCenter = YES; 32 | [self.szBtn1 showInView:self.view navigationBar:YES tabBar:YES]; 33 | self.szBtn1.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 34 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 35 | }; 36 | 37 | // 没有弹簧效果 38 | model.mainBtnTitle = @"静"; 39 | model.mainBtnSelectTitle = @"返"; 40 | self.szBtn = [[SZFoldawayButton alloc] initWithRect:CGRectMake(0, 400, 40, 40) andFoldAwayModel:model]; 41 | self.szBtn.showType = showTypeOfCircle; 42 | self.szBtn.showSuperViewCenter = YES; 43 | self.szBtn.showWithSpring = NO; 44 | self.szBtn.canBeMoved = NO; 45 | [self.szBtn showInView:self.view navigationBar:YES tabBar:YES]; 46 | self.szBtn.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 47 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 48 | }; 49 | 50 | } 51 | 52 | - (void)didReceiveMemoryWarning { 53 | [super didReceiveMemoryWarning]; 54 | // Dispose of any resources that can be recreated. 55 | } 56 | 57 | - (void)viewWillDisappear:(BOOL)animated { 58 | 59 | [super viewWillDisappear:animated]; 60 | } 61 | 62 | - (IBAction)dismiss:(id)sender { 63 | 64 | [self.szBtn remove]; 65 | [self.szBtn1 remove]; 66 | [self dismissViewControllerAnimated:YES completion:nil]; 67 | } 68 | 69 | /* 70 | #pragma mark - Navigation 71 | 72 | // In a storyboard-based application, you will often want to do a little preparation before navigation 73 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 74 | // Get the new view controller using [segue destinationViewController]. 75 | // Pass the selected object to the new view controller. 76 | } 77 | */ 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/AddWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AddWindowController.m 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import "AddWindowController.h" 10 | #import "SZFoldawayButton.h" 11 | 12 | @interface AddWindowController () 13 | 14 | @property (nonatomic, strong) SZFoldawayButton *szBtn; 15 | @property (nonatomic, strong) SZFoldawayButton *szBtn1; 16 | 17 | @end 18 | 19 | @implementation AddWindowController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | SZFoldawayModel *model = [[SZFoldawayModel alloc] initWithmMainBtnTitle:@"动" selectTitle:@"返" backColor:[UIColor redColor]]; 25 | model.subBtnTitles = @[@"我", @"就", @"是", @"按", @"钮"]; 26 | model.subBtnColors = @[[UIColor purpleColor], [UIColor greenColor], [UIColor blueColor], [UIColor orangeColor], [UIColor lightGrayColor]]; 27 | 28 | // 有弹簧效果 默认 29 | self.szBtn1 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(self.view.frame.size.width - 40, 100, 40, 40) andFoldAwayModel:model]; 30 | self.szBtn1.showType = showTypeOfCircle; 31 | self.szBtn1.showSuperViewCenter = YES; 32 | [self.szBtn1 show]; 33 | __weak typeof(self) weakSelf = self; 34 | self.szBtn1.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 35 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 36 | 37 | if (index == 0 || index == 1) { 38 | UIViewController *vc = [[UIViewController alloc] init]; 39 | vc.view.backgroundColor = [UIColor whiteColor]; 40 | [weakSelf.navigationController pushViewController:vc animated:YES]; 41 | } 42 | else { 43 | 44 | [weakSelf.navigationController popViewControllerAnimated:YES]; 45 | } 46 | }; 47 | 48 | // 没有弹簧效果 49 | model.mainBtnTitle = @"静"; 50 | model.mainBtnSelectTitle = @"返"; 51 | self.szBtn = [[SZFoldawayButton alloc] initWithRect:CGRectMake(0, 100, 40, 40) andFoldAwayModel:model]; 52 | self.szBtn.showType = showTypeOfCircle; 53 | self.szBtn.showSuperViewCenter = YES; 54 | self.szBtn.showWithSpring = NO; 55 | self.szBtn.canBeMoved = NO; 56 | [self.szBtn show]; 57 | self.szBtn.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 58 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 59 | 60 | if (index == 0 || index == 1) { 61 | UIViewController *vc = [[UIViewController alloc] init]; 62 | vc.view.backgroundColor = [UIColor whiteColor]; 63 | [weakSelf.navigationController pushViewController:vc animated:YES]; 64 | } 65 | else { 66 | 67 | [weakSelf.navigationController popViewControllerAnimated:YES]; 68 | } 69 | }; 70 | } 71 | 72 | - (void)didReceiveMemoryWarning { 73 | [super didReceiveMemoryWarning]; 74 | // Dispose of any resources that can be recreated. 75 | } 76 | 77 | - (void)viewWillDisappear:(BOOL)animated { 78 | 79 | [super viewWillDisappear:animated]; 80 | 81 | // [self.szBtn remove]; 82 | // [self.szBtn1 remove]; 83 | } 84 | 85 | - (IBAction)dismiss:(id)sender { 86 | 87 | [self.szBtn remove]; 88 | [self.szBtn1 remove]; 89 | [self dismissViewControllerAnimated:YES completion:nil]; 90 | } 91 | 92 | /* 93 | #pragma mark - Navigation 94 | 95 | // In a storyboard-based application, you will often want to do a little preparation before navigation 96 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 97 | // Get the new view controller using [segue destinationViewController]. 98 | // Pass the selected object to the new view controller. 99 | } 100 | */ 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/FixPlaceLineController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FixPlaceLineController.m 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import "FixPlaceLineController.h" 10 | #import "SZFoldawayButton.h" 11 | 12 | @interface FixPlaceLineController () 13 | 14 | @property (nonatomic, strong) SZFoldawayButton *szBtn; 15 | @property (nonatomic, strong) SZFoldawayButton *szBtn1; 16 | @property (nonatomic, strong) SZFoldawayButton *szBtn2; 17 | @property (nonatomic, strong) SZFoldawayButton *szBtn3; 18 | 19 | @end 20 | 21 | @implementation FixPlaceLineController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | 26 | SZFoldawayModel *model = [[SZFoldawayModel alloc] initWithmMainBtnTitle:@"静" selectTitle:@"返" backColor:[UIColor redColor]]; 27 | model.subBtnTitles = @[@"我", @"就", @"是", @"按", @"钮"]; 28 | model.subBtnColors = @[[UIColor purpleColor], [UIColor greenColor], [UIColor blueColor], [UIColor orangeColor], [UIColor lightGrayColor]]; 29 | 30 | self.szBtn = [[SZFoldawayButton alloc] initWithRect:CGRectMake(0, 100, 40, 40) andFoldAwayModel:model]; 31 | self.szBtn.showType = showTypeOfLine; 32 | self.szBtn.lineShowDirection = lineShowDirectionDown; 33 | self.szBtn.canBeMoved = NO; 34 | self.szBtn.disperseDistance = 100; 35 | [self.szBtn showInView:self.view]; 36 | self.szBtn.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 37 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 38 | }; 39 | 40 | self.szBtn1 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(self.view.frame.size.width - 40, 100, 40, 40) andFoldAwayModel:model]; 41 | self.szBtn1.showType = showTypeOfLine; 42 | self.szBtn1.lineShowDirection = lineShowDirectionLeft; 43 | self.szBtn1.canBeMoved = NO; 44 | self.szBtn1.disperseDistance = 50; 45 | [self.szBtn1 showInView:self.view]; 46 | self.szBtn1.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 47 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 48 | }; 49 | self.szBtn2 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(0, self.view.frame.size.height - 150, 40, 40) andFoldAwayModel:model]; 50 | self.szBtn2.showType = showTypeOfLine; 51 | self.szBtn2.lineShowDirection = lineShowDirectionRight; 52 | self.szBtn2.canBeMoved = NO; 53 | self.szBtn2.disperseDistance = 50; 54 | [self.szBtn2 showInView:self.view]; 55 | self.szBtn2.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 56 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 57 | }; 58 | 59 | self.szBtn3 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(self.view.frame.size.width - 40, self.view.frame.size.height - 150, 40, 40) andFoldAwayModel:model]; 60 | self.szBtn3.showType = showTypeOfLine; 61 | self.szBtn3.lineShowDirection = lineShowDirectionUp; 62 | self.szBtn3.canBeMoved = NO; 63 | self.szBtn3.disperseDistance = 100; 64 | [self.szBtn3 showInView:self.view]; 65 | self.szBtn3.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 66 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 67 | }; 68 | } 69 | 70 | - (void)didReceiveMemoryWarning { 71 | [super didReceiveMemoryWarning]; 72 | // Dispose of any resources that can be recreated. 73 | } 74 | 75 | - (IBAction)dismiss:(id)sender { 76 | 77 | [self.szBtn remove]; 78 | [self.szBtn1 remove]; 79 | [self.szBtn2 remove]; 80 | [self.szBtn3 remove]; 81 | [self dismissViewControllerAnimated:YES completion:nil]; 82 | } 83 | 84 | /* 85 | #pragma mark - Navigation 86 | 87 | // In a storyboard-based application, you will often want to do a little preparation before navigation 88 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 89 | // Get the new view controller using [segue destinationViewController]. 90 | // Pass the selected object to the new view controller. 91 | } 92 | */ 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/SZFoldawayButton/SZFoldawayButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // SZFoldawayButton.h 3 | // SZGesture_test 4 | // 5 | // Created by 吴三忠 on 16/5/23. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SZFoldawayModel.h" 11 | 12 | typedef void(^clickSubButtonBack)(int index, NSString * title, BOOL select); 13 | 14 | typedef NS_ENUM(NSInteger, ShowType) { 15 | 16 | showTypeOfLine = 1, 17 | showTypeOfCircle 18 | }; 19 | 20 | typedef NS_ENUM(NSInteger, LineShowDirection){ 21 | 22 | lineShowDirectionLeft = 1, 23 | lineShowDirectionRight, 24 | lineShowDirectionUp, 25 | lineShowDirectionDown 26 | }; 27 | 28 | typedef NS_ENUM(NSInteger, CircleShowDirection){ 29 | 30 | circleShowDirectionLeft = 1, 31 | circleShowDirectionRight, 32 | circleShowDirectionUp, 33 | circleShowDirectionDown, 34 | circleShowDirectionRightDown, 35 | circleShowDirectionRightUp, 36 | circleShowDirectionLeftUp, 37 | circleShowDirectionLeftDown 38 | }; 39 | 40 | @interface SZFoldawayButton : UIView 41 | 42 | /** 43 | * 能否被拖拽,默认为YES 44 | */ 45 | @property (nonatomic, assign) BOOL canBeMoved; 46 | 47 | /** 48 | * 显示在父视图正中 49 | */ 50 | @property (nonatomic, assign) BOOL showSuperViewCenter; 51 | 52 | /** 53 | * 显示类型 54 | */ 55 | @property (nonatomic, assign) ShowType showType; 56 | 57 | /** 58 | * 直线显示方向 59 | */ 60 | @property (nonatomic, assign) LineShowDirection lineShowDirection; 61 | 62 | /** 63 | * 圆形显示方向 64 | */ 65 | @property (nonatomic, assign) CircleShowDirection circleShowDirection; 66 | 67 | /** 68 | * 散开按钮和主按钮之间的距离 69 | */ 70 | @property (nonatomic, assign) CGFloat disperseDistance; 71 | 72 | /** 73 | * 自动显示方向,如要设置距离,必须在自动之前设置 74 | */ 75 | @property (nonatomic, assign) BOOL automaticShowDirection; 76 | 77 | /** 78 | * 是否添加弹簧效果,默认为YES 79 | */ 80 | @property (nonatomic, assign) BOOL showWithSpring; 81 | 82 | /** 83 | * 按钮点击 84 | */ 85 | @property (nonatomic, copy) clickSubButtonBack clickSubButtonBack; 86 | 87 | /** 88 | * 构造方法 89 | * 90 | * @param rect rect 91 | * @param foldAwayModel foldAwayModel模型 92 | * 93 | * @return 94 | */ 95 | - (instancetype)initWithRect:(CGRect)rect andFoldAwayModel:(SZFoldawayModel *)foldAwayModel; 96 | 97 | /** 98 | * 构造方法 99 | * 100 | * @param rect rect 101 | * @param title 按钮名 102 | * @param color 按钮颜色 103 | * @param titlesArray 展示按钮名数组 104 | * @param colors 展示按钮颜色数组 105 | * 106 | * @return 107 | */ 108 | - (instancetype)initWithRect:(CGRect)rect mainButtonTitle:(NSString *)title mainButtonColor:(UIColor *)color titlesArray:(NSArray *)titlesArray colors:(NSArray *)colors; 109 | /** 110 | * 构造方法 111 | * 112 | * @param rect rect 113 | * @param title 按钮名 114 | * @param selectTitle 选择后按钮名 115 | * @param color 按钮颜色 116 | * @param titlesArray 展示按钮名数组 117 | * @param colors 展示按钮颜色数组 118 | * 119 | * @return 120 | */ 121 | - (instancetype)initWithRect:(CGRect)rect mainButtonTitle:(NSString *)title selectTitle:(NSString *)selectTitle mainButtonColor:(UIColor *)color titlesArray:(NSArray *)titlesArray colors:(NSArray *)colors; 122 | 123 | /** 124 | * 构造方法 125 | * 126 | * @param rect rect 127 | * @param title 按钮名 128 | * @param selectTitle 选择后按钮名 129 | * @param color 按钮颜色 130 | * @param titlesArray 展示按钮名数组 131 | * @param selectTitlesArray 展示按钮选择后显示名数组 132 | * @param colors 展示按钮颜色数组 133 | * 134 | * @return 135 | */ 136 | - (instancetype)initWithRect:(CGRect)rect mainButtonTitle:(NSString *)title selectTitle:(NSString *)selectTitle mainButtonColor:(UIColor *)color titlesArray:(NSArray *)titlesArray selectTitlesArray:(NSArray *)selectTitlesArray colors:(NSArray *)colors; 137 | 138 | /** 139 | * 默认显示在Window上 140 | */ 141 | - (void)show; 142 | 143 | /** 144 | * 指定视图显示 145 | * 146 | * @param view 指定的视图 147 | */ 148 | - (void)showInView:(UIView *)view; 149 | 150 | /** 151 | * 指定视图显示,并且指出是否有NavigationBar、TabBar 152 | * 153 | * @param view 指定的视图 154 | * @param haveNavigationBar 是否包含NavigationBar 155 | * @param haveTabBar 是否包含TabBar 156 | */ 157 | - (void)showInView:(UIView *)view navigationBar:(BOOL)haveNavigationBar tabBar:(BOOL)haveTabBar; 158 | 159 | /** 160 | * 移除 161 | */ 162 | - (void)remove; 163 | 164 | @end 165 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/FixPlaceCircleController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FixPlaceCircleController.m 3 | // SZFoldawayButton_demo 4 | // 5 | // Created by 吴三忠 on 16/5/25. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import "FixPlaceCircleController.h" 10 | #import "SZFoldawayButton.h" 11 | 12 | @interface FixPlaceCircleController () 13 | 14 | @property (nonatomic, strong) SZFoldawayButton *szBtn; 15 | @property (nonatomic, strong) SZFoldawayButton *szBtn1; 16 | @property (nonatomic, strong) SZFoldawayButton *szBtn2; 17 | @property (nonatomic, strong) SZFoldawayButton *szBtn3; 18 | @property (nonatomic, strong) SZFoldawayButton *szBtn4; 19 | @property (nonatomic, strong) SZFoldawayButton *szBtn5; 20 | @property (nonatomic, strong) SZFoldawayButton *szBtn6; 21 | @property (nonatomic, strong) SZFoldawayButton *szBtn7; 22 | 23 | @end 24 | 25 | @implementation FixPlaceCircleController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | 30 | 31 | SZFoldawayModel *model = [[SZFoldawayModel alloc] initWithmMainBtnTitle:@"静" selectTitle:@"返" backColor:[UIColor redColor]]; 32 | model.subBtnTitles = @[@"我", @"就", @"是", @"按", @"钮"]; 33 | model.subBtnColors = @[[UIColor purpleColor]]; 34 | 35 | self.szBtn = [[SZFoldawayButton alloc] initWithRect:CGRectMake(0, 100, 40, 40) andFoldAwayModel:model]; 36 | self.szBtn.showType = showTypeOfCircle; 37 | self.szBtn.circleShowDirection = circleShowDirectionRightDown; 38 | self.szBtn.canBeMoved = NO; 39 | self.szBtn.disperseDistance = 100; 40 | [self.szBtn showInView:self.view navigationBar:YES tabBar:YES]; 41 | self.szBtn.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 42 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 43 | }; 44 | 45 | self.szBtn1 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(self.view.frame.size.width - 40, 100, 40, 40) andFoldAwayModel:model]; 46 | self.szBtn1.showType = showTypeOfCircle; 47 | self.szBtn1.circleShowDirection = circleShowDirectionLeftDown; 48 | self.szBtn1.canBeMoved = NO; 49 | self.szBtn1.disperseDistance = 100; 50 | [self.szBtn1 showInView:self.view navigationBar:YES tabBar:YES]; 51 | self.szBtn1.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 52 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 53 | }; 54 | self.szBtn4 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(0, self.view.center.y, 40, 40) andFoldAwayModel:model]; 55 | self.szBtn4.showType = showTypeOfCircle; 56 | self.szBtn4.circleShowDirection = circleShowDirectionRight; 57 | self.szBtn4.canBeMoved = NO; 58 | self.szBtn4.disperseDistance = 100; 59 | [self.szBtn4 showInView:self.view navigationBar:YES tabBar:YES]; 60 | self.szBtn4.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 61 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 62 | }; 63 | 64 | self.szBtn5 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(self.view.center.x - 20, 100, 40, 40) andFoldAwayModel:model]; 65 | self.szBtn5.showType = showTypeOfCircle; 66 | self.szBtn5.circleShowDirection = circleShowDirectionDown; 67 | self.szBtn5.canBeMoved = NO; 68 | self.szBtn5.disperseDistance = 100; 69 | [self.szBtn5 showInView:self.view navigationBar:YES tabBar:YES]; 70 | self.szBtn5.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 71 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 72 | }; 73 | 74 | model.subBtnTitles = @[@"我", @"是", @"按", @"钮"]; 75 | model.subBtnColors = @[[UIColor orangeColor]]; 76 | self.szBtn2 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(self.view.frame.size.width - 40, self.view.frame.size.height - 150, 40, 40) andFoldAwayModel:model]; 77 | self.szBtn2.showType = showTypeOfCircle; 78 | self.szBtn2.circleShowDirection = circleShowDirectionLeftUp; 79 | self.szBtn2.canBeMoved = NO; 80 | self.szBtn2.disperseDistance = 150; 81 | [self.szBtn2 showInView:self.view navigationBar:YES tabBar:YES]; 82 | self.szBtn2.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 83 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 84 | }; 85 | 86 | model.subBtnColors = @[[UIColor blueColor]]; 87 | self.szBtn3 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(0, self.view.frame.size.height - 150, 40, 40) andFoldAwayModel:model]; 88 | self.szBtn3.showType = showTypeOfCircle; 89 | self.szBtn3.circleShowDirection = circleShowDirectionRightUp; 90 | self.szBtn3.canBeMoved = NO; 91 | self.szBtn3.disperseDistance = 60; 92 | [self.szBtn3 showInView:self.view navigationBar:YES tabBar:YES]; 93 | self.szBtn3.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 94 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 95 | }; 96 | 97 | self.szBtn6 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(self.view.frame.size.width - 40, self.view.center.y, 40, 40) andFoldAwayModel:model]; 98 | self.szBtn6.showType = showTypeOfCircle; 99 | self.szBtn6.circleShowDirection = circleShowDirectionLeft; 100 | self.szBtn6.canBeMoved = NO; 101 | self.szBtn6.disperseDistance = 80; 102 | [self.szBtn6 showInView:self.view navigationBar:YES tabBar:YES]; 103 | self.szBtn6.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 104 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 105 | }; 106 | 107 | self.szBtn7 = [[SZFoldawayButton alloc] initWithRect:CGRectMake(self.view.center.x - 20, self.view.frame.size.height - 150, 40, 40) andFoldAwayModel:model]; 108 | self.szBtn7.showType = showTypeOfCircle; 109 | self.szBtn7.circleShowDirection = circleShowDirectionUp; 110 | self.szBtn7.canBeMoved = NO; 111 | self.szBtn7.disperseDistance = 80; 112 | [self.szBtn7 showInView:self.view navigationBar:YES tabBar:YES]; 113 | self.szBtn7.clickSubButtonBack = ^(int index, NSString *title, BOOL select){ 114 | NSLog(@"%zd -- %@ -- %zd", index, title, select); 115 | }; 116 | } 117 | 118 | - (void)didReceiveMemoryWarning { 119 | [super didReceiveMemoryWarning]; 120 | // Dispose of any resources that can be recreated. 121 | } 122 | 123 | - (IBAction)dismiss:(id)sender { 124 | 125 | [self.szBtn remove]; 126 | [self.szBtn1 remove]; 127 | [self.szBtn2 remove]; 128 | [self.szBtn3 remove]; 129 | [self.szBtn4 remove]; 130 | [self.szBtn5 remove]; 131 | [self.szBtn6 remove]; 132 | [self.szBtn7 remove]; 133 | [self dismissViewControllerAnimated:YES completion:nil]; 134 | } 135 | 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/SZFoldawayButton/SZFoldawayButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // SZFoldawayButton.m 3 | // SZGesture_test 4 | // 5 | // Created by 吴三忠 on 16/5/23. 6 | // Copyright © 2016年 吴三忠. All rights reserved. 7 | // 8 | 9 | #import "SZFoldawayButton.h" 10 | #import "UIView+SZFrame.h" 11 | #import "SZButton.h" 12 | 13 | @interface SZFoldawayButton () 14 | 15 | @property (nonatomic, assign) CGFloat topDistance; 16 | @property (nonatomic, assign) CGFloat bottomDistance; 17 | @property (nonatomic, assign) CGRect rect; 18 | @property (nonatomic, copy) NSString *btnTitle; 19 | @property (nonatomic, copy) NSString *selectTitle; 20 | @property (nonatomic, strong) UIColor *btnColor; 21 | @property (nonatomic, copy) NSString *btnImage; 22 | @property (nonatomic, copy) NSString *btnSelectImage; 23 | @property (nonatomic, strong) UIButton *mainBtn; 24 | @property (nonatomic, strong) UIButton *coverBtn; 25 | @property (nonatomic, strong) NSArray *colors; 26 | @property (nonatomic, strong) NSArray *btnsArray; 27 | @property (nonatomic, strong) NSArray *titlesArray; 28 | @property (nonatomic, strong) NSArray *selectTitlesAarray; 29 | @property (nonatomic, strong) NSArray *subBtnImages; 30 | @property (nonatomic, strong) NSArray *subBtnSelectImages; 31 | @property (nonatomic, strong) NSArray *subBtnHighLightImages; 32 | @property (nonatomic, strong) UIPanGestureRecognizer *pan; 33 | 34 | @end 35 | 36 | @implementation SZFoldawayButton 37 | 38 | 39 | #pragma mark - 构造 40 | 41 | - (instancetype)initWithRect:(CGRect)rect andFoldAwayModel:(SZFoldawayModel *)foldAwayModel { 42 | 43 | self = [super initWithFrame:rect]; 44 | 45 | self.canBeMoved = YES; 46 | self.showWithSpring = YES; 47 | self.topDistance = 0; 48 | self.bottomDistance = 0; 49 | self.colors = foldAwayModel.subBtnColors; 50 | self.btnColor = foldAwayModel.mainBtnColor; 51 | self.btnTitle = foldAwayModel.mainBtnTitle; 52 | self.selectTitle = foldAwayModel.mainBtnSelectTitle; 53 | self.btnImage = foldAwayModel.mainBtnImage; 54 | self.btnSelectImage = foldAwayModel.mainBtnSelectImage; 55 | self.titlesArray = foldAwayModel.subBtnTitles; 56 | self.selectTitlesAarray = foldAwayModel.subBtnSelectTitles; 57 | self.subBtnImages = foldAwayModel.subBtnImages; 58 | self.subBtnSelectImages = foldAwayModel.subBtnSelectImages; 59 | self.subBtnHighLightImages = foldAwayModel.subBtnHighLightImages; 60 | [self setupLayout]; 61 | 62 | return self; 63 | } 64 | 65 | 66 | - (instancetype)initWithRect:(CGRect)rect mainButtonTitle:(NSString *)title selectTitle:(NSString *)selectTitle mainButtonColor:(UIColor *)color titlesArray:(NSArray *)titlesArray selectTitlesArray:(NSArray *)selectTitlesArray colors:(NSArray *)colors { 67 | 68 | self = [super initWithFrame:rect]; 69 | 70 | self.canBeMoved = YES; 71 | self.showWithSpring = YES; 72 | self.topDistance = 0; 73 | self.bottomDistance = 0; 74 | self.colors = colors; 75 | self.btnColor = color; 76 | self.btnTitle = title; 77 | self.selectTitle = selectTitle; 78 | self.titlesArray = titlesArray; 79 | self.selectTitlesAarray = selectTitlesArray; 80 | [self setupLayout]; 81 | 82 | return self; 83 | } 84 | 85 | - (instancetype)initWithRect:(CGRect)rect mainButtonTitle:(NSString *)title selectTitle:(NSString *)selectTitle mainButtonColor:(UIColor *)color titlesArray:(NSArray *)titlesArray colors:(NSArray *)colors { 86 | 87 | return [self initWithRect:rect mainButtonTitle:title selectTitle:selectTitle mainButtonColor:color titlesArray:titlesArray selectTitlesArray:nil colors:colors]; 88 | } 89 | 90 | - (instancetype)initWithRect:(CGRect)rect mainButtonTitle:(NSString *)title mainButtonColor:(UIColor *)color titlesArray:(NSArray *)titlesArray colors:(NSArray *)colors { 91 | 92 | return [self initWithRect:rect mainButtonTitle:title selectTitle:nil mainButtonColor:color titlesArray:titlesArray colors:colors]; 93 | } 94 | 95 | #pragma mark - set/get 96 | 97 | - (void)setCanBeMoved:(BOOL)canBeMoved { 98 | 99 | _canBeMoved = canBeMoved; 100 | [self removeGestureRecognizer:self.pan]; 101 | self.pan = nil; 102 | } 103 | 104 | - (CGFloat)disperseDistance { 105 | 106 | return _disperseDistance == 0 ? self.width + 30 : _disperseDistance; 107 | } 108 | 109 | #pragma mark - UI 110 | 111 | - (void)setupLayout { 112 | 113 | self.alpha = 0.4; 114 | 115 | if (self.canBeMoved) { 116 | 117 | self.pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)]; 118 | [self addGestureRecognizer:self.pan]; 119 | } 120 | 121 | UIButton *coverBtn = ({ 122 | 123 | coverBtn = [[UIButton alloc] initWithFrame:self.bounds]; 124 | coverBtn.backgroundColor = [UIColor clearColor]; 125 | [coverBtn addTarget:self action:@selector(clickCoverBtn:) forControlEvents:UIControlEventTouchUpInside]; 126 | [self addSubview:coverBtn]; 127 | self.coverBtn = coverBtn; 128 | coverBtn; 129 | }); 130 | 131 | UIButton *btn = ({ 132 | 133 | btn = [[UIButton alloc] initWithFrame:self.bounds]; 134 | btn.backgroundColor = self.btnColor; 135 | [btn setTitle:self.btnTitle forState:UIControlStateNormal]; 136 | [btn setTitle:self.selectTitle forState:UIControlStateSelected]; 137 | [btn setBackgroundImage:[UIImage imageNamed:self.btnImage] forState:UIControlStateNormal]; 138 | [btn setBackgroundImage:[UIImage imageNamed:self.btnSelectImage] forState:UIControlStateSelected]; 139 | [btn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside]; 140 | btn.layer.cornerRadius = btn.height * 0.5; 141 | btn.layer.masksToBounds = YES; 142 | [self addSubview:btn]; 143 | self.mainBtn = btn; 144 | btn; 145 | }); 146 | 147 | self.colors = [self checkedWithArray:self.colors]; 148 | self.subBtnImages = [self checkedWithArray:self.subBtnImages]; 149 | self.subBtnSelectImages = [self checkedWithArray:self.subBtnSelectImages]; 150 | 151 | NSInteger count = self.titlesArray.count > 0 ? self.titlesArray.count : self.subBtnImages.count; 152 | NSMutableArray *tempArray = [NSMutableArray arrayWithCapacity:self.titlesArray.count]; 153 | for (int i = 0; i < count; i++) { 154 | 155 | SZButton *subBtn = ({ 156 | 157 | subBtn = [[SZButton alloc] initWithFrame:self.bounds]; 158 | subBtn.backgroundColor = self.colors[i]; 159 | [subBtn setBackgroundImage:[UIImage imageNamed:self.subBtnImages[i]] forState:UIControlStateNormal]; 160 | [subBtn setBackgroundImage:[UIImage imageNamed:self.subBtnSelectImages[i]] forState:UIControlStateSelected]; 161 | [subBtn setBackgroundImage:[UIImage imageNamed:self.subBtnHighLightImages[i]] forState:UIControlStateHighlighted]; 162 | [subBtn setTitle:self.titlesArray[i] forState:UIControlStateNormal]; 163 | [subBtn setTitle:self.selectTitlesAarray[i] forState:UIControlStateSelected]; 164 | [subBtn addTarget:self action:@selector(clickSubBtn:) forControlEvents:UIControlEventTouchUpInside]; 165 | subBtn.layer.cornerRadius = btn.height * 0.5; 166 | subBtn.layer.masksToBounds = YES; 167 | subBtn.index = i; 168 | [self insertSubview:subBtn belowSubview:btn]; 169 | subBtn; 170 | }); 171 | [tempArray addObject:subBtn]; 172 | } 173 | self.btnsArray = tempArray.copy; 174 | } 175 | 176 | - (NSArray *)checkedWithArray:(NSArray *)array { 177 | 178 | if (self.titlesArray.count){ 179 | 180 | if (array.count == 0) { 181 | return nil; 182 | } 183 | else if (array.count == 1) { 184 | NSMutableArray *arrayM = [NSMutableArray arrayWithCapacity:self.titlesArray.count]; 185 | for (int i = 0; i < self.titlesArray.count; i++) { 186 | [arrayM addObject:array.firstObject]; 187 | } 188 | return arrayM.copy; 189 | } 190 | else { 191 | NSAssert(self.titlesArray.count == array.count, @"数组中值不一一对应"); 192 | return array; 193 | } 194 | } 195 | else { 196 | NSAssert(self.subBtnImages.count == self.subBtnSelectImages.count, @"数组中值不一一对应"); 197 | return array; 198 | } 199 | } 200 | 201 | - (void)showInView:(UIView *)view { 202 | 203 | [view addSubview:self]; 204 | if (self.automaticShowDirection) { 205 | [self automaticChangeShowDirection]; 206 | } 207 | } 208 | 209 | - (void)showInView:(UIView *)view navigationBar:(BOOL)haveNavigationBar tabBar:(BOOL)haveTabBar { 210 | 211 | self.topDistance = haveNavigationBar ? 64 : 0; 212 | self.bottomDistance = haveTabBar ? 49 : 0; 213 | [view addSubview:self]; 214 | if (self.automaticShowDirection) { 215 | [self automaticChangeShowDirection]; 216 | } 217 | } 218 | 219 | - (void)show { 220 | 221 | [[UIApplication sharedApplication].keyWindow addSubview:self]; 222 | if (self.automaticShowDirection) { 223 | [self automaticChangeShowDirection]; 224 | } 225 | } 226 | 227 | - (void)remove { 228 | 229 | [self removeFromSuperview]; 230 | } 231 | 232 | #pragma mark - 事件 233 | 234 | - (void)clickCoverBtn:(UIButton *)btn { 235 | 236 | if (self.mainBtn.selected) { 237 | 238 | [self clickBtn:self.mainBtn]; 239 | } 240 | } 241 | 242 | /** 243 | * 点击主按钮 244 | */ 245 | - (void)clickBtn:(UIButton *)btn { 246 | 247 | btn.selected = !btn.selected; 248 | 249 | if (btn.selected) { 250 | 251 | self.rect = self.frame; 252 | if (self.pan) { 253 | [self removeGestureRecognizer:self.pan]; 254 | } 255 | 256 | [UIView animateWithDuration:1.0 delay:0.0 usingSpringWithDamping:self.showWithSpring ? 0.5 : 1.0 initialSpringVelocity:self.showWithSpring ? 10 : 0 options:UIViewAnimationOptionCurveLinear animations:^{ 257 | 258 | self.alpha = 1.0; 259 | 260 | if (self.showSuperViewCenter) { 261 | 262 | self.center = self.superview.center; 263 | CGFloat angle = 2 * M_PI / self.btnsArray.count; 264 | for (int i = 0; i < self.btnsArray.count; i++) { 265 | SZButton *btn = self.btnsArray[i]; 266 | btn.center = CGPointMake(self.mainBtn.centerX + cos(angle * i) * (self.width + self.disperseDistance), self.mainBtn.centerY + sin(angle * i) * (self.height + self.disperseDistance)); 267 | } 268 | } 269 | else { 270 | 271 | if (self.showType == showTypeOfLine) { 272 | 273 | [self lineShowButton]; 274 | } 275 | else { 276 | [self circleShowButton]; 277 | } 278 | } 279 | } completion:^(BOOL finished) { 280 | 281 | self.coverBtn.size = self.superview.size; 282 | self.coverBtn.origin = CGPointMake(-self.origin.x, -self.origin.y); 283 | }]; 284 | } 285 | else { 286 | 287 | if (self.pan) { 288 | 289 | [self addGestureRecognizer:self.pan]; 290 | } 291 | 292 | [UIView animateWithDuration:1.0 animations:^{ 293 | 294 | self.alpha = 0.4; 295 | self.frame = self.rect; 296 | self.coverBtn.size = self.size; 297 | self.coverBtn.center = self.mainBtn.center; 298 | 299 | for (SZButton *btn in self.btnsArray) { 300 | btn.center = self.mainBtn.center; 301 | } 302 | }]; 303 | } 304 | } 305 | 306 | - (void)circleShowButton { 307 | 308 | CGFloat angle = M_PI / (self.btnsArray.count - 1); 309 | 310 | for (int i = 0; i < self.btnsArray.count; i++) { 311 | 312 | SZButton *btn = self.btnsArray[i]; 313 | 314 | switch (self.circleShowDirection) { 315 | 316 | case circleShowDirectionLeft: 317 | btn.center = CGPointMake(self.mainBtn.centerX - sin(angle * i) * self.disperseDistance, self.mainBtn.centerY - cos(angle * i) * self.disperseDistance); 318 | break; 319 | case circleShowDirectionRight: 320 | btn.center = CGPointMake(self.mainBtn.centerX + sin(angle * i) * self.disperseDistance, self.mainBtn.centerY + cos(angle * i) * self.disperseDistance); 321 | break; 322 | case circleShowDirectionUp: 323 | { 324 | self.centerX = self.superview.centerX; 325 | btn.center = CGPointMake(self.mainBtn.centerX + sin(angle * i + M_PI_2) * self.disperseDistance, self.mainBtn.centerY + cos(angle * i + M_PI_2) * self.disperseDistance); 326 | } 327 | break; 328 | case circleShowDirectionDown: 329 | { 330 | self.centerX = self.superview.centerX; 331 | btn.center = CGPointMake(self.mainBtn.centerX + sin(angle * i - M_PI_2) * self.disperseDistance, self.mainBtn.centerY + cos(angle * i - M_PI_2) * self.disperseDistance); 332 | } 333 | break; 334 | case circleShowDirectionRightDown: 335 | { 336 | angle = M_PI_2 / (self.btnsArray.count - 1); 337 | btn.center = CGPointMake(self.mainBtn.centerX + sin(angle * i) * self.disperseDistance, self.mainBtn.centerY + cos(angle * i) * self.disperseDistance); 338 | } 339 | break; 340 | case circleShowDirectionRightUp: 341 | { 342 | angle = M_PI_2 / (self.btnsArray.count - 1); 343 | btn.center = CGPointMake(self.mainBtn.centerX + sin(angle * i + M_PI_2) * self.disperseDistance, self.mainBtn.centerY + cos(angle * i + M_PI_2) * self.disperseDistance); 344 | } 345 | break; 346 | case circleShowDirectionLeftUp: 347 | { 348 | angle = M_PI_2 / (self.btnsArray.count - 1); 349 | btn.center = CGPointMake(self.mainBtn.centerX - sin(angle * i) * self.disperseDistance, self.mainBtn.centerY - cos(angle * i) * + self.disperseDistance); 350 | } 351 | break; 352 | case circleShowDirectionLeftDown: 353 | { 354 | angle = M_PI_2 / (self.btnsArray.count - 1); 355 | btn.center = CGPointMake(self.mainBtn.centerX - sin(angle * i + M_PI_2) * self.disperseDistance, self.mainBtn.centerY - cos(angle * i + M_PI_2) * self.disperseDistance); 356 | } 357 | break; 358 | default: 359 | break; 360 | } 361 | } 362 | } 363 | 364 | - (void)lineShowButton { 365 | 366 | for (int i = 0; i < self.btnsArray.count; i++) { 367 | 368 | SZButton *btn = self.btnsArray[i]; 369 | 370 | switch (self.lineShowDirection) { 371 | 372 | case lineShowDirectionLeft: 373 | btn.centerX = self.mainBtn.centerX - self.disperseDistance * (i + 1); 374 | break; 375 | case lineShowDirectionRight: 376 | btn.centerX = self.mainBtn.centerX + self.disperseDistance * (i + 1); 377 | break; 378 | case lineShowDirectionUp: 379 | btn.centerY = self.mainBtn.centerY - self.disperseDistance * (i + 1); 380 | break; 381 | case lineShowDirectionDown: 382 | btn.centerY = self.mainBtn.centerY + self.disperseDistance * (i + 1); 383 | break; 384 | default: 385 | break; 386 | } 387 | } 388 | } 389 | 390 | - (void)clickSubBtn:(SZButton *)btn { 391 | 392 | if (self.subBtnSelectImages.count > 0 || self.selectTitlesAarray.count > 0) { 393 | 394 | for (SZButton *button in self.btnsArray) { 395 | button.selected = btn == button ? button.selected : NO; 396 | } 397 | btn.selected = !btn.selected; 398 | } 399 | 400 | if (self.clickSubButtonBack) { 401 | self.clickSubButtonBack(btn.index, btn.titleLabel.text, btn.selected); 402 | } 403 | } 404 | 405 | /** 406 | * 拖拽 407 | */ 408 | - (void)pan:(UIGestureRecognizer *)gesture { 409 | 410 | CGPoint point = [gesture locationInView:self.superview]; 411 | 412 | self.center = point; 413 | 414 | if (gesture.state == UIGestureRecognizerStateChanged) {} 415 | 416 | if (gesture.state == UIGestureRecognizerStateEnded) { 417 | 418 | CGRect rect = self.frame; 419 | 420 | if (self.centerX > self.superview.width * 0.5) { 421 | rect.origin.x = self.superview.width - self.width; 422 | } 423 | else { 424 | rect.origin.x = 0; 425 | } 426 | 427 | if (self.y < self.topDistance) { 428 | rect.origin.y = self.topDistance; 429 | } 430 | 431 | if (self.y > self.superview.height - self.height - self.bottomDistance) { 432 | rect.origin.y = self.superview.height - self.height - self.bottomDistance; 433 | } 434 | 435 | self.frame = rect; 436 | 437 | if (self.automaticShowDirection) { 438 | [self automaticChangeShowDirection]; 439 | } 440 | } 441 | } 442 | 443 | /** 444 | * 自动算出显示放向 445 | */ 446 | - (void)automaticChangeShowDirection { 447 | 448 | CGFloat halfWidth =self.superview.width * 0.5; 449 | CGFloat halfHeight = self.superview.height * 0.5; 450 | if (self.centerX > halfWidth && self.centerY < halfHeight) { 451 | self.circleShowDirection = self.centerY - self.topDistance > self.disperseDistance ? circleShowDirectionLeft : circleShowDirectionLeftDown; 452 | self.lineShowDirection = self.centerX < halfHeight * 2 - self.centerY ? lineShowDirectionDown : lineShowDirectionLeft; 453 | } 454 | else if (self.centerX > halfWidth && self.centerY > halfHeight) { 455 | self.circleShowDirection = (2 * halfHeight - self.centerY - self.bottomDistance) > self.disperseDistance ? circleShowDirectionLeft : circleShowDirectionLeftUp; 456 | self.lineShowDirection = self.centerX < self.centerY ? lineShowDirectionUp : lineShowDirectionLeft; 457 | } 458 | else if (self.centerX < halfWidth && self.centerY > halfHeight) { 459 | self.circleShowDirection = (2 * halfHeight - self.centerY - self.bottomDistance) > self.disperseDistance ? circleShowDirectionRight : circleShowDirectionRightUp; 460 | self.lineShowDirection = halfWidth * 2 - self.centerX < self.centerY ? lineShowDirectionUp : lineShowDirectionRight; 461 | } 462 | else if (self.centerX < halfWidth && self.centerY < halfHeight) { 463 | self.circleShowDirection = self.centerY - self.topDistance > self.disperseDistance ? circleShowDirectionRight: circleShowDirectionRightDown; 464 | self.lineShowDirection = halfWidth * 2 - self.centerX < halfHeight * 2 - self.centerY ? lineShowDirectionDown : lineShowDirectionRight; 465 | } 466 | } 467 | 468 | /** 469 | * 超出部分点击事件 470 | */ 471 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 472 | 473 | UIView *view = [super hitTest:point withEvent:event]; 474 | if (view == nil) { 475 | 476 | for (UIView *v in self.subviews) { 477 | 478 | CGPoint tempoint = [v convertPoint:point fromView:self]; 479 | if (CGRectContainsPoint(v.bounds, tempoint)) 480 | { 481 | view = v; 482 | } 483 | } 484 | } 485 | return view; 486 | } 487 | 488 | @end 489 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5245D59F1CF53CB200163AA1 /* AddWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5245D59E1CF53CB200163AA1 /* AddWindowController.m */; }; 11 | 5245D5A21CF53D9300163AA1 /* AddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5245D5A11CF53D9300163AA1 /* AddViewController.m */; }; 12 | 5245D5A51CF542E500163AA1 /* FixPlaceCircleController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5245D5A41CF542E500163AA1 /* FixPlaceCircleController.m */; }; 13 | 5245D5A81CF54A3200163AA1 /* FixPlaceLineController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5245D5A71CF54A3200163AA1 /* FixPlaceLineController.m */; }; 14 | 5245D5AB1CF54F0F00163AA1 /* MoveCircleController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5245D5AA1CF54F0F00163AA1 /* MoveCircleController.m */; }; 15 | 5245D5AE1CF5503800163AA1 /* MoveLineController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5245D5AD1CF5503800163AA1 /* MoveLineController.m */; }; 16 | 5245D5B11CF5519B00163AA1 /* AddImageController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5245D5B01CF5519B00163AA1 /* AddImageController.m */; }; 17 | 5245D5B41CF5523200163AA1 /* backgroundStar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5245D5B21CF5523200163AA1 /* backgroundStar@2x.png */; }; 18 | 5245D5B51CF5523200163AA1 /* foregroundStar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5245D5B31CF5523200163AA1 /* foregroundStar@2x.png */; }; 19 | 524EFF4D1CF4422C00E7D46E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 524EFF4C1CF4422C00E7D46E /* main.m */; }; 20 | 524EFF501CF4422C00E7D46E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 524EFF4F1CF4422C00E7D46E /* AppDelegate.m */; }; 21 | 524EFF561CF4422C00E7D46E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 524EFF541CF4422C00E7D46E /* Main.storyboard */; }; 22 | 524EFF581CF4422C00E7D46E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 524EFF571CF4422C00E7D46E /* Assets.xcassets */; }; 23 | 524EFF5B1CF4422C00E7D46E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 524EFF591CF4422C00E7D46E /* LaunchScreen.storyboard */; }; 24 | 524EFF661CF4422D00E7D46E /* SZFoldawayButton_demoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 524EFF651CF4422D00E7D46E /* SZFoldawayButton_demoTests.m */; }; 25 | 524EFF711CF4422D00E7D46E /* SZFoldawayButton_demoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 524EFF701CF4422D00E7D46E /* SZFoldawayButton_demoUITests.m */; }; 26 | 524EFFA41CF44CA200E7D46E /* SZButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 524EFF9D1CF44CA200E7D46E /* SZButton.m */; }; 27 | 524EFFA51CF44CA200E7D46E /* SZFoldawayButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 524EFF9F1CF44CA200E7D46E /* SZFoldawayButton.m */; }; 28 | 524EFFA61CF44CA200E7D46E /* SZFoldawayModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 524EFFA11CF44CA200E7D46E /* SZFoldawayModel.m */; }; 29 | 524EFFA71CF44CA200E7D46E /* UIView+SZFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 524EFFA31CF44CA200E7D46E /* UIView+SZFrame.m */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | 524EFF621CF4422D00E7D46E /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = 524EFF401CF4422C00E7D46E /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = 524EFF471CF4422C00E7D46E; 38 | remoteInfo = SZFoldawayButton_demo; 39 | }; 40 | 524EFF6D1CF4422D00E7D46E /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = 524EFF401CF4422C00E7D46E /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = 524EFF471CF4422C00E7D46E; 45 | remoteInfo = SZFoldawayButton_demo; 46 | }; 47 | /* End PBXContainerItemProxy section */ 48 | 49 | /* Begin PBXFileReference section */ 50 | 5245D59D1CF53CB200163AA1 /* AddWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddWindowController.h; sourceTree = ""; }; 51 | 5245D59E1CF53CB200163AA1 /* AddWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddWindowController.m; sourceTree = ""; }; 52 | 5245D5A01CF53D9300163AA1 /* AddViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddViewController.h; sourceTree = ""; }; 53 | 5245D5A11CF53D9300163AA1 /* AddViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddViewController.m; sourceTree = ""; }; 54 | 5245D5A31CF542E500163AA1 /* FixPlaceCircleController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FixPlaceCircleController.h; sourceTree = ""; }; 55 | 5245D5A41CF542E500163AA1 /* FixPlaceCircleController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FixPlaceCircleController.m; sourceTree = ""; }; 56 | 5245D5A61CF54A3200163AA1 /* FixPlaceLineController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FixPlaceLineController.h; sourceTree = ""; }; 57 | 5245D5A71CF54A3200163AA1 /* FixPlaceLineController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FixPlaceLineController.m; sourceTree = ""; }; 58 | 5245D5A91CF54F0F00163AA1 /* MoveCircleController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoveCircleController.h; sourceTree = ""; }; 59 | 5245D5AA1CF54F0F00163AA1 /* MoveCircleController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MoveCircleController.m; sourceTree = ""; }; 60 | 5245D5AC1CF5503800163AA1 /* MoveLineController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoveLineController.h; sourceTree = ""; }; 61 | 5245D5AD1CF5503800163AA1 /* MoveLineController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MoveLineController.m; sourceTree = ""; }; 62 | 5245D5AF1CF5519B00163AA1 /* AddImageController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddImageController.h; sourceTree = ""; }; 63 | 5245D5B01CF5519B00163AA1 /* AddImageController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddImageController.m; sourceTree = ""; }; 64 | 5245D5B21CF5523200163AA1 /* backgroundStar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "backgroundStar@2x.png"; sourceTree = ""; }; 65 | 5245D5B31CF5523200163AA1 /* foregroundStar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "foregroundStar@2x.png"; sourceTree = ""; }; 66 | 524EFF481CF4422C00E7D46E /* SZFoldawayButton_demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SZFoldawayButton_demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 67 | 524EFF4C1CF4422C00E7D46E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 68 | 524EFF4E1CF4422C00E7D46E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 69 | 524EFF4F1CF4422C00E7D46E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 70 | 524EFF551CF4422C00E7D46E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 71 | 524EFF571CF4422C00E7D46E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 72 | 524EFF5A1CF4422C00E7D46E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 73 | 524EFF5C1CF4422C00E7D46E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 74 | 524EFF611CF4422D00E7D46E /* SZFoldawayButton_demoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SZFoldawayButton_demoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 75 | 524EFF651CF4422D00E7D46E /* SZFoldawayButton_demoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SZFoldawayButton_demoTests.m; sourceTree = ""; }; 76 | 524EFF671CF4422D00E7D46E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 77 | 524EFF6C1CF4422D00E7D46E /* SZFoldawayButton_demoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SZFoldawayButton_demoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 78 | 524EFF701CF4422D00E7D46E /* SZFoldawayButton_demoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SZFoldawayButton_demoUITests.m; sourceTree = ""; }; 79 | 524EFF721CF4422D00E7D46E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 80 | 524EFF9C1CF44CA200E7D46E /* SZButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SZButton.h; sourceTree = ""; }; 81 | 524EFF9D1CF44CA200E7D46E /* SZButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SZButton.m; sourceTree = ""; }; 82 | 524EFF9E1CF44CA200E7D46E /* SZFoldawayButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SZFoldawayButton.h; sourceTree = ""; }; 83 | 524EFF9F1CF44CA200E7D46E /* SZFoldawayButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SZFoldawayButton.m; sourceTree = ""; }; 84 | 524EFFA01CF44CA200E7D46E /* SZFoldawayModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SZFoldawayModel.h; sourceTree = ""; }; 85 | 524EFFA11CF44CA200E7D46E /* SZFoldawayModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SZFoldawayModel.m; sourceTree = ""; }; 86 | 524EFFA21CF44CA200E7D46E /* UIView+SZFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+SZFrame.h"; sourceTree = ""; }; 87 | 524EFFA31CF44CA200E7D46E /* UIView+SZFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+SZFrame.m"; sourceTree = ""; }; 88 | /* End PBXFileReference section */ 89 | 90 | /* Begin PBXFrameworksBuildPhase section */ 91 | 524EFF451CF4422C00E7D46E /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | ); 96 | runOnlyForDeploymentPostprocessing = 0; 97 | }; 98 | 524EFF5E1CF4422D00E7D46E /* Frameworks */ = { 99 | isa = PBXFrameworksBuildPhase; 100 | buildActionMask = 2147483647; 101 | files = ( 102 | ); 103 | runOnlyForDeploymentPostprocessing = 0; 104 | }; 105 | 524EFF691CF4422D00E7D46E /* Frameworks */ = { 106 | isa = PBXFrameworksBuildPhase; 107 | buildActionMask = 2147483647; 108 | files = ( 109 | ); 110 | runOnlyForDeploymentPostprocessing = 0; 111 | }; 112 | /* End PBXFrameworksBuildPhase section */ 113 | 114 | /* Begin PBXGroup section */ 115 | 5245D59C1CF53C8B00163AA1 /* UI */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 5245D59D1CF53CB200163AA1 /* AddWindowController.h */, 119 | 5245D59E1CF53CB200163AA1 /* AddWindowController.m */, 120 | 5245D5A01CF53D9300163AA1 /* AddViewController.h */, 121 | 5245D5A11CF53D9300163AA1 /* AddViewController.m */, 122 | 5245D5A31CF542E500163AA1 /* FixPlaceCircleController.h */, 123 | 5245D5A41CF542E500163AA1 /* FixPlaceCircleController.m */, 124 | 5245D5A61CF54A3200163AA1 /* FixPlaceLineController.h */, 125 | 5245D5A71CF54A3200163AA1 /* FixPlaceLineController.m */, 126 | 5245D5A91CF54F0F00163AA1 /* MoveCircleController.h */, 127 | 5245D5AA1CF54F0F00163AA1 /* MoveCircleController.m */, 128 | 5245D5AC1CF5503800163AA1 /* MoveLineController.h */, 129 | 5245D5AD1CF5503800163AA1 /* MoveLineController.m */, 130 | 5245D5AF1CF5519B00163AA1 /* AddImageController.h */, 131 | 5245D5B01CF5519B00163AA1 /* AddImageController.m */, 132 | 5245D5B21CF5523200163AA1 /* backgroundStar@2x.png */, 133 | 5245D5B31CF5523200163AA1 /* foregroundStar@2x.png */, 134 | ); 135 | name = UI; 136 | sourceTree = ""; 137 | }; 138 | 524EFF3F1CF4422C00E7D46E = { 139 | isa = PBXGroup; 140 | children = ( 141 | 524EFF4A1CF4422C00E7D46E /* SZFoldawayButton_demo */, 142 | 524EFF641CF4422D00E7D46E /* SZFoldawayButton_demoTests */, 143 | 524EFF6F1CF4422D00E7D46E /* SZFoldawayButton_demoUITests */, 144 | 524EFF491CF4422C00E7D46E /* Products */, 145 | ); 146 | sourceTree = ""; 147 | }; 148 | 524EFF491CF4422C00E7D46E /* Products */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 524EFF481CF4422C00E7D46E /* SZFoldawayButton_demo.app */, 152 | 524EFF611CF4422D00E7D46E /* SZFoldawayButton_demoTests.xctest */, 153 | 524EFF6C1CF4422D00E7D46E /* SZFoldawayButton_demoUITests.xctest */, 154 | ); 155 | name = Products; 156 | sourceTree = ""; 157 | }; 158 | 524EFF4A1CF4422C00E7D46E /* SZFoldawayButton_demo */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 524EFF9B1CF44CA200E7D46E /* SZFoldawayButton */, 162 | 524EFF4E1CF4422C00E7D46E /* AppDelegate.h */, 163 | 524EFF4F1CF4422C00E7D46E /* AppDelegate.m */, 164 | 5245D59C1CF53C8B00163AA1 /* UI */, 165 | 524EFF541CF4422C00E7D46E /* Main.storyboard */, 166 | 524EFF571CF4422C00E7D46E /* Assets.xcassets */, 167 | 524EFF591CF4422C00E7D46E /* LaunchScreen.storyboard */, 168 | 524EFF5C1CF4422C00E7D46E /* Info.plist */, 169 | 524EFF4B1CF4422C00E7D46E /* Supporting Files */, 170 | ); 171 | path = SZFoldawayButton_demo; 172 | sourceTree = ""; 173 | }; 174 | 524EFF4B1CF4422C00E7D46E /* Supporting Files */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | 524EFF4C1CF4422C00E7D46E /* main.m */, 178 | ); 179 | name = "Supporting Files"; 180 | sourceTree = ""; 181 | }; 182 | 524EFF641CF4422D00E7D46E /* SZFoldawayButton_demoTests */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | 524EFF651CF4422D00E7D46E /* SZFoldawayButton_demoTests.m */, 186 | 524EFF671CF4422D00E7D46E /* Info.plist */, 187 | ); 188 | path = SZFoldawayButton_demoTests; 189 | sourceTree = ""; 190 | }; 191 | 524EFF6F1CF4422D00E7D46E /* SZFoldawayButton_demoUITests */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | 524EFF701CF4422D00E7D46E /* SZFoldawayButton_demoUITests.m */, 195 | 524EFF721CF4422D00E7D46E /* Info.plist */, 196 | ); 197 | path = SZFoldawayButton_demoUITests; 198 | sourceTree = ""; 199 | }; 200 | 524EFF9B1CF44CA200E7D46E /* SZFoldawayButton */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | 524EFF9C1CF44CA200E7D46E /* SZButton.h */, 204 | 524EFF9D1CF44CA200E7D46E /* SZButton.m */, 205 | 524EFF9E1CF44CA200E7D46E /* SZFoldawayButton.h */, 206 | 524EFF9F1CF44CA200E7D46E /* SZFoldawayButton.m */, 207 | 524EFFA01CF44CA200E7D46E /* SZFoldawayModel.h */, 208 | 524EFFA11CF44CA200E7D46E /* SZFoldawayModel.m */, 209 | 524EFFA21CF44CA200E7D46E /* UIView+SZFrame.h */, 210 | 524EFFA31CF44CA200E7D46E /* UIView+SZFrame.m */, 211 | ); 212 | path = SZFoldawayButton; 213 | sourceTree = ""; 214 | }; 215 | /* End PBXGroup section */ 216 | 217 | /* Begin PBXNativeTarget section */ 218 | 524EFF471CF4422C00E7D46E /* SZFoldawayButton_demo */ = { 219 | isa = PBXNativeTarget; 220 | buildConfigurationList = 524EFF751CF4422D00E7D46E /* Build configuration list for PBXNativeTarget "SZFoldawayButton_demo" */; 221 | buildPhases = ( 222 | 524EFF441CF4422C00E7D46E /* Sources */, 223 | 524EFF451CF4422C00E7D46E /* Frameworks */, 224 | 524EFF461CF4422C00E7D46E /* Resources */, 225 | ); 226 | buildRules = ( 227 | ); 228 | dependencies = ( 229 | ); 230 | name = SZFoldawayButton_demo; 231 | productName = SZFoldawayButton_demo; 232 | productReference = 524EFF481CF4422C00E7D46E /* SZFoldawayButton_demo.app */; 233 | productType = "com.apple.product-type.application"; 234 | }; 235 | 524EFF601CF4422D00E7D46E /* SZFoldawayButton_demoTests */ = { 236 | isa = PBXNativeTarget; 237 | buildConfigurationList = 524EFF781CF4422D00E7D46E /* Build configuration list for PBXNativeTarget "SZFoldawayButton_demoTests" */; 238 | buildPhases = ( 239 | 524EFF5D1CF4422D00E7D46E /* Sources */, 240 | 524EFF5E1CF4422D00E7D46E /* Frameworks */, 241 | 524EFF5F1CF4422D00E7D46E /* Resources */, 242 | ); 243 | buildRules = ( 244 | ); 245 | dependencies = ( 246 | 524EFF631CF4422D00E7D46E /* PBXTargetDependency */, 247 | ); 248 | name = SZFoldawayButton_demoTests; 249 | productName = SZFoldawayButton_demoTests; 250 | productReference = 524EFF611CF4422D00E7D46E /* SZFoldawayButton_demoTests.xctest */; 251 | productType = "com.apple.product-type.bundle.unit-test"; 252 | }; 253 | 524EFF6B1CF4422D00E7D46E /* SZFoldawayButton_demoUITests */ = { 254 | isa = PBXNativeTarget; 255 | buildConfigurationList = 524EFF7B1CF4422D00E7D46E /* Build configuration list for PBXNativeTarget "SZFoldawayButton_demoUITests" */; 256 | buildPhases = ( 257 | 524EFF681CF4422D00E7D46E /* Sources */, 258 | 524EFF691CF4422D00E7D46E /* Frameworks */, 259 | 524EFF6A1CF4422D00E7D46E /* Resources */, 260 | ); 261 | buildRules = ( 262 | ); 263 | dependencies = ( 264 | 524EFF6E1CF4422D00E7D46E /* PBXTargetDependency */, 265 | ); 266 | name = SZFoldawayButton_demoUITests; 267 | productName = SZFoldawayButton_demoUITests; 268 | productReference = 524EFF6C1CF4422D00E7D46E /* SZFoldawayButton_demoUITests.xctest */; 269 | productType = "com.apple.product-type.bundle.ui-testing"; 270 | }; 271 | /* End PBXNativeTarget section */ 272 | 273 | /* Begin PBXProject section */ 274 | 524EFF401CF4422C00E7D46E /* Project object */ = { 275 | isa = PBXProject; 276 | attributes = { 277 | LastUpgradeCheck = 0730; 278 | ORGANIZATIONNAME = "吴三忠"; 279 | TargetAttributes = { 280 | 524EFF471CF4422C00E7D46E = { 281 | CreatedOnToolsVersion = 7.3; 282 | }; 283 | 524EFF601CF4422D00E7D46E = { 284 | CreatedOnToolsVersion = 7.3; 285 | TestTargetID = 524EFF471CF4422C00E7D46E; 286 | }; 287 | 524EFF6B1CF4422D00E7D46E = { 288 | CreatedOnToolsVersion = 7.3; 289 | TestTargetID = 524EFF471CF4422C00E7D46E; 290 | }; 291 | }; 292 | }; 293 | buildConfigurationList = 524EFF431CF4422C00E7D46E /* Build configuration list for PBXProject "SZFoldawayButton_demo" */; 294 | compatibilityVersion = "Xcode 3.2"; 295 | developmentRegion = English; 296 | hasScannedForEncodings = 0; 297 | knownRegions = ( 298 | en, 299 | Base, 300 | ); 301 | mainGroup = 524EFF3F1CF4422C00E7D46E; 302 | productRefGroup = 524EFF491CF4422C00E7D46E /* Products */; 303 | projectDirPath = ""; 304 | projectRoot = ""; 305 | targets = ( 306 | 524EFF471CF4422C00E7D46E /* SZFoldawayButton_demo */, 307 | 524EFF601CF4422D00E7D46E /* SZFoldawayButton_demoTests */, 308 | 524EFF6B1CF4422D00E7D46E /* SZFoldawayButton_demoUITests */, 309 | ); 310 | }; 311 | /* End PBXProject section */ 312 | 313 | /* Begin PBXResourcesBuildPhase section */ 314 | 524EFF461CF4422C00E7D46E /* Resources */ = { 315 | isa = PBXResourcesBuildPhase; 316 | buildActionMask = 2147483647; 317 | files = ( 318 | 5245D5B41CF5523200163AA1 /* backgroundStar@2x.png in Resources */, 319 | 524EFF5B1CF4422C00E7D46E /* LaunchScreen.storyboard in Resources */, 320 | 5245D5B51CF5523200163AA1 /* foregroundStar@2x.png in Resources */, 321 | 524EFF581CF4422C00E7D46E /* Assets.xcassets in Resources */, 322 | 524EFF561CF4422C00E7D46E /* Main.storyboard in Resources */, 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | }; 326 | 524EFF5F1CF4422D00E7D46E /* Resources */ = { 327 | isa = PBXResourcesBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | }; 333 | 524EFF6A1CF4422D00E7D46E /* Resources */ = { 334 | isa = PBXResourcesBuildPhase; 335 | buildActionMask = 2147483647; 336 | files = ( 337 | ); 338 | runOnlyForDeploymentPostprocessing = 0; 339 | }; 340 | /* End PBXResourcesBuildPhase section */ 341 | 342 | /* Begin PBXSourcesBuildPhase section */ 343 | 524EFF441CF4422C00E7D46E /* Sources */ = { 344 | isa = PBXSourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | 5245D5A51CF542E500163AA1 /* FixPlaceCircleController.m in Sources */, 348 | 524EFF501CF4422C00E7D46E /* AppDelegate.m in Sources */, 349 | 524EFFA71CF44CA200E7D46E /* UIView+SZFrame.m in Sources */, 350 | 5245D5A81CF54A3200163AA1 /* FixPlaceLineController.m in Sources */, 351 | 524EFFA51CF44CA200E7D46E /* SZFoldawayButton.m in Sources */, 352 | 524EFFA41CF44CA200E7D46E /* SZButton.m in Sources */, 353 | 5245D59F1CF53CB200163AA1 /* AddWindowController.m in Sources */, 354 | 524EFF4D1CF4422C00E7D46E /* main.m in Sources */, 355 | 5245D5A21CF53D9300163AA1 /* AddViewController.m in Sources */, 356 | 524EFFA61CF44CA200E7D46E /* SZFoldawayModel.m in Sources */, 357 | 5245D5B11CF5519B00163AA1 /* AddImageController.m in Sources */, 358 | 5245D5AE1CF5503800163AA1 /* MoveLineController.m in Sources */, 359 | 5245D5AB1CF54F0F00163AA1 /* MoveCircleController.m in Sources */, 360 | ); 361 | runOnlyForDeploymentPostprocessing = 0; 362 | }; 363 | 524EFF5D1CF4422D00E7D46E /* Sources */ = { 364 | isa = PBXSourcesBuildPhase; 365 | buildActionMask = 2147483647; 366 | files = ( 367 | 524EFF661CF4422D00E7D46E /* SZFoldawayButton_demoTests.m in Sources */, 368 | ); 369 | runOnlyForDeploymentPostprocessing = 0; 370 | }; 371 | 524EFF681CF4422D00E7D46E /* Sources */ = { 372 | isa = PBXSourcesBuildPhase; 373 | buildActionMask = 2147483647; 374 | files = ( 375 | 524EFF711CF4422D00E7D46E /* SZFoldawayButton_demoUITests.m in Sources */, 376 | ); 377 | runOnlyForDeploymentPostprocessing = 0; 378 | }; 379 | /* End PBXSourcesBuildPhase section */ 380 | 381 | /* Begin PBXTargetDependency section */ 382 | 524EFF631CF4422D00E7D46E /* PBXTargetDependency */ = { 383 | isa = PBXTargetDependency; 384 | target = 524EFF471CF4422C00E7D46E /* SZFoldawayButton_demo */; 385 | targetProxy = 524EFF621CF4422D00E7D46E /* PBXContainerItemProxy */; 386 | }; 387 | 524EFF6E1CF4422D00E7D46E /* PBXTargetDependency */ = { 388 | isa = PBXTargetDependency; 389 | target = 524EFF471CF4422C00E7D46E /* SZFoldawayButton_demo */; 390 | targetProxy = 524EFF6D1CF4422D00E7D46E /* PBXContainerItemProxy */; 391 | }; 392 | /* End PBXTargetDependency section */ 393 | 394 | /* Begin PBXVariantGroup section */ 395 | 524EFF541CF4422C00E7D46E /* Main.storyboard */ = { 396 | isa = PBXVariantGroup; 397 | children = ( 398 | 524EFF551CF4422C00E7D46E /* Base */, 399 | ); 400 | name = Main.storyboard; 401 | sourceTree = ""; 402 | }; 403 | 524EFF591CF4422C00E7D46E /* LaunchScreen.storyboard */ = { 404 | isa = PBXVariantGroup; 405 | children = ( 406 | 524EFF5A1CF4422C00E7D46E /* Base */, 407 | ); 408 | name = LaunchScreen.storyboard; 409 | sourceTree = ""; 410 | }; 411 | /* End PBXVariantGroup section */ 412 | 413 | /* Begin XCBuildConfiguration section */ 414 | 524EFF731CF4422D00E7D46E /* Debug */ = { 415 | isa = XCBuildConfiguration; 416 | buildSettings = { 417 | ALWAYS_SEARCH_USER_PATHS = NO; 418 | CLANG_ANALYZER_NONNULL = YES; 419 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 420 | CLANG_CXX_LIBRARY = "libc++"; 421 | CLANG_ENABLE_MODULES = YES; 422 | CLANG_ENABLE_OBJC_ARC = YES; 423 | CLANG_WARN_BOOL_CONVERSION = YES; 424 | CLANG_WARN_CONSTANT_CONVERSION = YES; 425 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 426 | CLANG_WARN_EMPTY_BODY = YES; 427 | CLANG_WARN_ENUM_CONVERSION = YES; 428 | CLANG_WARN_INT_CONVERSION = YES; 429 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 430 | CLANG_WARN_UNREACHABLE_CODE = YES; 431 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 432 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 433 | COPY_PHASE_STRIP = NO; 434 | DEBUG_INFORMATION_FORMAT = dwarf; 435 | ENABLE_STRICT_OBJC_MSGSEND = YES; 436 | ENABLE_TESTABILITY = YES; 437 | GCC_C_LANGUAGE_STANDARD = gnu99; 438 | GCC_DYNAMIC_NO_PIC = NO; 439 | GCC_NO_COMMON_BLOCKS = YES; 440 | GCC_OPTIMIZATION_LEVEL = 0; 441 | GCC_PREPROCESSOR_DEFINITIONS = ( 442 | "DEBUG=1", 443 | "$(inherited)", 444 | ); 445 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 446 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 447 | GCC_WARN_UNDECLARED_SELECTOR = YES; 448 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 449 | GCC_WARN_UNUSED_FUNCTION = YES; 450 | GCC_WARN_UNUSED_VARIABLE = YES; 451 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 452 | MTL_ENABLE_DEBUG_INFO = YES; 453 | ONLY_ACTIVE_ARCH = YES; 454 | SDKROOT = iphoneos; 455 | }; 456 | name = Debug; 457 | }; 458 | 524EFF741CF4422D00E7D46E /* Release */ = { 459 | isa = XCBuildConfiguration; 460 | buildSettings = { 461 | ALWAYS_SEARCH_USER_PATHS = NO; 462 | CLANG_ANALYZER_NONNULL = YES; 463 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 464 | CLANG_CXX_LIBRARY = "libc++"; 465 | CLANG_ENABLE_MODULES = YES; 466 | CLANG_ENABLE_OBJC_ARC = YES; 467 | CLANG_WARN_BOOL_CONVERSION = YES; 468 | CLANG_WARN_CONSTANT_CONVERSION = YES; 469 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 470 | CLANG_WARN_EMPTY_BODY = YES; 471 | CLANG_WARN_ENUM_CONVERSION = YES; 472 | CLANG_WARN_INT_CONVERSION = YES; 473 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 474 | CLANG_WARN_UNREACHABLE_CODE = YES; 475 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 476 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 477 | COPY_PHASE_STRIP = NO; 478 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 479 | ENABLE_NS_ASSERTIONS = NO; 480 | ENABLE_STRICT_OBJC_MSGSEND = YES; 481 | GCC_C_LANGUAGE_STANDARD = gnu99; 482 | GCC_NO_COMMON_BLOCKS = YES; 483 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 484 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 485 | GCC_WARN_UNDECLARED_SELECTOR = YES; 486 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 487 | GCC_WARN_UNUSED_FUNCTION = YES; 488 | GCC_WARN_UNUSED_VARIABLE = YES; 489 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 490 | MTL_ENABLE_DEBUG_INFO = NO; 491 | SDKROOT = iphoneos; 492 | VALIDATE_PRODUCT = YES; 493 | }; 494 | name = Release; 495 | }; 496 | 524EFF761CF4422D00E7D46E /* Debug */ = { 497 | isa = XCBuildConfiguration; 498 | buildSettings = { 499 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 500 | INFOPLIST_FILE = SZFoldawayButton_demo/Info.plist; 501 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 502 | PRODUCT_BUNDLE_IDENTIFIER = "cn.com.incons.SZFoldawayButton-demo"; 503 | PRODUCT_NAME = "$(TARGET_NAME)"; 504 | }; 505 | name = Debug; 506 | }; 507 | 524EFF771CF4422D00E7D46E /* Release */ = { 508 | isa = XCBuildConfiguration; 509 | buildSettings = { 510 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 511 | INFOPLIST_FILE = SZFoldawayButton_demo/Info.plist; 512 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 513 | PRODUCT_BUNDLE_IDENTIFIER = "cn.com.incons.SZFoldawayButton-demo"; 514 | PRODUCT_NAME = "$(TARGET_NAME)"; 515 | }; 516 | name = Release; 517 | }; 518 | 524EFF791CF4422D00E7D46E /* Debug */ = { 519 | isa = XCBuildConfiguration; 520 | buildSettings = { 521 | BUNDLE_LOADER = "$(TEST_HOST)"; 522 | INFOPLIST_FILE = SZFoldawayButton_demoTests/Info.plist; 523 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 524 | PRODUCT_BUNDLE_IDENTIFIER = "cn.com.incons.SZFoldawayButton-demoTests"; 525 | PRODUCT_NAME = "$(TARGET_NAME)"; 526 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SZFoldawayButton_demo.app/SZFoldawayButton_demo"; 527 | }; 528 | name = Debug; 529 | }; 530 | 524EFF7A1CF4422D00E7D46E /* Release */ = { 531 | isa = XCBuildConfiguration; 532 | buildSettings = { 533 | BUNDLE_LOADER = "$(TEST_HOST)"; 534 | INFOPLIST_FILE = SZFoldawayButton_demoTests/Info.plist; 535 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 536 | PRODUCT_BUNDLE_IDENTIFIER = "cn.com.incons.SZFoldawayButton-demoTests"; 537 | PRODUCT_NAME = "$(TARGET_NAME)"; 538 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SZFoldawayButton_demo.app/SZFoldawayButton_demo"; 539 | }; 540 | name = Release; 541 | }; 542 | 524EFF7C1CF4422D00E7D46E /* Debug */ = { 543 | isa = XCBuildConfiguration; 544 | buildSettings = { 545 | INFOPLIST_FILE = SZFoldawayButton_demoUITests/Info.plist; 546 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 547 | PRODUCT_BUNDLE_IDENTIFIER = "cn.com.incons.SZFoldawayButton-demoUITests"; 548 | PRODUCT_NAME = "$(TARGET_NAME)"; 549 | TEST_TARGET_NAME = SZFoldawayButton_demo; 550 | }; 551 | name = Debug; 552 | }; 553 | 524EFF7D1CF4422D00E7D46E /* Release */ = { 554 | isa = XCBuildConfiguration; 555 | buildSettings = { 556 | INFOPLIST_FILE = SZFoldawayButton_demoUITests/Info.plist; 557 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 558 | PRODUCT_BUNDLE_IDENTIFIER = "cn.com.incons.SZFoldawayButton-demoUITests"; 559 | PRODUCT_NAME = "$(TARGET_NAME)"; 560 | TEST_TARGET_NAME = SZFoldawayButton_demo; 561 | }; 562 | name = Release; 563 | }; 564 | /* End XCBuildConfiguration section */ 565 | 566 | /* Begin XCConfigurationList section */ 567 | 524EFF431CF4422C00E7D46E /* Build configuration list for PBXProject "SZFoldawayButton_demo" */ = { 568 | isa = XCConfigurationList; 569 | buildConfigurations = ( 570 | 524EFF731CF4422D00E7D46E /* Debug */, 571 | 524EFF741CF4422D00E7D46E /* Release */, 572 | ); 573 | defaultConfigurationIsVisible = 0; 574 | defaultConfigurationName = Release; 575 | }; 576 | 524EFF751CF4422D00E7D46E /* Build configuration list for PBXNativeTarget "SZFoldawayButton_demo" */ = { 577 | isa = XCConfigurationList; 578 | buildConfigurations = ( 579 | 524EFF761CF4422D00E7D46E /* Debug */, 580 | 524EFF771CF4422D00E7D46E /* Release */, 581 | ); 582 | defaultConfigurationIsVisible = 0; 583 | defaultConfigurationName = Release; 584 | }; 585 | 524EFF781CF4422D00E7D46E /* Build configuration list for PBXNativeTarget "SZFoldawayButton_demoTests" */ = { 586 | isa = XCConfigurationList; 587 | buildConfigurations = ( 588 | 524EFF791CF4422D00E7D46E /* Debug */, 589 | 524EFF7A1CF4422D00E7D46E /* Release */, 590 | ); 591 | defaultConfigurationIsVisible = 0; 592 | defaultConfigurationName = Release; 593 | }; 594 | 524EFF7B1CF4422D00E7D46E /* Build configuration list for PBXNativeTarget "SZFoldawayButton_demoUITests" */ = { 595 | isa = XCConfigurationList; 596 | buildConfigurations = ( 597 | 524EFF7C1CF4422D00E7D46E /* Debug */, 598 | 524EFF7D1CF4422D00E7D46E /* Release */, 599 | ); 600 | defaultConfigurationIsVisible = 0; 601 | defaultConfigurationName = Release; 602 | }; 603 | /* End XCConfigurationList section */ 604 | }; 605 | rootObject = 524EFF401CF4422C00E7D46E /* Project object */; 606 | } 607 | -------------------------------------------------------------------------------- /SZFoldawayButton/SZFoldawayButton_demo/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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | --------------------------------------------------------------------------------