├── .gitignore ├── For users ├── SGSelectViewController.h └── SGSelectViewController.m ├── LICENSE ├── README.md ├── SGSelectViewController.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── ne210236.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── ne210236.xcuserdatad │ ├── xcdebugger │ └── Breakpoints.xcbkptlist │ └── xcschemes │ ├── SGSelectViewController.xcscheme │ └── xcschememanagement.plist ├── SGSelectViewController ├── AppDelegate.h ├── AppDelegate.m ├── Default-568h@2x.png ├── Default.png ├── Default@2x.png ├── SGSelectViewController-Info.plist ├── SGSelectViewController-Prefix.pch ├── ViewController.h ├── ViewController.m ├── en.lproj │ ├── InfoPlist.strings │ └── ViewController.xib └── main.m ├── images ├── balloon@2x.png ├── choseBtn@2x.png ├── full.png ├── ok@2x.png ├── plan_eat@2x.png ├── plan_nature@2x.png ├── plan_plane@2x.png ├── plan_rest@2x.png ├── plan_shopping@2x.png ├── plan_sports@2x.png ├── plan_structure@2x.png ├── plan_train@2x.png ├── plan_walk@2x.png └── ss.png └── lib ├── SGSelectViewController.h └── SGSelectViewController.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /For users /SGSelectViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SGSelectViewController.h 3 | // SGSelectViewController 4 | // 5 | // Created by Maco_Tasu on 12/11/18. 6 | // Copyright (c) 2012年 MacoTasu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class SGSelectViewController; 13 | @interface SGSelectViewController : UIViewController 14 | -(void)sgViewAppear; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /For users /SGSelectViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SGSelectViewController.m 3 | // SGSelectViewController 4 | // 5 | // Created by Maco_Tasu on 12/11/18. 6 | // Copyright (c) 2012年 MacoTasu. All rights reserved. 7 | // 8 | 9 | #import "SGSelectViewController.h" 10 | #import "AppDelegate.h" 11 | 12 | @interface SGSelectViewController () 13 | - (id)init; 14 | - (void)setImage; 15 | - (void)loadImage; 16 | - (void)viewDetail; 17 | -(void)changeIcon:(id)sender; 18 | -(void)highlightButton:(UIButton *)btn; 19 | -(void)sgViewDissAppear; 20 | -(void)endAnimation; 21 | -(void)didEnd; 22 | @end 23 | 24 | #define VIEW_ORIGIN_X 10 25 | #define VIEW_ORIGIN_Y 70 26 | #define BUTTOM_MARGIN 20 27 | #define TOP_MARGIN 21 28 | #define MARGIN_X 10 29 | #define MARGIN_Y 10 30 | 31 | 32 | //------------------------- 33 | // You should change the following two sizes 34 | // if you want to change the number of a party's icons or icons sizes. 35 | //------------------------- 36 | #define BTN_W_H 48 37 | #define ONE_ROW_ICON 5 38 | 39 | //------------------------- 40 | // The number of buttons needs to be the same as the number of [NSDictionary count]. 41 | // Under the present circumstances, it is OK to 20 pieces. 42 | //------------------------- 43 | #define BUTTON_COUNT 20 44 | 45 | 46 | 47 | @implementation SGSelectViewController{ 48 | __strong NSArray *_ar; 49 | NSInteger _iconNumber; 50 | NSMutableArray *_iconArray; 51 | UIButton *_btn[BUTTON_COUNT]; 52 | } 53 | 54 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 55 | { 56 | 57 | 58 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 59 | if (self) { 60 | 61 | //------------------------- 62 | // initialize 63 | //------------------------- 64 | [self setView:[[UIView alloc] init]]; 65 | _iconArray = [[NSMutableArray alloc]init]; 66 | _iconNumber = -1; 67 | 68 | } 69 | return self; 70 | } 71 | 72 | -(id)init{ 73 | 74 | self = [super init]; 75 | 76 | if (self) { 77 | 78 | [self setImage]; 79 | [self loadImage]; 80 | [self viewDetail]; 81 | 82 | } 83 | 84 | return self; 85 | } 86 | 87 | 88 | #pragma Icon 89 | 90 | //------------------------- 91 | // Set-Icon 92 | //------------------------- 93 | -(void)setImage{ 94 | 95 | _ar = [NSArray arrayWithObjects: 96 | @"plan_rest.png", 97 | @"plan_train.png", 98 | @"plan_structure.png", 99 | @"plan_nature.png", 100 | @"plan_walk.png", 101 | @"plan_shopping.png", 102 | @"plan_eat.png", 103 | @"plan_plane.png", 104 | @"plan_sports.png", 105 | @"plan_nature.png", 106 | @"plan_walk.png", 107 | @"plan_shopping.png", 108 | @"plan_eat.png", 109 | @"plan_plane.png", 110 | @"plan_sports.png", 111 | @"plan_eat.png", 112 | @"plan_plane.png", 113 | @"plan_sports.png", 114 | @"plan_rest.png", 115 | @"plan_structure.png",nil]; 116 | } 117 | 118 | 119 | #pragma self.view 120 | 121 | //------------------------- 122 | // self.view setting 123 | //------------------------- 124 | -(void)viewDetail{ 125 | 126 | //x is Row count 127 | int x = 0; 128 | 129 | if([_iconArray count] % ONE_ROW_ICON != 0) 130 | x = [_iconArray count]/ONE_ROW_ICON + 1; 131 | else 132 | x = [_iconArray count]/ONE_ROW_ICON ; 133 | 134 | [self.view setAlpha:0.0]; 135 | [self.view setFrame:CGRectMake(VIEW_ORIGIN_X, VIEW_ORIGIN_Y, (MARGIN_X+BTN_W_H)*ONE_ROW_ICON+MARGIN_X, BUTTOM_MARGIN + (BTN_W_H+MARGIN_Y)*x)]; 136 | [self.view setClipsToBounds:true]; 137 | [self.view setBackgroundColor:[UIColor blackColor]]; 138 | UIImage *backgroundImage = [UIImage imageNamed:@"balloon.png"]; 139 | [self.view setBackgroundColor:[UIColor colorWithPatternImage:backgroundImage]]; 140 | self.view.layer.cornerRadius = 5; 141 | } 142 | 143 | 144 | 145 | 146 | #pragma Menu Button 147 | 148 | //------------------------- 149 | // Icon load&set 150 | //------------------------- 151 | -(void)loadImage{ 152 | 153 | _iconArray = [_ar mutableCopy]; 154 | 155 | int index = 0; 156 | int row = 0; 157 | int count = 0; 158 | for (NSString *tmpStr in _iconArray){ 159 | 160 | if(count{} of .m file of your project describes the next code. 20 | `__strong SGSelectViewController * _sg;` 21 | 22 | Next, addSubview. 23 | `_sg = [[SGSelectViewController alloc]init]; [self.view addSubview:_sg.view];` 24 | 25 | Since preparation was completed now, the following method is only called. 26 | `-(void)sgViewAppear;` 27 | The example of a source code. 28 | `[_sg sgViewAppear];` 29 | 30 | 31 | menu is displayed now. 32 | When you want to change the icon of a menu, it is necessary to add the created icon into your project and to change the picture name in arrangement called _ar in `-(void) setImage` of SGSelectViewController.m. 33 | A maximum of 20 icons can be displayed. 34 | 35 | Please adjust the position of a menu by `#define VIEW_ORIGIN_X` and `#define VIEW_ORIGIN_Y` in SGSelectViewController.m. 36 | 37 | Since there is sample project, please check a motion. 38 | 39 | 40 | License 41 | ====== 42 | This is MIT LICENSE. 43 | Please read a LICENSE file for details. 44 | 45 | 46 | Screen Shot 47 | =========== 48 | ![](images/ss.png) -------------------------------------------------------------------------------- /SGSelectViewController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 761F4C691657E4F7001FE79A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 761F4C681657E4F7001FE79A /* UIKit.framework */; }; 11 | 761F4C6B1657E4F7001FE79A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 761F4C6A1657E4F7001FE79A /* Foundation.framework */; }; 12 | 761F4C6D1657E4F7001FE79A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 761F4C6C1657E4F7001FE79A /* CoreGraphics.framework */; }; 13 | 761F4C731657E4F7001FE79A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 761F4C711657E4F7001FE79A /* InfoPlist.strings */; }; 14 | 761F4C751657E4F7001FE79A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 761F4C741657E4F7001FE79A /* main.m */; }; 15 | 761F4C791657E4F7001FE79A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 761F4C781657E4F7001FE79A /* AppDelegate.m */; }; 16 | 761F4C7B1657E4F7001FE79A /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 761F4C7A1657E4F7001FE79A /* Default.png */; }; 17 | 761F4C7D1657E4F7001FE79A /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 761F4C7C1657E4F7001FE79A /* Default@2x.png */; }; 18 | 761F4C7F1657E4F7001FE79A /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 761F4C7E1657E4F7001FE79A /* Default-568h@2x.png */; }; 19 | 761F4C821657E4F7001FE79A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 761F4C811657E4F7001FE79A /* ViewController.m */; }; 20 | 761F4C851657E4F7001FE79A /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 761F4C831657E4F7001FE79A /* ViewController.xib */; }; 21 | 761F4C951657F2DE001FE79A /* SGSelectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 761F4C941657F2DE001FE79A /* SGSelectViewController.m */; }; 22 | 761F4CB51658016F001FE79A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 761F4CB316580164001FE79A /* QuartzCore.framework */; }; 23 | 762B0801165BCE7F0040ED9F /* balloon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07F4165BCE7F0040ED9F /* balloon@2x.png */; }; 24 | 762B0802165BCE7F0040ED9F /* choseBtn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07F5165BCE7F0040ED9F /* choseBtn@2x.png */; }; 25 | 762B0803165BCE7F0040ED9F /* ok@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07F6165BCE7F0040ED9F /* ok@2x.png */; }; 26 | 762B0804165BCE7F0040ED9F /* plan_eat@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07F7165BCE7F0040ED9F /* plan_eat@2x.png */; }; 27 | 762B0806165BCE7F0040ED9F /* plan_nature@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07F9165BCE7F0040ED9F /* plan_nature@2x.png */; }; 28 | 762B0807165BCE7F0040ED9F /* plan_plane@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07FA165BCE7F0040ED9F /* plan_plane@2x.png */; }; 29 | 762B0808165BCE7F0040ED9F /* plan_rest@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07FB165BCE7F0040ED9F /* plan_rest@2x.png */; }; 30 | 762B0809165BCE7F0040ED9F /* plan_shopping@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07FC165BCE7F0040ED9F /* plan_shopping@2x.png */; }; 31 | 762B080A165BCE7F0040ED9F /* plan_sports@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07FD165BCE7F0040ED9F /* plan_sports@2x.png */; }; 32 | 762B080B165BCE7F0040ED9F /* plan_structure@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07FE165BCE7F0040ED9F /* plan_structure@2x.png */; }; 33 | 762B080C165BCE7F0040ED9F /* plan_train@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B07FF165BCE7F0040ED9F /* plan_train@2x.png */; }; 34 | 762B080D165BCE7F0040ED9F /* plan_walk@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 762B0800165BCE7F0040ED9F /* plan_walk@2x.png */; }; 35 | /* End PBXBuildFile section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 761F4C641657E4F7001FE79A /* SGSelectViewController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SGSelectViewController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 761F4C681657E4F7001FE79A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 40 | 761F4C6A1657E4F7001FE79A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 41 | 761F4C6C1657E4F7001FE79A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 42 | 761F4C701657E4F7001FE79A /* SGSelectViewController-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SGSelectViewController-Info.plist"; sourceTree = ""; }; 43 | 761F4C721657E4F7001FE79A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 44 | 761F4C741657E4F7001FE79A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | 761F4C761657E4F7001FE79A /* SGSelectViewController-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SGSelectViewController-Prefix.pch"; sourceTree = ""; }; 46 | 761F4C771657E4F7001FE79A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 47 | 761F4C781657E4F7001FE79A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 48 | 761F4C7A1657E4F7001FE79A /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 49 | 761F4C7C1657E4F7001FE79A /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 50 | 761F4C7E1657E4F7001FE79A /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 51 | 761F4C801657E4F7001FE79A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 52 | 761F4C811657E4F7001FE79A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 53 | 761F4C841657E4F7001FE79A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = ""; }; 54 | 761F4C931657F2DE001FE79A /* SGSelectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGSelectViewController.h; sourceTree = ""; }; 55 | 761F4C941657F2DE001FE79A /* SGSelectViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGSelectViewController.m; sourceTree = ""; }; 56 | 761F4CB316580164001FE79A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 57 | 762B07F4165BCE7F0040ED9F /* balloon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "balloon@2x.png"; sourceTree = ""; }; 58 | 762B07F5165BCE7F0040ED9F /* choseBtn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "choseBtn@2x.png"; sourceTree = ""; }; 59 | 762B07F6165BCE7F0040ED9F /* ok@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ok@2x.png"; sourceTree = ""; }; 60 | 762B07F7165BCE7F0040ED9F /* plan_eat@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plan_eat@2x.png"; sourceTree = ""; }; 61 | 762B07F9165BCE7F0040ED9F /* plan_nature@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plan_nature@2x.png"; sourceTree = ""; }; 62 | 762B07FA165BCE7F0040ED9F /* plan_plane@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plan_plane@2x.png"; sourceTree = ""; }; 63 | 762B07FB165BCE7F0040ED9F /* plan_rest@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plan_rest@2x.png"; sourceTree = ""; }; 64 | 762B07FC165BCE7F0040ED9F /* plan_shopping@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plan_shopping@2x.png"; sourceTree = ""; }; 65 | 762B07FD165BCE7F0040ED9F /* plan_sports@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plan_sports@2x.png"; sourceTree = ""; }; 66 | 762B07FE165BCE7F0040ED9F /* plan_structure@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plan_structure@2x.png"; sourceTree = ""; }; 67 | 762B07FF165BCE7F0040ED9F /* plan_train@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plan_train@2x.png"; sourceTree = ""; }; 68 | 762B0800165BCE7F0040ED9F /* plan_walk@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plan_walk@2x.png"; sourceTree = ""; }; 69 | /* End PBXFileReference section */ 70 | 71 | /* Begin PBXFrameworksBuildPhase section */ 72 | 761F4C611657E4F7001FE79A /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | 761F4CB51658016F001FE79A /* QuartzCore.framework in Frameworks */, 77 | 761F4C691657E4F7001FE79A /* UIKit.framework in Frameworks */, 78 | 761F4C6B1657E4F7001FE79A /* Foundation.framework in Frameworks */, 79 | 761F4C6D1657E4F7001FE79A /* CoreGraphics.framework in Frameworks */, 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXFrameworksBuildPhase section */ 84 | 85 | /* Begin PBXGroup section */ 86 | 761F4C591657E4F6001FE79A = { 87 | isa = PBXGroup; 88 | children = ( 89 | 761F4C6E1657E4F7001FE79A /* SGSelectViewController */, 90 | 761F4C671657E4F7001FE79A /* Frameworks */, 91 | 761F4C651657E4F7001FE79A /* Products */, 92 | ); 93 | sourceTree = ""; 94 | }; 95 | 761F4C651657E4F7001FE79A /* Products */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 761F4C641657E4F7001FE79A /* SGSelectViewController.app */, 99 | ); 100 | name = Products; 101 | sourceTree = ""; 102 | }; 103 | 761F4C671657E4F7001FE79A /* Frameworks */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 761F4CB316580164001FE79A /* QuartzCore.framework */, 107 | 761F4C681657E4F7001FE79A /* UIKit.framework */, 108 | 761F4C6A1657E4F7001FE79A /* Foundation.framework */, 109 | 761F4C6C1657E4F7001FE79A /* CoreGraphics.framework */, 110 | ); 111 | name = Frameworks; 112 | sourceTree = ""; 113 | }; 114 | 761F4C6E1657E4F7001FE79A /* SGSelectViewController */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 762B07F3165BCE7F0040ED9F /* images */, 118 | 761F4C8B1657F149001FE79A /* lib */, 119 | 761F4C771657E4F7001FE79A /* AppDelegate.h */, 120 | 761F4C781657E4F7001FE79A /* AppDelegate.m */, 121 | 761F4C801657E4F7001FE79A /* ViewController.h */, 122 | 761F4C811657E4F7001FE79A /* ViewController.m */, 123 | 761F4C831657E4F7001FE79A /* ViewController.xib */, 124 | 761F4C6F1657E4F7001FE79A /* Supporting Files */, 125 | ); 126 | path = SGSelectViewController; 127 | sourceTree = ""; 128 | }; 129 | 761F4C6F1657E4F7001FE79A /* Supporting Files */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 761F4C701657E4F7001FE79A /* SGSelectViewController-Info.plist */, 133 | 761F4C711657E4F7001FE79A /* InfoPlist.strings */, 134 | 761F4C741657E4F7001FE79A /* main.m */, 135 | 761F4C761657E4F7001FE79A /* SGSelectViewController-Prefix.pch */, 136 | 761F4C7A1657E4F7001FE79A /* Default.png */, 137 | 761F4C7C1657E4F7001FE79A /* Default@2x.png */, 138 | 761F4C7E1657E4F7001FE79A /* Default-568h@2x.png */, 139 | ); 140 | name = "Supporting Files"; 141 | sourceTree = ""; 142 | }; 143 | 761F4C8B1657F149001FE79A /* lib */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 761F4C931657F2DE001FE79A /* SGSelectViewController.h */, 147 | 761F4C941657F2DE001FE79A /* SGSelectViewController.m */, 148 | ); 149 | path = lib; 150 | sourceTree = SOURCE_ROOT; 151 | }; 152 | 762B07F3165BCE7F0040ED9F /* images */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | 762B07F4165BCE7F0040ED9F /* balloon@2x.png */, 156 | 762B07F5165BCE7F0040ED9F /* choseBtn@2x.png */, 157 | 762B07F6165BCE7F0040ED9F /* ok@2x.png */, 158 | 762B07F7165BCE7F0040ED9F /* plan_eat@2x.png */, 159 | 762B07F9165BCE7F0040ED9F /* plan_nature@2x.png */, 160 | 762B07FA165BCE7F0040ED9F /* plan_plane@2x.png */, 161 | 762B07FB165BCE7F0040ED9F /* plan_rest@2x.png */, 162 | 762B07FC165BCE7F0040ED9F /* plan_shopping@2x.png */, 163 | 762B07FD165BCE7F0040ED9F /* plan_sports@2x.png */, 164 | 762B07FE165BCE7F0040ED9F /* plan_structure@2x.png */, 165 | 762B07FF165BCE7F0040ED9F /* plan_train@2x.png */, 166 | 762B0800165BCE7F0040ED9F /* plan_walk@2x.png */, 167 | ); 168 | path = images; 169 | sourceTree = SOURCE_ROOT; 170 | }; 171 | /* End PBXGroup section */ 172 | 173 | /* Begin PBXNativeTarget section */ 174 | 761F4C631657E4F7001FE79A /* SGSelectViewController */ = { 175 | isa = PBXNativeTarget; 176 | buildConfigurationList = 761F4C881657E4F7001FE79A /* Build configuration list for PBXNativeTarget "SGSelectViewController" */; 177 | buildPhases = ( 178 | 761F4C601657E4F7001FE79A /* Sources */, 179 | 761F4C611657E4F7001FE79A /* Frameworks */, 180 | 761F4C621657E4F7001FE79A /* Resources */, 181 | ); 182 | buildRules = ( 183 | ); 184 | dependencies = ( 185 | ); 186 | name = SGSelectViewController; 187 | productName = SGSelectViewController; 188 | productReference = 761F4C641657E4F7001FE79A /* SGSelectViewController.app */; 189 | productType = "com.apple.product-type.application"; 190 | }; 191 | /* End PBXNativeTarget section */ 192 | 193 | /* Begin PBXProject section */ 194 | 761F4C5B1657E4F6001FE79A /* Project object */ = { 195 | isa = PBXProject; 196 | attributes = { 197 | LastUpgradeCheck = 0450; 198 | ORGANIZATIONNAME = MacoTasu; 199 | }; 200 | buildConfigurationList = 761F4C5E1657E4F6001FE79A /* Build configuration list for PBXProject "SGSelectViewController" */; 201 | compatibilityVersion = "Xcode 3.2"; 202 | developmentRegion = English; 203 | hasScannedForEncodings = 0; 204 | knownRegions = ( 205 | en, 206 | ); 207 | mainGroup = 761F4C591657E4F6001FE79A; 208 | productRefGroup = 761F4C651657E4F7001FE79A /* Products */; 209 | projectDirPath = ""; 210 | projectRoot = ""; 211 | targets = ( 212 | 761F4C631657E4F7001FE79A /* SGSelectViewController */, 213 | ); 214 | }; 215 | /* End PBXProject section */ 216 | 217 | /* Begin PBXResourcesBuildPhase section */ 218 | 761F4C621657E4F7001FE79A /* Resources */ = { 219 | isa = PBXResourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | 761F4C731657E4F7001FE79A /* InfoPlist.strings in Resources */, 223 | 761F4C7B1657E4F7001FE79A /* Default.png in Resources */, 224 | 761F4C7D1657E4F7001FE79A /* Default@2x.png in Resources */, 225 | 761F4C7F1657E4F7001FE79A /* Default-568h@2x.png in Resources */, 226 | 761F4C851657E4F7001FE79A /* ViewController.xib in Resources */, 227 | 762B0801165BCE7F0040ED9F /* balloon@2x.png in Resources */, 228 | 762B0802165BCE7F0040ED9F /* choseBtn@2x.png in Resources */, 229 | 762B0803165BCE7F0040ED9F /* ok@2x.png in Resources */, 230 | 762B0804165BCE7F0040ED9F /* plan_eat@2x.png in Resources */, 231 | 762B0806165BCE7F0040ED9F /* plan_nature@2x.png in Resources */, 232 | 762B0807165BCE7F0040ED9F /* plan_plane@2x.png in Resources */, 233 | 762B0808165BCE7F0040ED9F /* plan_rest@2x.png in Resources */, 234 | 762B0809165BCE7F0040ED9F /* plan_shopping@2x.png in Resources */, 235 | 762B080A165BCE7F0040ED9F /* plan_sports@2x.png in Resources */, 236 | 762B080B165BCE7F0040ED9F /* plan_structure@2x.png in Resources */, 237 | 762B080C165BCE7F0040ED9F /* plan_train@2x.png in Resources */, 238 | 762B080D165BCE7F0040ED9F /* plan_walk@2x.png in Resources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | /* End PBXResourcesBuildPhase section */ 243 | 244 | /* Begin PBXSourcesBuildPhase section */ 245 | 761F4C601657E4F7001FE79A /* Sources */ = { 246 | isa = PBXSourcesBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | 761F4C751657E4F7001FE79A /* main.m in Sources */, 250 | 761F4C791657E4F7001FE79A /* AppDelegate.m in Sources */, 251 | 761F4C821657E4F7001FE79A /* ViewController.m in Sources */, 252 | 761F4C951657F2DE001FE79A /* SGSelectViewController.m in Sources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXSourcesBuildPhase section */ 257 | 258 | /* Begin PBXVariantGroup section */ 259 | 761F4C711657E4F7001FE79A /* InfoPlist.strings */ = { 260 | isa = PBXVariantGroup; 261 | children = ( 262 | 761F4C721657E4F7001FE79A /* en */, 263 | ); 264 | name = InfoPlist.strings; 265 | sourceTree = ""; 266 | }; 267 | 761F4C831657E4F7001FE79A /* ViewController.xib */ = { 268 | isa = PBXVariantGroup; 269 | children = ( 270 | 761F4C841657E4F7001FE79A /* en */, 271 | ); 272 | name = ViewController.xib; 273 | sourceTree = ""; 274 | }; 275 | /* End PBXVariantGroup section */ 276 | 277 | /* Begin XCBuildConfiguration section */ 278 | 761F4C861657E4F7001FE79A /* Debug */ = { 279 | isa = XCBuildConfiguration; 280 | buildSettings = { 281 | ALWAYS_SEARCH_USER_PATHS = NO; 282 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 283 | CLANG_CXX_LIBRARY = "libc++"; 284 | CLANG_ENABLE_OBJC_ARC = YES; 285 | CLANG_WARN_EMPTY_BODY = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | GCC_C_LANGUAGE_STANDARD = gnu99; 290 | GCC_DYNAMIC_NO_PIC = NO; 291 | GCC_OPTIMIZATION_LEVEL = 0; 292 | GCC_PREPROCESSOR_DEFINITIONS = ( 293 | "DEBUG=1", 294 | "$(inherited)", 295 | ); 296 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 297 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 298 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 301 | SDKROOT = iphoneos; 302 | }; 303 | name = Debug; 304 | }; 305 | 761F4C871657E4F7001FE79A /* Release */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ALWAYS_SEARCH_USER_PATHS = NO; 309 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 310 | CLANG_CXX_LIBRARY = "libc++"; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_WARN_EMPTY_BODY = YES; 313 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 314 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 315 | COPY_PHASE_STRIP = YES; 316 | GCC_C_LANGUAGE_STANDARD = gnu99; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 318 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 319 | GCC_WARN_UNUSED_VARIABLE = YES; 320 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 321 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 322 | SDKROOT = iphoneos; 323 | VALIDATE_PRODUCT = YES; 324 | }; 325 | name = Release; 326 | }; 327 | 761F4C891657E4F7001FE79A /* Debug */ = { 328 | isa = XCBuildConfiguration; 329 | buildSettings = { 330 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 331 | GCC_PREFIX_HEADER = "SGSelectViewController/SGSelectViewController-Prefix.pch"; 332 | INFOPLIST_FILE = "SGSelectViewController/SGSelectViewController-Info.plist"; 333 | PRODUCT_NAME = "$(TARGET_NAME)"; 334 | WRAPPER_EXTENSION = app; 335 | }; 336 | name = Debug; 337 | }; 338 | 761F4C8A1657E4F7001FE79A /* Release */ = { 339 | isa = XCBuildConfiguration; 340 | buildSettings = { 341 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 342 | GCC_PREFIX_HEADER = "SGSelectViewController/SGSelectViewController-Prefix.pch"; 343 | INFOPLIST_FILE = "SGSelectViewController/SGSelectViewController-Info.plist"; 344 | PRODUCT_NAME = "$(TARGET_NAME)"; 345 | WRAPPER_EXTENSION = app; 346 | }; 347 | name = Release; 348 | }; 349 | /* End XCBuildConfiguration section */ 350 | 351 | /* Begin XCConfigurationList section */ 352 | 761F4C5E1657E4F6001FE79A /* Build configuration list for PBXProject "SGSelectViewController" */ = { 353 | isa = XCConfigurationList; 354 | buildConfigurations = ( 355 | 761F4C861657E4F7001FE79A /* Debug */, 356 | 761F4C871657E4F7001FE79A /* Release */, 357 | ); 358 | defaultConfigurationIsVisible = 0; 359 | defaultConfigurationName = Release; 360 | }; 361 | 761F4C881657E4F7001FE79A /* Build configuration list for PBXNativeTarget "SGSelectViewController" */ = { 362 | isa = XCConfigurationList; 363 | buildConfigurations = ( 364 | 761F4C891657E4F7001FE79A /* Debug */, 365 | 761F4C8A1657E4F7001FE79A /* Release */, 366 | ); 367 | defaultConfigurationIsVisible = 0; 368 | defaultConfigurationName = Release; 369 | }; 370 | /* End XCConfigurationList section */ 371 | }; 372 | rootObject = 761F4C5B1657E4F6001FE79A /* Project object */; 373 | } 374 | -------------------------------------------------------------------------------- /SGSelectViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SGSelectViewController.xcodeproj/project.xcworkspace/xcuserdata/ne210236.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/SGSelectViewController.xcodeproj/project.xcworkspace/xcuserdata/ne210236.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SGSelectViewController.xcodeproj/xcuserdata/ne210236.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SGSelectViewController.xcodeproj/xcuserdata/ne210236.xcuserdatad/xcschemes/SGSelectViewController.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /SGSelectViewController.xcodeproj/xcuserdata/ne210236.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SGSelectViewController.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 761F4C631657E4F7001FE79A 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SGSelectViewController/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SGSelectViewController 4 | // 5 | // Created by Maco_Tasu on 12/11/18. 6 | // Copyright (c) 2012年 MacoTasu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ViewController; 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | @property (strong, nonatomic) ViewController *viewController; 16 | @property (weak, nonatomic) UIButton *selectBtn; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /SGSelectViewController/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SGSelectViewController 4 | // 5 | // Created by Maco_Tasu on 12/11/18. 6 | // Copyright (c) 2012年 MacoTasu. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "ViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | // Override point for customization after application launch. 19 | self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; 20 | self.window.rootViewController = self.viewController; 21 | 22 | [self.window makeKeyAndVisible]; 23 | return YES; 24 | } 25 | 26 | 27 | - (void)applicationWillResignActive:(UIApplication *)application 28 | { 29 | // 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. 30 | // 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. 31 | } 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application 34 | { 35 | // 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. 36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application 40 | { 41 | // 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. 42 | } 43 | 44 | - (void)applicationDidBecomeActive:(UIApplication *)application 45 | { 46 | // 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. 47 | } 48 | 49 | - (void)applicationWillTerminate:(UIApplication *)application 50 | { 51 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /SGSelectViewController/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/SGSelectViewController/Default-568h@2x.png -------------------------------------------------------------------------------- /SGSelectViewController/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/SGSelectViewController/Default.png -------------------------------------------------------------------------------- /SGSelectViewController/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/SGSelectViewController/Default@2x.png -------------------------------------------------------------------------------- /SGSelectViewController/SGSelectViewController-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | -.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /SGSelectViewController/SGSelectViewController-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'SGSelectViewController' target in the 'SGSelectViewController' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #import "SGSelectViewController.h" 15 | #import "ViewController.h" 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /SGSelectViewController/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // SGSelectViewController 4 | // 5 | // Created by Maco_Tasu on 12/11/18. 6 | // Copyright (c) 2012年 MacoTasu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | -(IBAction)tap:(id)sender; 14 | @property(nonatomic,weak)UIButton *selectBtn; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /SGSelectViewController/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // SGSelectViewController 4 | // 5 | // Created by Maco_Tasu on 12/11/18. 6 | // Copyright (c) 2012年 MacoTasu. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "AppDelegate.h" 11 | 12 | @interface ViewController () 13 | -(void)loadMenu; 14 | -(void)btn; 15 | -(void)tap:(id)sender; 16 | @end 17 | 18 | 19 | @implementation ViewController { 20 | __strong SGSelectViewController *_sg; 21 | IBOutlet UILabel *_iconLbl; 22 | } 23 | 24 | 25 | #pragma view cycle 26 | 27 | - (void)viewDidLoad 28 | { 29 | //------------------------- 30 | // initialize 31 | //------------------------- 32 | _sg = [[SGSelectViewController alloc]init]; 33 | 34 | [self loadMenu]; 35 | [self btn]; 36 | 37 | 38 | AppDelegate *appDelegate; 39 | appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; 40 | appDelegate.selectBtn = self.selectBtn; 41 | 42 | 43 | [super viewDidLoad]; 44 | // Do any additional setup after loading the view, typically from a nib. 45 | } 46 | 47 | 48 | //----------------------------- 49 | // This Method load Icon-View 50 | //----------------------------- 51 | -(void)loadMenu{ 52 | 53 | [self.view addSubview:_sg.view]; 54 | } 55 | 56 | 57 | //----------------------------- 58 | // Call Show Menu & Set Icon 59 | //----------------------------- 60 | -(void)tap:(id)sender{ 61 | 62 | [_sg sgViewAppear]; 63 | } 64 | 65 | 66 | //----------------------------- 67 | // UIButton 68 | //----------------------------- 69 | -(void)btn{ 70 | 71 | _selectBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 72 | [_selectBtn setFrame:CGRectMake(20, 20, 44, 44)]; 73 | [_selectBtn setBackgroundImage:[UIImage imageNamed:@"choseBtn.png"] forState:UIControlStateNormal]; 74 | [_selectBtn addTarget:self action:@selector(tap:) forControlEvents:UIControlEventTouchUpInside]; 75 | [self.view addSubview:_selectBtn]; 76 | 77 | } 78 | 79 | - (void)didReceiveMemoryWarning 80 | { 81 | [super didReceiveMemoryWarning]; 82 | // Dispose of any resources that can be recreated. 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /SGSelectViewController/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /SGSelectViewController/en.lproj/ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 11G63 6 | 2840 7 | 1138.51 8 | 569.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1926 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBCocoaTouchFramework 28 | 29 | 30 | IBFirstResponder 31 | IBCocoaTouchFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {320, 548}} 37 | 38 | 39 | 40 | 1 41 | MSAxIDEAA 42 | 43 | NO 44 | 45 | 46 | IBUIScreenMetrics 47 | 48 | YES 49 | 50 | 51 | 52 | 53 | 54 | {320, 568} 55 | {568, 320} 56 | 57 | 58 | IBCocoaTouchFramework 59 | Retina 4 Full Screen 60 | 2 61 | 62 | IBCocoaTouchFramework 63 | 64 | 65 | 66 | 67 | 68 | 69 | view 70 | 71 | 72 | 73 | 7 74 | 75 | 76 | 77 | 78 | 79 | 0 80 | 81 | 82 | 83 | 84 | 85 | -1 86 | 87 | 88 | File's Owner 89 | 90 | 91 | -2 92 | 93 | 94 | 95 | 96 | 6 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | ViewController 105 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 106 | UIResponder 107 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 108 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 109 | 110 | 111 | 112 | 113 | 114 | 60 115 | 116 | 117 | 0 118 | IBCocoaTouchFramework 119 | YES 120 | 3 121 | YES 122 | 1926 123 | 124 | 125 | -------------------------------------------------------------------------------- /SGSelectViewController/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SGSelectViewController 4 | // 5 | // Created by Maco_Tasu on 12/11/18. 6 | // Copyright (c) 2012年 MacoTasu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /images/balloon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/balloon@2x.png -------------------------------------------------------------------------------- /images/choseBtn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/choseBtn@2x.png -------------------------------------------------------------------------------- /images/full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/full.png -------------------------------------------------------------------------------- /images/ok@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/ok@2x.png -------------------------------------------------------------------------------- /images/plan_eat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/plan_eat@2x.png -------------------------------------------------------------------------------- /images/plan_nature@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/plan_nature@2x.png -------------------------------------------------------------------------------- /images/plan_plane@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/plan_plane@2x.png -------------------------------------------------------------------------------- /images/plan_rest@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/plan_rest@2x.png -------------------------------------------------------------------------------- /images/plan_shopping@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/plan_shopping@2x.png -------------------------------------------------------------------------------- /images/plan_sports@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/plan_sports@2x.png -------------------------------------------------------------------------------- /images/plan_structure@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/plan_structure@2x.png -------------------------------------------------------------------------------- /images/plan_train@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/plan_train@2x.png -------------------------------------------------------------------------------- /images/plan_walk@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/plan_walk@2x.png -------------------------------------------------------------------------------- /images/ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MacoTasu/SGSelectViewController/f75b20d24a7000fd8504870c815dbfbfead9280f/images/ss.png -------------------------------------------------------------------------------- /lib/SGSelectViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SGSelectViewController.h 3 | // SGSelectViewController 4 | // 5 | // Created by Maco_Tasu on 12/11/18. 6 | // Copyright (c) 2012年 MacoTasu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class SGSelectViewController; 13 | @interface SGSelectViewController : UIViewController 14 | @property(nonatomic , weak)UIButton *selectBtn; 15 | -(void)sgViewAppear; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /lib/SGSelectViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SGSelectViewController.m 3 | // SGSelectViewController 4 | // 5 | // Created by Maco_Tasu on 12/11/18. 6 | // Copyright (c) 2012年 MacoTasu. All rights reserved. 7 | // 8 | 9 | #import "SGSelectViewController.h" 10 | #import "AppDelegate.h" 11 | 12 | @interface SGSelectViewController () 13 | - (id)init; 14 | - (void)setImage; 15 | - (void)loadImage; 16 | - (void)viewDetail; 17 | -(void)changeIcon:(id)sender; 18 | -(void)highlightButton:(UIButton *)btn; 19 | -(void)sgViewDissAppear; 20 | -(void)endAnimation; 21 | -(void)didEnd; 22 | @end 23 | 24 | #define VIEW_ORIGIN_X 10 25 | #define VIEW_ORIGIN_Y 70 26 | #define BUTTOM_MARGIN 20 27 | #define TOP_MARGIN 21 28 | #define MARGIN_X 10 29 | #define MARGIN_Y 10 30 | 31 | 32 | //------------------------- 33 | // You should change the following two sizes 34 | // if you want to change the number of a party's icons or icons sizes. 35 | //------------------------- 36 | #define BTN_W_H 48 37 | #define ONE_ROW_ICON 5 38 | 39 | //------------------------- 40 | // The number of buttons needs to be the same as the number of [NSDictionary count]. 41 | // Under the present circumstances, it is OK to 20 pieces. 42 | //------------------------- 43 | #define BUTTON_COUNT 20 44 | 45 | 46 | 47 | @implementation SGSelectViewController{ 48 | __strong NSArray *_ar; 49 | NSInteger _iconNumber; 50 | NSMutableArray *_iconArray; 51 | UIButton *_btn[BUTTON_COUNT]; 52 | } 53 | 54 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 55 | { 56 | 57 | 58 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 59 | if (self) { 60 | 61 | //------------------------- 62 | // initialize 63 | //------------------------- 64 | [self setView:[[UIView alloc] init]]; 65 | _iconArray = [[NSMutableArray alloc]init]; 66 | _iconNumber = -1; 67 | 68 | } 69 | return self; 70 | } 71 | 72 | -(id)init{ 73 | 74 | self = [super init]; 75 | 76 | if (self) { 77 | 78 | [self setImage]; 79 | [self loadImage]; 80 | [self viewDetail]; 81 | 82 | } 83 | 84 | return self; 85 | } 86 | 87 | 88 | #pragma Icon 89 | 90 | //------------------------- 91 | // Set-Icon 92 | //------------------------- 93 | -(void)setImage{ 94 | 95 | _ar = [NSArray arrayWithObjects: 96 | @"plan_rest.png", 97 | @"plan_train.png", 98 | @"plan_structure.png", 99 | @"plan_nature.png", 100 | @"plan_walk.png", 101 | @"plan_shopping.png", 102 | @"plan_eat.png", 103 | @"plan_plane.png", 104 | @"plan_sports.png", 105 | @"plan_nature.png", 106 | @"plan_walk.png", 107 | @"plan_shopping.png", 108 | @"plan_eat.png", 109 | @"plan_plane.png", 110 | @"plan_sports.png", 111 | @"plan_eat.png", 112 | @"plan_plane.png", 113 | @"plan_sports.png", 114 | @"plan_rest.png", 115 | @"plan_structure.png",nil]; 116 | } 117 | 118 | 119 | #pragma self.view 120 | 121 | //------------------------- 122 | // self.view setting 123 | //------------------------- 124 | -(void)viewDetail{ 125 | 126 | //x is Row count 127 | int x = 0; 128 | 129 | if([_iconArray count] % ONE_ROW_ICON != 0) 130 | x = [_iconArray count]/ONE_ROW_ICON + 1; 131 | else 132 | x = [_iconArray count]/ONE_ROW_ICON ; 133 | 134 | [self.view setAlpha:0.0]; 135 | [self.view setFrame:CGRectMake(VIEW_ORIGIN_X, VIEW_ORIGIN_Y, (MARGIN_X+BTN_W_H)*ONE_ROW_ICON+MARGIN_X, BUTTOM_MARGIN + (BTN_W_H+MARGIN_Y)*x)]; 136 | [self.view setClipsToBounds:true]; 137 | [self.view setBackgroundColor:[UIColor blackColor]]; 138 | UIImage *backgroundImage = [UIImage imageNamed:@"balloon.png"]; 139 | [self.view setBackgroundColor:[UIColor colorWithPatternImage:backgroundImage]]; 140 | self.view.layer.cornerRadius = 5; 141 | } 142 | 143 | 144 | 145 | 146 | #pragma Menu Button 147 | 148 | //------------------------- 149 | // Icon load&set 150 | //------------------------- 151 | -(void)loadImage{ 152 | 153 | _iconArray = [_ar mutableCopy]; 154 | 155 | int index = 0; 156 | int row = 0; 157 | int count = 0; 158 | for (NSString *tmpStr in _iconArray){ 159 | 160 | if(count