├── README.md ├── RoomManage.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── ZQT.xcuserdatad │ └── xcschemes │ ├── RoomManage.xcscheme │ └── xcschememanagement.plist ├── RoomManage ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ManageRoom │ ├── Controller │ │ ├── QTManageViewController.h │ │ └── QTManageViewController.m │ ├── Model │ │ ├── QTDate.h │ │ ├── QTDate.m │ │ ├── QTRoom.h │ │ ├── QTRoom.m │ │ └── RoomList.plist │ ├── Tool │ │ ├── QTDateTool.h │ │ ├── QTDateTool.m │ │ ├── UILabel+QTCategory.h │ │ ├── UILabel+QTCategory.m │ │ ├── UIView+Extension.h │ │ └── UIView+Extension.m │ └── View │ │ ├── LeftRoomNumberTableView.h │ │ ├── LeftRoomNumberTableView.m │ │ ├── QTDateCollectionView.h │ │ ├── QTDateCollectionView.m │ │ ├── QTSelectCollectionView.h │ │ └── QTSelectCollectionView.m ├── PrefixHeader.pch ├── Screenshots │ ├── Simulator Screen Shot 2016年8月19日 14.21.57.png │ └── Untitled.gif ├── ViewController.h ├── ViewController.m └── main.m ├── RoomManageTests ├── Info.plist └── RoomManageTests.m └── RoomManageUITests ├── Info.plist └── RoomManageUITests.m /README.md: -------------------------------------------------------------------------------- 1 | # RoomManage 2 | #RoomManage(农家乐房间管理) 3 | 4 | #农家乐房间管理 ,方便农家乐主人管理自己的房间. 5 | ##上部是日期显示 (以当前日期为开始往后 60天) 6 | ##左侧是 房间号 , 7 | ##可以上下,左右滑动,方便管理农家乐的预定情况. 8 | ##主要控件: UIScrollView 和 CollectionView 9 | ## 主要代码 10 | #### QTSelectCollectionView 11 | @protocol QTSelectCollectionViewDelegate 12 | @optional 13 | @protocol QTSelectCollectionViewDelegate 14 | @optional 15 | /// 监听dateCollectionView的滚动位移 16 | - (void)selectCollectionView:(QTSelectCollectionView *)collectionView DidScrollWithContentOffset:(CGPoint)contentOffset; 17 | // 监听选中某个cell 18 | - (void)selectCollectionView:(QTSelectCollectionView *)collectionView didSelectItemAtIndex:(NSInteger)index; 19 | 20 | @end 21 | 22 | @interface QTSelectCollectionView : UICollectionView 23 | 24 | /// 所有被选中cell的索引 25 | @property (nonatomic,strong) NSMutableArray *SelectedCellIndexs; 26 | /// 所有被选中cell的订单Id 27 | @property (nonatomic,strong) NSMutableArray *SelectedCellAccountingIds; 28 | 29 | /// cell的大小 30 | @property (nonatomic,assign) CGSize itemSize; 31 | 32 | //**代理/ 33 | @property (nonatomic, weak)id SelectColDelegate; 34 | 35 | ### QTDateCollectionView 36 | @class QTDate,QTDateCollectionView; 37 | 38 | @protocol QTDateCollectionViewDelegate 39 | @optional 40 | 41 | /// 监听的滚动位移 42 | - (void)dateCollectionView:(QTDateCollectionView *)collectionView DidScrollWithContentOffset:(CGPoint)contentOffset; 43 | 44 | @end 45 | 46 | @interface QTDateCollectionView : UICollectionView 47 | 48 | /// cell的大小 49 | @property (nonatomic,assign) CGSize itemSize; 50 | 51 | //**代理*/ 52 | @property (nonatomic, weak) id dateDelegate; 53 | @end 54 | 55 | ### 控制器 56 | 57 | #pragma mark 准备UI 58 | - (void)prepareUI { 59 | //1,添加子控件 60 | [self.view addSubview:self.roomNoView]; 61 | [self.view addSubview:self.totalNoView]; 62 | [self.view addSubview:self.dateCollectionView]; 63 | [self.view addSubview:self.backScrollView]; 64 | 65 | // 2.设置frame 66 | // 设置roomNoView、totalNoView 67 | CGFloat viewY = 0; 68 | self.roomNoView.frame = CGRectMake(0, viewY, viewWidth*2, viewHeight*heightMultiple*0.5); 69 | self.totalNoView.frame = CGRectMake(0, viewY + viewHeight * heightMultiple * 0.5, viewWidth*2, viewHeight*heightMultiple*0.5); 70 | // 设置collectionViewW 71 | self.dateCollectionView.frame = CGRectMake(viewWidth * 2, 0, collectionViewW, viewHeight*heightMultiple); 72 | itemW = (collectionViewW - 4)*0.2; 73 | self.dateCollectionView.itemSize = CGSizeMake(itemW, viewHeight*heightMultiple); 74 | 75 | 76 | CGFloat scrollViewY = CGRectGetMaxY(self.dateCollectionView.frame); 77 | CGFloat scrollViewH = HEIGHT - scrollViewY-64 ; 78 | self.backScrollView.frame = CGRectMake(0, scrollViewY, WIDTH , scrollViewH); 79 | self.selectCollectionView.frame = CGRectMake(0, 0, collectionViewW, scrollViewH); 80 | 81 | } 82 | ### 创建小cell 83 | // 添加日期选项 84 | - (void)addSelectCollectionView { 85 | // 创建selectCollectionView 86 | self.selectCollectionView = [[QTSelectCollectionView alloc]init]; 87 | // 指定代理 88 | self.selectCollectionView.SelectColDelegate = self; 89 | // 取消显示水平滚动指示器 90 | self.selectCollectionView.showsHorizontalScrollIndicator = NO; 91 | // 1. 添加子控件 92 | [self.backScrollView addSubview:self.selectCollectionView]; 93 | // 2. 设置frame 94 | CGFloat selectColX = CGRectGetMaxX(self.roomView.frame); 95 | CGFloat selectColY = self.roomView.frame.origin.y; 96 | CGFloat selectColW = self.roomView.height; 97 | self.selectCollectionView.frame = CGRectMake(selectColX, selectColY, collectionViewW, selectColW); 98 | 99 | self.selectCollectionView.itemSize = CGSizeMake(itemW, viewHeight); 100 | // 添加到数组中 101 | [self.selectCollectionViewArr addObject:self.selectCollectionView]; 102 | } 103 | 104 | ## 监听事件 105 | #pragma mark - ZLTDateCollectionViewDelegate方法 106 | /// 根据dateCollectionView的滚动,使选项selectCollectionVie同步滚动 107 | - (void)dateCollectionView:(QTDateCollectionView *)collectionView DidScrollWithContentOffset:(CGPoint)contentOffset 108 | { 109 | self.currentContentOffset = contentOffset; 110 | // 调用监听collectionView滚动的方法 111 | [self collectionViewDidScrollWithContentOffset:contentOffset]; 112 | // 便利数组 113 | for (QTSelectCollectionView *selectCollectionView in self.selectCollectionViewArr) { 114 | selectCollectionView.contentOffset = contentOffset; 115 | } 116 | } 117 | 118 | 119 | #pragma mark - ZLTSelectCollectionViewDelegate方法 120 | /// 根据selectCollectionVie的滚动,使显示日期的dateCollectionView同步滚动 121 | - (void)selectCollectionView:(QTSelectCollectionView *)collectionView DidScrollWithContentOffset:(CGPoint)contentOffset 122 | { 123 | self.dateCollectionView.contentOffset = contentOffset; 124 | // 调用监听collectionView滚动的方法 125 | [self collectionViewDidScrollWithContentOffset:contentOffset]; 126 | } 127 | ### 时间处理 128 | /// 获取分割后的当前日期,形式"yyyy","MM","dd" WithIndex:(NSUInteger)index 129 | - (NSArray *)getDate{ 130 | 131 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:60*60*24*self.index]; 132 | // NSLog(@"--index:%zd",self.index); 133 | NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; 134 | formatter.dateFormat = @"yyyy-MM-dd"; 135 | // formatter.dateFormat = [date getDayOfWeekShortString]; 136 | NSString *dateStr = [formatter stringFromDate:date]; 137 | // NSLog(@"%@",dateStr); 138 | return [dateStr componentsSeparatedByString:@"-"]; 139 | } 140 | #### /// 获取当前周几 141 | - (NSString *)getWeekday 142 | { 143 | NSDateComponents *_comps = [[NSDateComponents alloc] init]; 144 | [_comps setDay:[[self getDay] integerValue]]; 145 | NSString *monthStr = [self getDate][1]; 146 | [_comps setMonth:[monthStr integerValue]]; 147 | [_comps setYear:[[self getYear] integerValue]]; 148 | 149 | NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; 150 | NSDate *_date = [gregorian dateFromComponents:_comps]; 151 | NSDateComponents *weekdayComponents = [gregorian components:NSCalendarUnitWeekday fromDate:_date]; 152 | NSInteger _weekday = [weekdayComponents weekday]-1; // 此处结果多了一天,减1,得到当前是周几} 153 | 154 | // 转为字符串 155 | NSString *weekdayStr = nil; 156 | // NSLog(@"_weekday:%zd",_weekday); 157 | switch (_weekday) { 158 | case 1: 159 | weekdayStr = @"周一"; 160 | break; 161 | case 2: 162 | weekdayStr = @"周二"; 163 | break; 164 | case 3: 165 | weekdayStr = @"周三"; 166 | break; 167 | case 4: 168 | weekdayStr = @"周四"; 169 | break; 170 | case 5: 171 | weekdayStr = @"周五"; 172 | break; 173 | case 6: 174 | weekdayStr = @"周六"; 175 | break; 176 | case 0: 177 | weekdayStr = @"周日"; 178 | break; 179 | } 180 | // NSLog(@"_weekday::%@",weekdayStr); 181 | return weekdayStr; 182 | } 183 | ## 如以上有不合适的地方,欢迎大神指点.. 184 | -------------------------------------------------------------------------------- /RoomManage.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 57C58B3F1D66F0ED00EC62DC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58B3E1D66F0ED00EC62DC /* main.m */; }; 11 | 57C58B421D66F0ED00EC62DC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58B411D66F0ED00EC62DC /* AppDelegate.m */; }; 12 | 57C58B451D66F0ED00EC62DC /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58B441D66F0ED00EC62DC /* ViewController.m */; }; 13 | 57C58B481D66F0ED00EC62DC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C58B461D66F0ED00EC62DC /* Main.storyboard */; }; 14 | 57C58B4A1D66F0ED00EC62DC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 57C58B491D66F0ED00EC62DC /* Assets.xcassets */; }; 15 | 57C58B4D1D66F0ED00EC62DC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C58B4B1D66F0ED00EC62DC /* LaunchScreen.storyboard */; }; 16 | 57C58B581D66F0ED00EC62DC /* RoomManageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58B571D66F0ED00EC62DC /* RoomManageTests.m */; }; 17 | 57C58B631D66F0ED00EC62DC /* RoomManageUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58B621D66F0ED00EC62DC /* RoomManageUITests.m */; }; 18 | 57C58BC81D66F1F700EC62DC /* QTManageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58BB31D66F1F700EC62DC /* QTManageViewController.m */; }; 19 | 57C58BC91D66F1F700EC62DC /* QTDate.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58BB61D66F1F700EC62DC /* QTDate.m */; }; 20 | 57C58BCA1D66F1F700EC62DC /* QTRoom.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58BB81D66F1F700EC62DC /* QTRoom.m */; }; 21 | 57C58BCB1D66F1F700EC62DC /* RoomList.plist in Resources */ = {isa = PBXBuildFile; fileRef = 57C58BB91D66F1F700EC62DC /* RoomList.plist */; }; 22 | 57C58BCC1D66F1F700EC62DC /* QTDateTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58BBC1D66F1F700EC62DC /* QTDateTool.m */; }; 23 | 57C58BCD1D66F1F700EC62DC /* UILabel+QTCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58BBE1D66F1F700EC62DC /* UILabel+QTCategory.m */; }; 24 | 57C58BCE1D66F1F700EC62DC /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58BC01D66F1F700EC62DC /* UIView+Extension.m */; }; 25 | 57C58BCF1D66F1F700EC62DC /* LeftRoomNumberTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58BC31D66F1F700EC62DC /* LeftRoomNumberTableView.m */; }; 26 | 57C58BD01D66F1F700EC62DC /* QTDateCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58BC51D66F1F700EC62DC /* QTDateCollectionView.m */; }; 27 | 57C58BD11D66F1F700EC62DC /* QTSelectCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C58BC71D66F1F700EC62DC /* QTSelectCollectionView.m */; }; 28 | 57C58BD51D66F41C00EC62DC /* Simulator Screen Shot 2016年8月19日 14.21.57.png in Resources */ = {isa = PBXBuildFile; fileRef = 57C58BD31D66F41C00EC62DC /* Simulator Screen Shot 2016年8月19日 14.21.57.png */; }; 29 | 57C58BD61D66F41C00EC62DC /* Untitled.gif in Resources */ = {isa = PBXBuildFile; fileRef = 57C58BD41D66F41C00EC62DC /* Untitled.gif */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | 57C58B541D66F0ED00EC62DC /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = 57C58B321D66F0ED00EC62DC /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = 57C58B391D66F0ED00EC62DC; 38 | remoteInfo = RoomManage; 39 | }; 40 | 57C58B5F1D66F0ED00EC62DC /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = 57C58B321D66F0ED00EC62DC /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = 57C58B391D66F0ED00EC62DC; 45 | remoteInfo = RoomManage; 46 | }; 47 | /* End PBXContainerItemProxy section */ 48 | 49 | /* Begin PBXFileReference section */ 50 | 57C58B3A1D66F0ED00EC62DC /* RoomManage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RoomManage.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 57C58B3E1D66F0ED00EC62DC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 57C58B401D66F0ED00EC62DC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 53 | 57C58B411D66F0ED00EC62DC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 54 | 57C58B431D66F0ED00EC62DC /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 55 | 57C58B441D66F0ED00EC62DC /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 56 | 57C58B471D66F0ED00EC62DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 57 | 57C58B491D66F0ED00EC62DC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 58 | 57C58B4C1D66F0ED00EC62DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 59 | 57C58B4E1D66F0ED00EC62DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | 57C58B531D66F0ED00EC62DC /* RoomManageTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RoomManageTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | 57C58B571D66F0ED00EC62DC /* RoomManageTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomManageTests.m; sourceTree = ""; }; 62 | 57C58B591D66F0ED00EC62DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 63 | 57C58B5E1D66F0ED00EC62DC /* RoomManageUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RoomManageUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 57C58B621D66F0ED00EC62DC /* RoomManageUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomManageUITests.m; sourceTree = ""; }; 65 | 57C58B641D66F0ED00EC62DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 66 | 57C58BAF1D66F1B100EC62DC /* PrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 67 | 57C58BB21D66F1F700EC62DC /* QTManageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QTManageViewController.h; sourceTree = ""; }; 68 | 57C58BB31D66F1F700EC62DC /* QTManageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QTManageViewController.m; sourceTree = ""; }; 69 | 57C58BB51D66F1F700EC62DC /* QTDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QTDate.h; sourceTree = ""; }; 70 | 57C58BB61D66F1F700EC62DC /* QTDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QTDate.m; sourceTree = ""; }; 71 | 57C58BB71D66F1F700EC62DC /* QTRoom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QTRoom.h; sourceTree = ""; }; 72 | 57C58BB81D66F1F700EC62DC /* QTRoom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QTRoom.m; sourceTree = ""; }; 73 | 57C58BB91D66F1F700EC62DC /* RoomList.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = RoomList.plist; sourceTree = ""; }; 74 | 57C58BBB1D66F1F700EC62DC /* QTDateTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QTDateTool.h; sourceTree = ""; }; 75 | 57C58BBC1D66F1F700EC62DC /* QTDateTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QTDateTool.m; sourceTree = ""; }; 76 | 57C58BBD1D66F1F700EC62DC /* UILabel+QTCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+QTCategory.h"; sourceTree = ""; }; 77 | 57C58BBE1D66F1F700EC62DC /* UILabel+QTCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+QTCategory.m"; sourceTree = ""; }; 78 | 57C58BBF1D66F1F700EC62DC /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = ""; }; 79 | 57C58BC01D66F1F700EC62DC /* UIView+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Extension.m"; sourceTree = ""; }; 80 | 57C58BC21D66F1F700EC62DC /* LeftRoomNumberTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeftRoomNumberTableView.h; sourceTree = ""; }; 81 | 57C58BC31D66F1F700EC62DC /* LeftRoomNumberTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LeftRoomNumberTableView.m; sourceTree = ""; }; 82 | 57C58BC41D66F1F700EC62DC /* QTDateCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QTDateCollectionView.h; sourceTree = ""; }; 83 | 57C58BC51D66F1F700EC62DC /* QTDateCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QTDateCollectionView.m; sourceTree = ""; }; 84 | 57C58BC61D66F1F700EC62DC /* QTSelectCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QTSelectCollectionView.h; sourceTree = ""; }; 85 | 57C58BC71D66F1F700EC62DC /* QTSelectCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QTSelectCollectionView.m; sourceTree = ""; }; 86 | 57C58BD31D66F41C00EC62DC /* Simulator Screen Shot 2016年8月19日 14.21.57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Simulator Screen Shot 2016年8月19日 14.21.57.png"; sourceTree = ""; }; 87 | 57C58BD41D66F41C00EC62DC /* Untitled.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Untitled.gif; sourceTree = ""; }; 88 | /* End PBXFileReference section */ 89 | 90 | /* Begin PBXFrameworksBuildPhase section */ 91 | 57C58B371D66F0ED00EC62DC /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | ); 96 | runOnlyForDeploymentPostprocessing = 0; 97 | }; 98 | 57C58B501D66F0ED00EC62DC /* Frameworks */ = { 99 | isa = PBXFrameworksBuildPhase; 100 | buildActionMask = 2147483647; 101 | files = ( 102 | ); 103 | runOnlyForDeploymentPostprocessing = 0; 104 | }; 105 | 57C58B5B1D66F0ED00EC62DC /* Frameworks */ = { 106 | isa = PBXFrameworksBuildPhase; 107 | buildActionMask = 2147483647; 108 | files = ( 109 | ); 110 | runOnlyForDeploymentPostprocessing = 0; 111 | }; 112 | /* End PBXFrameworksBuildPhase section */ 113 | 114 | /* Begin PBXGroup section */ 115 | 57C58B311D66F0ED00EC62DC = { 116 | isa = PBXGroup; 117 | children = ( 118 | 57C58BD21D66F41C00EC62DC /* Screenshots */, 119 | 57C58B3C1D66F0ED00EC62DC /* RoomManage */, 120 | 57C58B561D66F0ED00EC62DC /* RoomManageTests */, 121 | 57C58B611D66F0ED00EC62DC /* RoomManageUITests */, 122 | 57C58B3B1D66F0ED00EC62DC /* Products */, 123 | ); 124 | sourceTree = ""; 125 | }; 126 | 57C58B3B1D66F0ED00EC62DC /* Products */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 57C58B3A1D66F0ED00EC62DC /* RoomManage.app */, 130 | 57C58B531D66F0ED00EC62DC /* RoomManageTests.xctest */, 131 | 57C58B5E1D66F0ED00EC62DC /* RoomManageUITests.xctest */, 132 | ); 133 | name = Products; 134 | sourceTree = ""; 135 | }; 136 | 57C58B3C1D66F0ED00EC62DC /* RoomManage */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 57C58B401D66F0ED00EC62DC /* AppDelegate.h */, 140 | 57C58B411D66F0ED00EC62DC /* AppDelegate.m */, 141 | 57C58B431D66F0ED00EC62DC /* ViewController.h */, 142 | 57C58B441D66F0ED00EC62DC /* ViewController.m */, 143 | 57C58BAF1D66F1B100EC62DC /* PrefixHeader.pch */, 144 | 57C58BB01D66F1F700EC62DC /* ManageRoom */, 145 | 57C58B461D66F0ED00EC62DC /* Main.storyboard */, 146 | 57C58B491D66F0ED00EC62DC /* Assets.xcassets */, 147 | 57C58B4B1D66F0ED00EC62DC /* LaunchScreen.storyboard */, 148 | 57C58B4E1D66F0ED00EC62DC /* Info.plist */, 149 | 57C58B3D1D66F0ED00EC62DC /* Supporting Files */, 150 | ); 151 | path = RoomManage; 152 | sourceTree = ""; 153 | }; 154 | 57C58B3D1D66F0ED00EC62DC /* Supporting Files */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 57C58B3E1D66F0ED00EC62DC /* main.m */, 158 | ); 159 | name = "Supporting Files"; 160 | sourceTree = ""; 161 | }; 162 | 57C58B561D66F0ED00EC62DC /* RoomManageTests */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 57C58B571D66F0ED00EC62DC /* RoomManageTests.m */, 166 | 57C58B591D66F0ED00EC62DC /* Info.plist */, 167 | ); 168 | path = RoomManageTests; 169 | sourceTree = ""; 170 | }; 171 | 57C58B611D66F0ED00EC62DC /* RoomManageUITests */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 57C58B621D66F0ED00EC62DC /* RoomManageUITests.m */, 175 | 57C58B641D66F0ED00EC62DC /* Info.plist */, 176 | ); 177 | path = RoomManageUITests; 178 | sourceTree = ""; 179 | }; 180 | 57C58BB01D66F1F700EC62DC /* ManageRoom */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | 57C58BB11D66F1F700EC62DC /* Controller */, 184 | 57C58BB41D66F1F700EC62DC /* Model */, 185 | 57C58BBA1D66F1F700EC62DC /* Tool */, 186 | 57C58BC11D66F1F700EC62DC /* View */, 187 | ); 188 | path = ManageRoom; 189 | sourceTree = ""; 190 | }; 191 | 57C58BB11D66F1F700EC62DC /* Controller */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | 57C58BB21D66F1F700EC62DC /* QTManageViewController.h */, 195 | 57C58BB31D66F1F700EC62DC /* QTManageViewController.m */, 196 | ); 197 | path = Controller; 198 | sourceTree = ""; 199 | }; 200 | 57C58BB41D66F1F700EC62DC /* Model */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | 57C58BB51D66F1F700EC62DC /* QTDate.h */, 204 | 57C58BB61D66F1F700EC62DC /* QTDate.m */, 205 | 57C58BB71D66F1F700EC62DC /* QTRoom.h */, 206 | 57C58BB81D66F1F700EC62DC /* QTRoom.m */, 207 | 57C58BB91D66F1F700EC62DC /* RoomList.plist */, 208 | ); 209 | path = Model; 210 | sourceTree = ""; 211 | }; 212 | 57C58BBA1D66F1F700EC62DC /* Tool */ = { 213 | isa = PBXGroup; 214 | children = ( 215 | 57C58BBB1D66F1F700EC62DC /* QTDateTool.h */, 216 | 57C58BBC1D66F1F700EC62DC /* QTDateTool.m */, 217 | 57C58BBD1D66F1F700EC62DC /* UILabel+QTCategory.h */, 218 | 57C58BBE1D66F1F700EC62DC /* UILabel+QTCategory.m */, 219 | 57C58BBF1D66F1F700EC62DC /* UIView+Extension.h */, 220 | 57C58BC01D66F1F700EC62DC /* UIView+Extension.m */, 221 | ); 222 | path = Tool; 223 | sourceTree = ""; 224 | }; 225 | 57C58BC11D66F1F700EC62DC /* View */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 57C58BC21D66F1F700EC62DC /* LeftRoomNumberTableView.h */, 229 | 57C58BC31D66F1F700EC62DC /* LeftRoomNumberTableView.m */, 230 | 57C58BC41D66F1F700EC62DC /* QTDateCollectionView.h */, 231 | 57C58BC51D66F1F700EC62DC /* QTDateCollectionView.m */, 232 | 57C58BC61D66F1F700EC62DC /* QTSelectCollectionView.h */, 233 | 57C58BC71D66F1F700EC62DC /* QTSelectCollectionView.m */, 234 | ); 235 | path = View; 236 | sourceTree = ""; 237 | }; 238 | 57C58BD21D66F41C00EC62DC /* Screenshots */ = { 239 | isa = PBXGroup; 240 | children = ( 241 | 57C58BD31D66F41C00EC62DC /* Simulator Screen Shot 2016年8月19日 14.21.57.png */, 242 | 57C58BD41D66F41C00EC62DC /* Untitled.gif */, 243 | ); 244 | name = Screenshots; 245 | path = RoomManage/Screenshots; 246 | sourceTree = ""; 247 | }; 248 | /* End PBXGroup section */ 249 | 250 | /* Begin PBXNativeTarget section */ 251 | 57C58B391D66F0ED00EC62DC /* RoomManage */ = { 252 | isa = PBXNativeTarget; 253 | buildConfigurationList = 57C58B671D66F0ED00EC62DC /* Build configuration list for PBXNativeTarget "RoomManage" */; 254 | buildPhases = ( 255 | 57C58B361D66F0ED00EC62DC /* Sources */, 256 | 57C58B371D66F0ED00EC62DC /* Frameworks */, 257 | 57C58B381D66F0ED00EC62DC /* Resources */, 258 | ); 259 | buildRules = ( 260 | ); 261 | dependencies = ( 262 | ); 263 | name = RoomManage; 264 | productName = RoomManage; 265 | productReference = 57C58B3A1D66F0ED00EC62DC /* RoomManage.app */; 266 | productType = "com.apple.product-type.application"; 267 | }; 268 | 57C58B521D66F0ED00EC62DC /* RoomManageTests */ = { 269 | isa = PBXNativeTarget; 270 | buildConfigurationList = 57C58B6A1D66F0ED00EC62DC /* Build configuration list for PBXNativeTarget "RoomManageTests" */; 271 | buildPhases = ( 272 | 57C58B4F1D66F0ED00EC62DC /* Sources */, 273 | 57C58B501D66F0ED00EC62DC /* Frameworks */, 274 | 57C58B511D66F0ED00EC62DC /* Resources */, 275 | ); 276 | buildRules = ( 277 | ); 278 | dependencies = ( 279 | 57C58B551D66F0ED00EC62DC /* PBXTargetDependency */, 280 | ); 281 | name = RoomManageTests; 282 | productName = RoomManageTests; 283 | productReference = 57C58B531D66F0ED00EC62DC /* RoomManageTests.xctest */; 284 | productType = "com.apple.product-type.bundle.unit-test"; 285 | }; 286 | 57C58B5D1D66F0ED00EC62DC /* RoomManageUITests */ = { 287 | isa = PBXNativeTarget; 288 | buildConfigurationList = 57C58B6D1D66F0ED00EC62DC /* Build configuration list for PBXNativeTarget "RoomManageUITests" */; 289 | buildPhases = ( 290 | 57C58B5A1D66F0ED00EC62DC /* Sources */, 291 | 57C58B5B1D66F0ED00EC62DC /* Frameworks */, 292 | 57C58B5C1D66F0ED00EC62DC /* Resources */, 293 | ); 294 | buildRules = ( 295 | ); 296 | dependencies = ( 297 | 57C58B601D66F0ED00EC62DC /* PBXTargetDependency */, 298 | ); 299 | name = RoomManageUITests; 300 | productName = RoomManageUITests; 301 | productReference = 57C58B5E1D66F0ED00EC62DC /* RoomManageUITests.xctest */; 302 | productType = "com.apple.product-type.bundle.ui-testing"; 303 | }; 304 | /* End PBXNativeTarget section */ 305 | 306 | /* Begin PBXProject section */ 307 | 57C58B321D66F0ED00EC62DC /* Project object */ = { 308 | isa = PBXProject; 309 | attributes = { 310 | LastUpgradeCheck = 0730; 311 | ORGANIZATIONNAME = ZQT; 312 | TargetAttributes = { 313 | 57C58B391D66F0ED00EC62DC = { 314 | CreatedOnToolsVersion = 7.3.1; 315 | }; 316 | 57C58B521D66F0ED00EC62DC = { 317 | CreatedOnToolsVersion = 7.3.1; 318 | TestTargetID = 57C58B391D66F0ED00EC62DC; 319 | }; 320 | 57C58B5D1D66F0ED00EC62DC = { 321 | CreatedOnToolsVersion = 7.3.1; 322 | TestTargetID = 57C58B391D66F0ED00EC62DC; 323 | }; 324 | }; 325 | }; 326 | buildConfigurationList = 57C58B351D66F0ED00EC62DC /* Build configuration list for PBXProject "RoomManage" */; 327 | compatibilityVersion = "Xcode 3.2"; 328 | developmentRegion = English; 329 | hasScannedForEncodings = 0; 330 | knownRegions = ( 331 | en, 332 | Base, 333 | ); 334 | mainGroup = 57C58B311D66F0ED00EC62DC; 335 | productRefGroup = 57C58B3B1D66F0ED00EC62DC /* Products */; 336 | projectDirPath = ""; 337 | projectRoot = ""; 338 | targets = ( 339 | 57C58B391D66F0ED00EC62DC /* RoomManage */, 340 | 57C58B521D66F0ED00EC62DC /* RoomManageTests */, 341 | 57C58B5D1D66F0ED00EC62DC /* RoomManageUITests */, 342 | ); 343 | }; 344 | /* End PBXProject section */ 345 | 346 | /* Begin PBXResourcesBuildPhase section */ 347 | 57C58B381D66F0ED00EC62DC /* Resources */ = { 348 | isa = PBXResourcesBuildPhase; 349 | buildActionMask = 2147483647; 350 | files = ( 351 | 57C58B4D1D66F0ED00EC62DC /* LaunchScreen.storyboard in Resources */, 352 | 57C58BD61D66F41C00EC62DC /* Untitled.gif in Resources */, 353 | 57C58BCB1D66F1F700EC62DC /* RoomList.plist in Resources */, 354 | 57C58BD51D66F41C00EC62DC /* Simulator Screen Shot 2016年8月19日 14.21.57.png in Resources */, 355 | 57C58B4A1D66F0ED00EC62DC /* Assets.xcassets in Resources */, 356 | 57C58B481D66F0ED00EC62DC /* Main.storyboard in Resources */, 357 | ); 358 | runOnlyForDeploymentPostprocessing = 0; 359 | }; 360 | 57C58B511D66F0ED00EC62DC /* Resources */ = { 361 | isa = PBXResourcesBuildPhase; 362 | buildActionMask = 2147483647; 363 | files = ( 364 | ); 365 | runOnlyForDeploymentPostprocessing = 0; 366 | }; 367 | 57C58B5C1D66F0ED00EC62DC /* Resources */ = { 368 | isa = PBXResourcesBuildPhase; 369 | buildActionMask = 2147483647; 370 | files = ( 371 | ); 372 | runOnlyForDeploymentPostprocessing = 0; 373 | }; 374 | /* End PBXResourcesBuildPhase section */ 375 | 376 | /* Begin PBXSourcesBuildPhase section */ 377 | 57C58B361D66F0ED00EC62DC /* Sources */ = { 378 | isa = PBXSourcesBuildPhase; 379 | buildActionMask = 2147483647; 380 | files = ( 381 | 57C58BCE1D66F1F700EC62DC /* UIView+Extension.m in Sources */, 382 | 57C58BC91D66F1F700EC62DC /* QTDate.m in Sources */, 383 | 57C58BCF1D66F1F700EC62DC /* LeftRoomNumberTableView.m in Sources */, 384 | 57C58BCA1D66F1F700EC62DC /* QTRoom.m in Sources */, 385 | 57C58BC81D66F1F700EC62DC /* QTManageViewController.m in Sources */, 386 | 57C58BCD1D66F1F700EC62DC /* UILabel+QTCategory.m in Sources */, 387 | 57C58BCC1D66F1F700EC62DC /* QTDateTool.m in Sources */, 388 | 57C58B451D66F0ED00EC62DC /* ViewController.m in Sources */, 389 | 57C58B421D66F0ED00EC62DC /* AppDelegate.m in Sources */, 390 | 57C58BD01D66F1F700EC62DC /* QTDateCollectionView.m in Sources */, 391 | 57C58B3F1D66F0ED00EC62DC /* main.m in Sources */, 392 | 57C58BD11D66F1F700EC62DC /* QTSelectCollectionView.m in Sources */, 393 | ); 394 | runOnlyForDeploymentPostprocessing = 0; 395 | }; 396 | 57C58B4F1D66F0ED00EC62DC /* Sources */ = { 397 | isa = PBXSourcesBuildPhase; 398 | buildActionMask = 2147483647; 399 | files = ( 400 | 57C58B581D66F0ED00EC62DC /* RoomManageTests.m in Sources */, 401 | ); 402 | runOnlyForDeploymentPostprocessing = 0; 403 | }; 404 | 57C58B5A1D66F0ED00EC62DC /* Sources */ = { 405 | isa = PBXSourcesBuildPhase; 406 | buildActionMask = 2147483647; 407 | files = ( 408 | 57C58B631D66F0ED00EC62DC /* RoomManageUITests.m in Sources */, 409 | ); 410 | runOnlyForDeploymentPostprocessing = 0; 411 | }; 412 | /* End PBXSourcesBuildPhase section */ 413 | 414 | /* Begin PBXTargetDependency section */ 415 | 57C58B551D66F0ED00EC62DC /* PBXTargetDependency */ = { 416 | isa = PBXTargetDependency; 417 | target = 57C58B391D66F0ED00EC62DC /* RoomManage */; 418 | targetProxy = 57C58B541D66F0ED00EC62DC /* PBXContainerItemProxy */; 419 | }; 420 | 57C58B601D66F0ED00EC62DC /* PBXTargetDependency */ = { 421 | isa = PBXTargetDependency; 422 | target = 57C58B391D66F0ED00EC62DC /* RoomManage */; 423 | targetProxy = 57C58B5F1D66F0ED00EC62DC /* PBXContainerItemProxy */; 424 | }; 425 | /* End PBXTargetDependency section */ 426 | 427 | /* Begin PBXVariantGroup section */ 428 | 57C58B461D66F0ED00EC62DC /* Main.storyboard */ = { 429 | isa = PBXVariantGroup; 430 | children = ( 431 | 57C58B471D66F0ED00EC62DC /* Base */, 432 | ); 433 | name = Main.storyboard; 434 | sourceTree = ""; 435 | }; 436 | 57C58B4B1D66F0ED00EC62DC /* LaunchScreen.storyboard */ = { 437 | isa = PBXVariantGroup; 438 | children = ( 439 | 57C58B4C1D66F0ED00EC62DC /* Base */, 440 | ); 441 | name = LaunchScreen.storyboard; 442 | sourceTree = ""; 443 | }; 444 | /* End PBXVariantGroup section */ 445 | 446 | /* Begin XCBuildConfiguration section */ 447 | 57C58B651D66F0ED00EC62DC /* Debug */ = { 448 | isa = XCBuildConfiguration; 449 | buildSettings = { 450 | ALWAYS_SEARCH_USER_PATHS = NO; 451 | CLANG_ANALYZER_NONNULL = YES; 452 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 453 | CLANG_CXX_LIBRARY = "libc++"; 454 | CLANG_ENABLE_MODULES = YES; 455 | CLANG_ENABLE_OBJC_ARC = YES; 456 | CLANG_WARN_BOOL_CONVERSION = YES; 457 | CLANG_WARN_CONSTANT_CONVERSION = YES; 458 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 459 | CLANG_WARN_EMPTY_BODY = YES; 460 | CLANG_WARN_ENUM_CONVERSION = YES; 461 | CLANG_WARN_INT_CONVERSION = YES; 462 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 463 | CLANG_WARN_UNREACHABLE_CODE = YES; 464 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 465 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 466 | COPY_PHASE_STRIP = NO; 467 | DEBUG_INFORMATION_FORMAT = dwarf; 468 | ENABLE_STRICT_OBJC_MSGSEND = YES; 469 | ENABLE_TESTABILITY = YES; 470 | GCC_C_LANGUAGE_STANDARD = gnu99; 471 | GCC_DYNAMIC_NO_PIC = NO; 472 | GCC_NO_COMMON_BLOCKS = YES; 473 | GCC_OPTIMIZATION_LEVEL = 0; 474 | GCC_PREPROCESSOR_DEFINITIONS = ( 475 | "DEBUG=1", 476 | "$(inherited)", 477 | ); 478 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 479 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 480 | GCC_WARN_UNDECLARED_SELECTOR = YES; 481 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 482 | GCC_WARN_UNUSED_FUNCTION = YES; 483 | GCC_WARN_UNUSED_VARIABLE = YES; 484 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 485 | MTL_ENABLE_DEBUG_INFO = YES; 486 | ONLY_ACTIVE_ARCH = YES; 487 | SDKROOT = iphoneos; 488 | TARGETED_DEVICE_FAMILY = "1,2"; 489 | }; 490 | name = Debug; 491 | }; 492 | 57C58B661D66F0ED00EC62DC /* Release */ = { 493 | isa = XCBuildConfiguration; 494 | buildSettings = { 495 | ALWAYS_SEARCH_USER_PATHS = NO; 496 | CLANG_ANALYZER_NONNULL = YES; 497 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 498 | CLANG_CXX_LIBRARY = "libc++"; 499 | CLANG_ENABLE_MODULES = YES; 500 | CLANG_ENABLE_OBJC_ARC = YES; 501 | CLANG_WARN_BOOL_CONVERSION = YES; 502 | CLANG_WARN_CONSTANT_CONVERSION = YES; 503 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 504 | CLANG_WARN_EMPTY_BODY = YES; 505 | CLANG_WARN_ENUM_CONVERSION = YES; 506 | CLANG_WARN_INT_CONVERSION = YES; 507 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 508 | CLANG_WARN_UNREACHABLE_CODE = YES; 509 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 510 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 511 | COPY_PHASE_STRIP = NO; 512 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 513 | ENABLE_NS_ASSERTIONS = NO; 514 | ENABLE_STRICT_OBJC_MSGSEND = YES; 515 | GCC_C_LANGUAGE_STANDARD = gnu99; 516 | GCC_NO_COMMON_BLOCKS = YES; 517 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 518 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 519 | GCC_WARN_UNDECLARED_SELECTOR = YES; 520 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 521 | GCC_WARN_UNUSED_FUNCTION = YES; 522 | GCC_WARN_UNUSED_VARIABLE = YES; 523 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 524 | MTL_ENABLE_DEBUG_INFO = NO; 525 | SDKROOT = iphoneos; 526 | TARGETED_DEVICE_FAMILY = "1,2"; 527 | VALIDATE_PRODUCT = YES; 528 | }; 529 | name = Release; 530 | }; 531 | 57C58B681D66F0ED00EC62DC /* Debug */ = { 532 | isa = XCBuildConfiguration; 533 | buildSettings = { 534 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 535 | GCC_PREFIX_HEADER = "$(SRCROOT)/RoomManage/PrefixHeader.pch"; 536 | INFOPLIST_FILE = RoomManage/Info.plist; 537 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 538 | PRODUCT_BUNDLE_IDENTIFIER = ZQT.RoomManage; 539 | PRODUCT_NAME = "$(TARGET_NAME)"; 540 | }; 541 | name = Debug; 542 | }; 543 | 57C58B691D66F0ED00EC62DC /* Release */ = { 544 | isa = XCBuildConfiguration; 545 | buildSettings = { 546 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 547 | GCC_PREFIX_HEADER = "$(SRCROOT)/RoomManage/PrefixHeader.pch"; 548 | INFOPLIST_FILE = RoomManage/Info.plist; 549 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 550 | PRODUCT_BUNDLE_IDENTIFIER = ZQT.RoomManage; 551 | PRODUCT_NAME = "$(TARGET_NAME)"; 552 | }; 553 | name = Release; 554 | }; 555 | 57C58B6B1D66F0ED00EC62DC /* Debug */ = { 556 | isa = XCBuildConfiguration; 557 | buildSettings = { 558 | BUNDLE_LOADER = "$(TEST_HOST)"; 559 | INFOPLIST_FILE = RoomManageTests/Info.plist; 560 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 561 | PRODUCT_BUNDLE_IDENTIFIER = ZQT.RoomManageTests; 562 | PRODUCT_NAME = "$(TARGET_NAME)"; 563 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RoomManage.app/RoomManage"; 564 | }; 565 | name = Debug; 566 | }; 567 | 57C58B6C1D66F0ED00EC62DC /* Release */ = { 568 | isa = XCBuildConfiguration; 569 | buildSettings = { 570 | BUNDLE_LOADER = "$(TEST_HOST)"; 571 | INFOPLIST_FILE = RoomManageTests/Info.plist; 572 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 573 | PRODUCT_BUNDLE_IDENTIFIER = ZQT.RoomManageTests; 574 | PRODUCT_NAME = "$(TARGET_NAME)"; 575 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RoomManage.app/RoomManage"; 576 | }; 577 | name = Release; 578 | }; 579 | 57C58B6E1D66F0ED00EC62DC /* Debug */ = { 580 | isa = XCBuildConfiguration; 581 | buildSettings = { 582 | INFOPLIST_FILE = RoomManageUITests/Info.plist; 583 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 584 | PRODUCT_BUNDLE_IDENTIFIER = ZQT.RoomManageUITests; 585 | PRODUCT_NAME = "$(TARGET_NAME)"; 586 | TEST_TARGET_NAME = RoomManage; 587 | }; 588 | name = Debug; 589 | }; 590 | 57C58B6F1D66F0ED00EC62DC /* Release */ = { 591 | isa = XCBuildConfiguration; 592 | buildSettings = { 593 | INFOPLIST_FILE = RoomManageUITests/Info.plist; 594 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 595 | PRODUCT_BUNDLE_IDENTIFIER = ZQT.RoomManageUITests; 596 | PRODUCT_NAME = "$(TARGET_NAME)"; 597 | TEST_TARGET_NAME = RoomManage; 598 | }; 599 | name = Release; 600 | }; 601 | /* End XCBuildConfiguration section */ 602 | 603 | /* Begin XCConfigurationList section */ 604 | 57C58B351D66F0ED00EC62DC /* Build configuration list for PBXProject "RoomManage" */ = { 605 | isa = XCConfigurationList; 606 | buildConfigurations = ( 607 | 57C58B651D66F0ED00EC62DC /* Debug */, 608 | 57C58B661D66F0ED00EC62DC /* Release */, 609 | ); 610 | defaultConfigurationIsVisible = 0; 611 | defaultConfigurationName = Release; 612 | }; 613 | 57C58B671D66F0ED00EC62DC /* Build configuration list for PBXNativeTarget "RoomManage" */ = { 614 | isa = XCConfigurationList; 615 | buildConfigurations = ( 616 | 57C58B681D66F0ED00EC62DC /* Debug */, 617 | 57C58B691D66F0ED00EC62DC /* Release */, 618 | ); 619 | defaultConfigurationIsVisible = 0; 620 | defaultConfigurationName = Release; 621 | }; 622 | 57C58B6A1D66F0ED00EC62DC /* Build configuration list for PBXNativeTarget "RoomManageTests" */ = { 623 | isa = XCConfigurationList; 624 | buildConfigurations = ( 625 | 57C58B6B1D66F0ED00EC62DC /* Debug */, 626 | 57C58B6C1D66F0ED00EC62DC /* Release */, 627 | ); 628 | defaultConfigurationIsVisible = 0; 629 | defaultConfigurationName = Release; 630 | }; 631 | 57C58B6D1D66F0ED00EC62DC /* Build configuration list for PBXNativeTarget "RoomManageUITests" */ = { 632 | isa = XCConfigurationList; 633 | buildConfigurations = ( 634 | 57C58B6E1D66F0ED00EC62DC /* Debug */, 635 | 57C58B6F1D66F0ED00EC62DC /* Release */, 636 | ); 637 | defaultConfigurationIsVisible = 0; 638 | defaultConfigurationName = Release; 639 | }; 640 | /* End XCConfigurationList section */ 641 | }; 642 | rootObject = 57C58B321D66F0ED00EC62DC /* Project object */; 643 | } 644 | -------------------------------------------------------------------------------- /RoomManage.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RoomManage.xcodeproj/xcuserdata/ZQT.xcuserdatad/xcschemes/RoomManage.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /RoomManage.xcodeproj/xcuserdata/ZQT.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RoomManage.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 57C58B391D66F0ED00EC62DC 16 | 17 | primary 18 | 19 | 20 | 57C58B521D66F0ED00EC62DC 21 | 22 | primary 23 | 24 | 25 | 57C58B5D1D66F0ED00EC62DC 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /RoomManage/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. 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 | -------------------------------------------------------------------------------- /RoomManage/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. 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 | -------------------------------------------------------------------------------- /RoomManage/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /RoomManage/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 | -------------------------------------------------------------------------------- /RoomManage/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /RoomManage/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 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Controller/QTManageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // QTManageViewController.h 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QTManageViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Controller/QTManageViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // QTManageViewController.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import "QTManageViewController.h" 10 | #import "QTDateCollectionView.h" 11 | #import "QTDateTool.h" 12 | #import "QTSelectCollectionView.h" 13 | #import "LeftRoomNumberTableView.h" 14 | #import "QTRoom.h" 15 | @interface QTManageViewController () 16 | 17 | @property (nonatomic,strong) UILabel *roomNoView; 18 | /// 显示月份的视图 19 | @property (nonatomic,strong) UILabel *totalNoView; 20 | /// 显示房间号 21 | @property (nonatomic,strong) UILabel *roomView; 22 | /// 暂存上一个创建的roomView 23 | @property (nonatomic,weak) UILabel *tempRoomView; 24 | //底部 25 | @property (nonatomic, strong)UIScrollView *backScrollView; 26 | 27 | @property (nonatomic, strong)QTDateCollectionView *dateCollectionView; 28 | /// 暂存当前月号 29 | @property (nonatomic,assign) NSInteger tempDay; 30 | /// 暂存当前月份 31 | @property (nonatomic,weak) NSString *tempMonth; 32 | 33 | /// 日期工具类 34 | @property (nonatomic,strong) QTDateTool *dateTool; 35 | 36 | /// 存储所有的SelectCollectionView 37 | @property (nonatomic,strong) NSMutableArray *selectCollectionViewArr; 38 | /// 显示在日期列表下的选项 39 | @property (nonatomic,strong) QTSelectCollectionView *selectCollectionView; 40 | 41 | /// 暂存当前被拖拽的日期选项 42 | @property (nonatomic,weak) QTSelectCollectionView *currentSelectCollectionView; 43 | 44 | /// 房间模型集合 45 | @property (nonatomic,strong) NSArray *rooms; 46 | 47 | /// 当前collectionView的偏移量 48 | @property (nonatomic,assign) CGPoint currentContentOffset; 49 | @end 50 | // 列数 51 | int columns = 7; 52 | /// 是否是第一次添加房间 53 | BOOL isFirstAddRoomView = YES; 54 | // 控制器中显示view的宽、高 55 | CGFloat viewWidth = 0; 56 | CGFloat viewHeight = 0; 57 | /// cell的宽 58 | CGFloat itemW = 0; 59 | /// collectionView的宽度 60 | CGFloat collectionViewW = 0; 61 | /// 日期栏高度曾大的倍数 62 | CGFloat heightMultiple = 1.2; 63 | /// 暂存当前日期 64 | NSString *currentDay = nil; 65 | @implementation QTManageViewController 66 | 67 | - (void)viewDidLoad { 68 | [super viewDidLoad]; 69 | 70 | //1.设置导航条 71 | [self setNav]; 72 | 73 | // 2. 计算Cell的大小 74 | [self calculateCellSize]; 75 | 76 | [self prepareUI]; 77 | 78 | 79 | [self loadRoomList]; 80 | 81 | } 82 | 83 | #pragma mark 导航条 84 | - (void)setNav { 85 | 86 | self.view.backgroundColor = [UIColor whiteColor]; 87 | self.edgesForExtendedLayout = UIRectEdgeNone; 88 | self.extendedLayoutIncludesOpaqueBars = NO; 89 | self.modalPresentationCapturesStatusBarAppearance = NO; 90 | self.dateTool = [QTDateTool sharedInstance]; 91 | self.dateTool.index = 0; 92 | currentDay = [self.dateTool getDay]; 93 | self.navigationItem.title = [NSString stringWithFormat:@"%@年%@月",[self.dateTool getYear],[self.dateTool getMonth]]; 94 | 95 | 96 | UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 97 | [rightBtn setTitle:@"房间管理" forState:UIControlStateNormal]; 98 | rightBtn.titleLabel.font = [UIFont systemFontOfSize:14]; 99 | [rightBtn addTarget:self action:@selector(rightBarButtonItemAction) forControlEvents:UIControlEventTouchUpInside]; 100 | [rightBtn sizeToFit]; 101 | [rightBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 102 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:rightBtn]; 103 | 104 | } 105 | 106 | // 计算cell的大小 107 | - (void)calculateCellSize 108 | { 109 | viewWidth = (WIDTH - columns + 2)/columns; 110 | viewHeight = viewWidth; 111 | collectionViewW = WIDTH - viewWidth * 2; 112 | } 113 | 114 | #pragma mark 准备UI 115 | - (void)prepareUI { 116 | //1,添加子控件 117 | [self.view addSubview:self.roomNoView]; 118 | [self.view addSubview:self.totalNoView]; 119 | [self.view addSubview:self.dateCollectionView]; 120 | [self.view addSubview:self.backScrollView]; 121 | 122 | // 2.设置frame 123 | // 设置roomNoView、totalNoView 124 | CGFloat viewY = 0; 125 | self.roomNoView.frame = CGRectMake(0, viewY, viewWidth*2, viewHeight*heightMultiple*0.5); 126 | self.totalNoView.frame = CGRectMake(0, viewY + viewHeight * heightMultiple * 0.5, viewWidth*2, viewHeight*heightMultiple*0.5); 127 | // 设置collectionViewW 128 | self.dateCollectionView.frame = CGRectMake(viewWidth * 2, 0, collectionViewW, viewHeight*heightMultiple); 129 | itemW = (collectionViewW - 4)*0.2; 130 | self.dateCollectionView.itemSize = CGSizeMake(itemW, viewHeight*heightMultiple); 131 | 132 | 133 | CGFloat scrollViewY = CGRectGetMaxY(self.dateCollectionView.frame); 134 | CGFloat scrollViewH = HEIGHT - scrollViewY-64 ; 135 | self.backScrollView.frame = CGRectMake(0, scrollViewY, WIDTH , scrollViewH); 136 | self.selectCollectionView.frame = CGRectMake(0, 0, collectionViewW, scrollViewH); 137 | 138 | } 139 | 140 | 141 | 142 | // 添加日期选项 143 | - (void)addSelectCollectionView { 144 | // 创建selectCollectionView 145 | self.selectCollectionView = [[QTSelectCollectionView alloc]init]; 146 | // 指定代理 147 | self.selectCollectionView.SelectColDelegate = self; 148 | // 取消显示水平滚动指示器 149 | self.selectCollectionView.showsHorizontalScrollIndicator = NO; 150 | // 1. 添加子控件 151 | [self.backScrollView addSubview:self.selectCollectionView]; 152 | // 2. 设置frame 153 | CGFloat selectColX = CGRectGetMaxX(self.roomView.frame); 154 | CGFloat selectColY = self.roomView.frame.origin.y; 155 | CGFloat selectColW = self.roomView.height; 156 | self.selectCollectionView.frame = CGRectMake(selectColX, selectColY, collectionViewW, selectColW); 157 | 158 | self.selectCollectionView.itemSize = CGSizeMake(itemW, viewHeight); 159 | // 添加到数组中 160 | [self.selectCollectionViewArr addObject:self.selectCollectionView]; 161 | } 162 | 163 | #pragma mark 房间管理 164 | - (void)rightBarButtonItemAction 165 | { 166 | NSLog(@"房间管理,此处自己实现吧"); 167 | } 168 | 169 | #pragma mark - 添加房间和日期选项表格 170 | - (void)addRoomandSelectCellActionWithRooms:(NSArray *)rooms { 171 | for (QTRoom *room in rooms) { 172 | // 1. 添加房间 173 | [self addRoomViewWithRoom:room]; 174 | // 2. 添加日期选项 175 | [self addSelectCollectionView]; 176 | } 177 | } 178 | 179 | // 设置房间号 180 | - (void)addRoomViewWithRoom:(QTRoom *)room 181 | { 182 | 183 | self.roomView = [UILabel labelWithTextColor:kUIColorFromRGB(0x666666) backgroundColor:kUIColorFromRGB(0xFFFFFF) fontSize:15]; 184 | self.roomView.layer.borderColor = [UIColor whiteColor].CGColor; 185 | self.roomView.layer.borderWidth = 1; 186 | [self.backScrollView addSubview:self.roomView]; 187 | 188 | CGFloat roomViewY = 0; 189 | 190 | if (isFirstAddRoomView) { 191 | roomViewY = 1; 192 | isFirstAddRoomView = NO; 193 | }else { 194 | roomViewY = CGRectGetMaxY(self.tempRoomView.frame) + 1; 195 | } 196 | self.roomView.frame = CGRectMake(0, roomViewY, viewWidth*2, viewHeight); 197 | self.roomView.text = room.roomNo; 198 | // 暂存roomView为了下次创建时,可以获取到上一个roomView的frame 199 | self.tempRoomView = self.roomView; 200 | 201 | // 分割线 202 | UIView *lineView = [[UIView alloc]init]; 203 | lineView.frame = CGRectMake(0, CGRectGetMinY(self.roomView.frame)-1, viewWidth*2, 1); 204 | lineView.backgroundColor = kUIColorFromRGB(0xf4f4f4); 205 | [self.backScrollView addSubview:lineView]; 206 | 207 | } 208 | 209 | 210 | 211 | 212 | - (void)setRooms:(NSArray *)rooms { 213 | 214 | _rooms = rooms; 215 | NSInteger roomCount = rooms.count; 216 | self.backScrollView.contentSize = CGSizeMake(0, (viewHeight+1)*roomCount); 217 | self.roomNoView.text = @"房间号"; 218 | 219 | self.totalNoView.text = [NSString stringWithFormat:@"共%ld间",(long)roomCount]; 220 | 221 | // 显示日期选项表格 222 | [self addRoomandSelectCellActionWithRooms:rooms]; 223 | // 加载首页数据 224 | [self loadBookedRoomList]; 225 | } 226 | 227 | 228 | /** 229 | * 加载房间列表 230 | */ 231 | - (void)loadRoomList { 232 | __weak typeof(self) weakSelf = self; 233 | [self.selectCollectionViewArr removeAllObjects]; 234 | 235 | [QTRoom loadRoomListSuccess:^(NSArray *rooms) { 236 | weakSelf.rooms = rooms; 237 | } failure:^(NSError *error) { 238 | 239 | }]; 240 | } 241 | 242 | /** 243 | * 加载已经预订的房间数据 244 | */ 245 | - (void)loadBookedRoomList { 246 | for (QTRoom *room in self.rooms){ 247 | //已经预定房间 248 | if (room.alreadyBook) { 249 | 250 | /** 251 | * 此处 从服务器得到 数据 便利数组 ,以下只是简单的示范 252 | */ 253 | NSUInteger index = [self.rooms indexOfObject:room]; 254 | QTSelectCollectionView *selectCollectionView = self.selectCollectionViewArr[index]; 255 | NSString *accountingDate = room.bookDate; 256 | // 根据accountingDate返回预定的cell的index 257 | NSInteger indexQ = [self getSelectedCellIndexWithAccountingDate:accountingDate]; 258 | [selectCollectionView.SelectedCellIndexs addObject:@(indexQ)]; 259 | 260 | NSDictionary *AccountingIdDict = @{@"bookDate":room.roomNo, 261 | @"index":@(index) 262 | }; 263 | [selectCollectionView.SelectedCellAccountingIds addObject:AccountingIdDict]; 264 | [selectCollectionView reloadData]; 265 | } 266 | } 267 | 268 | // 回到上次位置 269 | self.dateCollectionView.contentOffset = self.currentContentOffset; 270 | for (QTSelectCollectionView *selectCollectionView in self.selectCollectionViewArr) { 271 | selectCollectionView.contentOffset = self.currentContentOffset; 272 | } 273 | 274 | } 275 | 276 | 277 | #pragma mark - ZLTDateCollectionViewDelegate方法 278 | /// 根据dateCollectionView的滚动,使选项selectCollectionVie同步滚动 279 | - (void)dateCollectionView:(QTDateCollectionView *)collectionView DidScrollWithContentOffset:(CGPoint)contentOffset 280 | { 281 | self.currentContentOffset = contentOffset; 282 | // 调用监听collectionView滚动的方法 283 | [self collectionViewDidScrollWithContentOffset:contentOffset]; 284 | 285 | for (QTSelectCollectionView *selectCollectionView in self.selectCollectionViewArr) { 286 | selectCollectionView.contentOffset = contentOffset; 287 | } 288 | } 289 | 290 | #pragma mark - ZLTSelectCollectionViewDelegate方法 291 | /// 根据selectCollectionVie的滚动,使显示日期的dateCollectionView同步滚动 292 | - (void)selectCollectionView:(QTSelectCollectionView *)collectionView DidScrollWithContentOffset:(CGPoint)contentOffset 293 | { 294 | self.dateCollectionView.contentOffset = contentOffset; 295 | // 调用监听collectionView滚动的方法 296 | [self collectionViewDidScrollWithContentOffset:contentOffset]; 297 | } 298 | 299 | /// 监听选中的cell 300 | - (void)selectCollectionView:(QTSelectCollectionView *)collectionView didSelectItemAtIndex:(NSInteger)index { 301 | 302 | 303 | 304 | self.currentSelectCollectionView = collectionView; 305 | int accountingId = -110; 306 | for (NSDictionary *dict in self.currentSelectCollectionView.SelectedCellAccountingIds) { 307 | NSInteger indexDict = [dict[@"index"] integerValue]; 308 | if (indexDict == index) { 309 | accountingId = [dict[@"accountingId"] intValue]; 310 | } 311 | } 312 | // NSUInteger indexRoom = [self.selectCollectionViewArr indexOfObject:collectionView]; 313 | 314 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"弹出界面自己处理吧" preferredStyle:UIAlertControllerStyleAlert]; 315 | UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]; 316 | UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 317 | }]; 318 | 319 | [alertController addAction:cancelAction]; 320 | [alertController addAction:okAction]; 321 | 322 | [self presentViewController:alertController animated:YES completion:nil]; 323 | 324 | } 325 | 326 | #pragma mark - 监听collectionView的滚动 327 | /// 监听collectionView滚动的方法,为了实现随着滚动切换月份 328 | - (void)collectionViewDidScrollWithContentOffset:(CGPoint)contentOffset 329 | { 330 | NSInteger index = ((NSInteger)contentOffset.x - itemW*0.5)/ itemW; 331 | self.dateTool.index = index; 332 | NSString *month = [self.dateTool getMonth]; 333 | // 如果当前月份和暂存的上一个月份不同,则更新 334 | if (![self.tempMonth isEqualToString:month]) { 335 | // self.totalNoView.text = month; 336 | self.navigationItem.title = [NSString stringWithFormat:@"%@年%@月",[self.dateTool getYear],month]; 337 | } 338 | 339 | self.tempMonth = month; 340 | } 341 | 342 | 343 | /** 344 | * 根据accountingDate返回预定的cell的index 345 | */ 346 | - (NSInteger)getSelectedCellIndexWithAccountingDate:(NSString *)accountingDate 347 | { 348 | 349 | NSDate *currentDate = [NSDate date]; 350 | NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; 351 | formatter.dateFormat = @"yyyy-MM-dd"; 352 | NSDate *selectedDate = [formatter dateFromString:accountingDate]; 353 | NSString *currentDateStr = [formatter stringFromDate:currentDate]; 354 | 355 | NSInteger index = (NSInteger)[selectedDate timeIntervalSinceDate:currentDate]/(24*60*60); 356 | if ([currentDateStr isEqualToString:accountingDate]) { 357 | return 0; 358 | } 359 | if (index<0) { 360 | return -1; 361 | } 362 | return index+1; 363 | } 364 | 365 | 366 | 367 | 368 | - (UILabel *)roomNoView 369 | { 370 | if (!_roomNoView) { 371 | _roomNoView = [UILabel labelWithTextColor:kUIColorFromRGB(0x999999) backgroundColor:kUIColorFromRGB(0xFFFFFF) fontSize:12]; 372 | 373 | } 374 | return _roomNoView; 375 | } 376 | 377 | - (UILabel *)totalNoView 378 | { 379 | if (!_totalNoView) { 380 | _totalNoView = [UILabel labelWithTextColor:kUIColorFromRGB(0x666666) backgroundColor:kUIColorFromRGB(0xFFFFFF) fontSize:16]; 381 | 382 | } 383 | return _totalNoView; 384 | } 385 | 386 | 387 | - (QTDateCollectionView *)dateCollectionView 388 | { 389 | if (!_dateCollectionView) { 390 | _dateCollectionView = [[QTDateCollectionView alloc]init]; 391 | // 取消显示水平滚动指示器 392 | _dateCollectionView.showsHorizontalScrollIndicator = NO; 393 | // 指定代理 394 | _dateCollectionView.dateDelegate = self; 395 | 396 | 397 | } 398 | return _dateCollectionView; 399 | } 400 | 401 | - (UIScrollView *)backScrollView { 402 | if (!_backScrollView) { 403 | self.backScrollView = [[UIScrollView alloc]init]; 404 | self.backScrollView.showsVerticalScrollIndicator = NO; 405 | 406 | self.backScrollView.backgroundColor = [UIColor whiteColor]; 407 | } 408 | return _backScrollView; 409 | } 410 | 411 | - (NSMutableArray *)selectCollectionViewArr 412 | { 413 | if (!_selectCollectionViewArr) { 414 | _selectCollectionViewArr = [NSMutableArray array]; 415 | } 416 | return _selectCollectionViewArr; 417 | } 418 | 419 | 420 | @end 421 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Model/QTDate.h: -------------------------------------------------------------------------------- 1 | // 2 | // QTDate.h 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/18. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QTDate : NSObject 12 | /// 星期几 13 | @property (nonatomic,copy) NSString *weekday; 14 | /// 几号 15 | @property (nonatomic,copy) NSString *day; 16 | 17 | /// 模型数组 18 | + (NSArray *)dates; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Model/QTDate.m: -------------------------------------------------------------------------------- 1 | // 2 | // QTDate.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/18. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import "QTDate.h" 10 | #import "QTDateTool.h" 11 | @implementation QTDate 12 | 13 | + (NSArray *)dates 14 | { 15 | NSMutableArray *dates = [NSMutableArray array]; 16 | 17 | QTDateTool *dateTool = [QTDateTool sharedInstance]; 18 | // 日历上总共可以显示的天数 19 | int count = 60; 20 | for (int i = 0; i < count; i++) { 21 | dateTool.index = i; 22 | QTDate *date = [[QTDate alloc]init]; 23 | date.weekday = [dateTool getWeekday]; 24 | date.day = [dateTool getDay]; 25 | // NSLog(@"%@",date); 26 | [dates addObject:date]; 27 | } 28 | return [dates copy]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Model/QTRoom.h: -------------------------------------------------------------------------------- 1 | // 2 | // QTRoom.h 3 | // RoomManageDemo 4 | // 5 | // Created by 赵群涛 on 16/8/18. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QTRoom : NSObject 12 | 13 | //**房间号/ 14 | @property (nonatomic,copy) NSString *roomNo; 15 | 16 | 17 | //**是否已经预定/ 18 | 19 | @property (nonatomic, assign, getter=isAlreadyBook) BOOL alreadyBook; 20 | //**预定日期/ 21 | @property (nonatomic, copy)NSString *bookDate; 22 | 23 | /// 获取房间模型数组 24 | + (void)loadRoomListSuccess:(void(^)(NSArray *rooms))success failure:(void(^)(NSError *error))failure; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Model/QTRoom.m: -------------------------------------------------------------------------------- 1 | // 2 | // QTRoom.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/18. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import "QTRoom.h" 10 | 11 | @implementation QTRoom 12 | 13 | + (void)loadRoomListSuccess:(void(^)(NSArray *rooms))success failure:(void(^)(NSError *error))failure { 14 | 15 | 16 | NSString *path = [[NSBundle mainBundle]pathForResource:@"RoomList" ofType:@"plist"]; 17 | 18 | NSArray *commonList = [[NSArray alloc]initWithContentsOfFile:path]; 19 | 20 | NSMutableArray *rooms = [NSMutableArray array]; 21 | for (NSDictionary *dict in commonList) { 22 | QTRoom *room = [[QTRoom alloc]init]; 23 | [room setValuesForKeysWithDictionary:dict]; 24 | [rooms addObject:room]; 25 | } 26 | success([rooms copy]); 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Model/RoomList.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | roomNo 7 | 101 8 | alreadyBook 9 | 10 | bookDate 11 | 2016-08-23 12 | 13 | 14 | roomNo 15 | 102 16 | alreadyBook 17 | 18 | bookDate 19 | 20 | 21 | 22 | roomNo 23 | 103 24 | alreadyBook 25 | 26 | bookDate 27 | 28 | 29 | 30 | roomNo 31 | 104 32 | alreadyBook 33 | 34 | bookDate 35 | 2016-08-29 36 | 37 | 38 | roomNo 39 | 105 40 | alreadyBook 41 | 42 | bookDate 43 | 44 | 45 | 46 | roomNo 47 | 106 48 | alreadyBook 49 | 50 | bookDate 51 | 52 | 53 | 54 | roomNo 55 | 107 56 | alreadyBook 57 | 58 | bookDate 59 | 60 | 61 | 62 | roomNo 63 | 108 64 | alreadyBook 65 | 66 | bookDate 67 | 68 | 69 | 70 | roomNo 71 | 109 72 | alreadyBook 73 | 74 | bookDate 75 | 76 | 77 | 78 | roomNo 79 | 109 80 | alreadyBook 81 | 82 | bookDate 83 | 84 | 85 | 86 | roomNo 87 | 110 88 | alreadyBook 89 | 90 | bookDate 91 | 92 | 93 | 94 | roomNo 95 | 111 96 | alreadyBook 97 | 98 | bookDate 99 | 100 | 101 | 102 | roomNo 103 | 112 104 | alreadyBook 105 | 106 | bookDate 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Tool/QTDateTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // QTDateTool.h 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QTDateTool : NSObject 12 | 13 | /// 距离今天往后第几天 14 | @property (nonatomic,assign) NSInteger index; 15 | 16 | /// 获取当前年份 17 | - (NSString *)getYear; 18 | 19 | /// 获取当前月份 20 | - (NSString *)getMonth; 21 | 22 | /// 获取当前天(几号) 23 | - (NSString *)getDay; 24 | 25 | /// 获取当前日期,形式"yyyy-MM-dd" 26 | //- (NSString *)getCurrentDate; 27 | 28 | /// 获取当前星期几 29 | - (NSString *)getWeekday; 30 | 31 | /// 单例 32 | + (instancetype)sharedInstance; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Tool/QTDateTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // QTDateTool.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import "QTDateTool.h" 10 | 11 | @implementation QTDateTool 12 | 13 | /// 单例 14 | + (instancetype)sharedInstance 15 | { 16 | return [[self alloc]init]; 17 | } 18 | 19 | + (instancetype)allocWithZone:(struct _NSZone *)zone 20 | { 21 | static id instance = nil; 22 | static dispatch_once_t onceToken; 23 | dispatch_once(&onceToken, ^{ 24 | instance = [super allocWithZone:zone]; 25 | }); 26 | return instance; 27 | } 28 | 29 | /// 获取当前年份 30 | - (NSString *)getYear 31 | { 32 | return [self getDate][0]; 33 | } 34 | 35 | /// 获取当前月份 36 | - (NSString *)getMonth 37 | { 38 | return [self getDate][1]; 39 | } 40 | 41 | /// 获取当前天(几号) 42 | - (NSString *)getDay 43 | { 44 | return [self getDate][2]; 45 | } 46 | 47 | /// 获取分割后的当前日期,形式"yyyy","MM","dd" WithIndex:(NSUInteger)index 48 | - (NSArray *)getDate{ 49 | 50 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:60*60*24*self.index]; 51 | // NSLog(@"--index:%zd",self.index); 52 | NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; 53 | formatter.dateFormat = @"yyyy-MM-dd"; 54 | // formatter.dateFormat = [date getDayOfWeekShortString]; 55 | NSString *dateStr = [formatter stringFromDate:date]; 56 | // NSLog(@"%@",dateStr); 57 | return [dateStr componentsSeparatedByString:@"-"]; 58 | } 59 | 60 | /// 获取当前周几 61 | - (NSString *)getWeekday 62 | { 63 | NSDateComponents *_comps = [[NSDateComponents alloc] init]; 64 | [_comps setDay:[[self getDay] integerValue]]; 65 | NSString *monthStr = [self getDate][1]; 66 | [_comps setMonth:[monthStr integerValue]]; 67 | [_comps setYear:[[self getYear] integerValue]]; 68 | 69 | NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; 70 | NSDate *_date = [gregorian dateFromComponents:_comps]; 71 | NSDateComponents *weekdayComponents = [gregorian components:NSCalendarUnitWeekday fromDate:_date]; 72 | NSInteger _weekday = [weekdayComponents weekday]-1; // 此处结果多了一天,减1,得到当前是周几} 73 | 74 | // 转为字符串 75 | NSString *weekdayStr = nil; 76 | // NSLog(@"_weekday:%zd",_weekday); 77 | switch (_weekday) { 78 | case 1: 79 | weekdayStr = @"周一"; 80 | break; 81 | case 2: 82 | weekdayStr = @"周二"; 83 | break; 84 | case 3: 85 | weekdayStr = @"周三"; 86 | break; 87 | case 4: 88 | weekdayStr = @"周四"; 89 | break; 90 | case 5: 91 | weekdayStr = @"周五"; 92 | break; 93 | case 6: 94 | weekdayStr = @"周六"; 95 | break; 96 | case 0: 97 | weekdayStr = @"周日"; 98 | break; 99 | } 100 | // NSLog(@"_weekday::%@",weekdayStr); 101 | return weekdayStr; 102 | } 103 | 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Tool/UILabel+QTCategory.h: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+QTCategory.h 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UILabel (QTCategory) 12 | 13 | + (instancetype)labelWithTextColor:(UIColor *)textColor backgroundColor:(UIColor *)bkgColor fontSize:(CGFloat)size; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Tool/UILabel+QTCategory.m: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+QTCategory.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import "UILabel+QTCategory.h" 10 | 11 | @implementation UILabel (QTCategory) 12 | + (instancetype)labelWithTextColor:(UIColor *)textColor backgroundColor:(UIColor *)bkgColor fontSize:(CGFloat)size 13 | { 14 | UILabel *label = [[UILabel alloc]init]; 15 | label.font = [UIFont systemFontOfSize:size]; 16 | label.textAlignment = NSTextAlignmentCenter; 17 | label.textColor = textColor; 18 | if (bkgColor!=nil) { 19 | label.backgroundColor = bkgColor; 20 | } 21 | return label; 22 | } 23 | @end 24 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Tool/UIView+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.h 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/19. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (Extension) 12 | @property (nonatomic, assign) CGFloat x; 13 | @property (nonatomic, assign) CGFloat y; 14 | @property (nonatomic, assign) CGFloat width; 15 | @property (nonatomic, assign) CGFloat height; 16 | @property (nonatomic, assign) CGSize size; 17 | @property (assign, nonatomic) CGFloat centerX; 18 | @property (assign, nonatomic) CGFloat centerY; 19 | @end 20 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/Tool/UIView+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/19. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import "UIView+Extension.h" 10 | 11 | @implementation UIView (Extension) 12 | - (void)setCenterX:(CGFloat)centerX 13 | { 14 | CGPoint center = self.center; 15 | center.x = centerX; 16 | self.center = center; 17 | } 18 | 19 | - (CGFloat)centerX 20 | { 21 | return self.center.x; 22 | } 23 | 24 | - (void)setCenterY:(CGFloat)centerY 25 | { 26 | CGPoint center = self.center; 27 | center.y = centerY; 28 | self.center = center; 29 | } 30 | 31 | - (CGFloat)centerY 32 | { 33 | return self.center.y; 34 | } 35 | 36 | - (void)setX:(CGFloat)x 37 | { 38 | CGRect frame = self.frame; 39 | frame.origin.x = x; 40 | self.frame = frame; 41 | } 42 | 43 | - (CGFloat)x 44 | { 45 | return self.frame.origin.x; 46 | } 47 | 48 | - (void)setY:(CGFloat)y 49 | { 50 | CGRect frame = self.frame; 51 | frame.origin.y = y; 52 | self.frame = frame; 53 | } 54 | 55 | - (CGFloat)y 56 | { 57 | return self.frame.origin.y; 58 | } 59 | 60 | - (void)setWidth:(CGFloat)width 61 | { 62 | CGRect frame = self.frame; 63 | frame.size.width = width; 64 | self.frame = frame; 65 | } 66 | 67 | - (CGFloat)width 68 | { 69 | return self.frame.size.width; 70 | } 71 | 72 | - (void)setHeight:(CGFloat)height 73 | { 74 | CGRect frame = self.frame; 75 | frame.size.height = height; 76 | self.frame = frame; 77 | } 78 | 79 | - (CGFloat)height 80 | { 81 | return self.frame.size.height; 82 | } 83 | 84 | - (void)setSize:(CGSize)size 85 | { 86 | // self.width = size.width; 87 | // self.height = size.height; 88 | CGRect frame = self.frame; 89 | frame.size = size; 90 | self.frame = frame; 91 | } 92 | 93 | - (CGSize)size 94 | { 95 | return self.frame.size; 96 | } 97 | @end 98 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/View/LeftRoomNumberTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LeftRoomNumberTableView.h 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/18. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | @class LeftRoomNumberTableView,LeftRoomNumberTableViewCell; 11 | 12 | @protocol LeftRoomNumberTableViewDelegate 13 | @optional 14 | /// 监听tableView的滚动位移 15 | - (void)selectTableView:(LeftRoomNumberTableView *)tableView DidScrollWithContentOffset:(CGPoint)contentOffset; 16 | 17 | @end 18 | 19 | @interface LeftRoomNumberTableView : UITableView 20 | 21 | /** 22 | * 房间总数 23 | */ 24 | @property (nonatomic,strong) NSMutableArray *allRoomNumberArray; 25 | 26 | //**代理*/ 27 | @property (nonatomic, weak) id tableDelegate; 28 | 29 | @end 30 | 31 | @interface LeftRoomNumberTableViewCell : UITableViewCell 32 | 33 | /** 34 | * 显示文字的标签 35 | */ 36 | @property (nonatomic,strong) UILabel *roomLabel; 37 | 38 | //*线 */ 39 | @property (nonatomic, strong) UILabel *lineLabel; 40 | 41 | @end -------------------------------------------------------------------------------- /RoomManage/ManageRoom/View/LeftRoomNumberTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LeftRoomNumberTableView.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/18. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import "LeftRoomNumberTableView.h" 10 | #import "QTRoom.h" 11 | @interface LeftRoomNumberTableView() 12 | 13 | 14 | 15 | 16 | @end 17 | 18 | 19 | @implementation LeftRoomNumberTableView 20 | 21 | - (instancetype)init { 22 | self = [super init]; 23 | if (self) { 24 | self.delegate = self; 25 | self.dataSource = self; 26 | 27 | 28 | } 29 | return self; 30 | } 31 | 32 | 33 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 34 | return self.allRoomNumberArray.count; 35 | } 36 | 37 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 38 | static NSString *cellID = @"LeftRoomNumberTableViewCell"; 39 | LeftRoomNumberTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; 40 | if (cell == nil) { 41 | cell = [[LeftRoomNumberTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; 42 | } 43 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 44 | 45 | QTRoom *model = [[QTRoom alloc]init]; 46 | model = self.allRoomNumberArray[indexPath.row]; 47 | cell.roomLabel.text = model.roomNo; 48 | return cell; 49 | 50 | } 51 | 52 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 53 | if ([self.tableDelegate respondsToSelector:@selector(selectTableView:DidScrollWithContentOffset:)]) { 54 | [self.tableDelegate selectTableView:self DidScrollWithContentOffset:scrollView.contentOffset]; 55 | 56 | } 57 | } 58 | 59 | 60 | - (NSMutableArray *)allRoomNumberArray { 61 | if (!_allRoomNumberArray) { 62 | self.allRoomNumberArray = [NSMutableArray arrayWithCapacity:1]; 63 | 64 | } 65 | return _allRoomNumberArray; 66 | } 67 | 68 | @end 69 | 70 | @implementation LeftRoomNumberTableViewCell 71 | 72 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 73 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 74 | if (self) { 75 | [self loadUI]; 76 | } 77 | return self; 78 | } 79 | 80 | - (void)loadUI { 81 | 82 | 83 | self.roomLabel.frame = CGRectMake(0, 0, (WIDTH - 7 + 2)/7 * 2, 50); 84 | // self.roomLabel.frame = self.contentView.bounds; 85 | self.lineLabel.frame = CGRectMake(0, 49.5, self.roomLabel.frame.size.width, 0.5); 86 | 87 | [self.contentView addSubview:self.roomLabel]; 88 | [self.contentView addSubview:self.lineLabel]; 89 | } 90 | 91 | - (UILabel *)roomLabel { 92 | if (!_roomLabel) { 93 | self.roomLabel= [UILabel labelWithTextColor:[UIColor whiteColor] backgroundColor:kUIColorFromRGB(0xffb400) fontSize:16]; 94 | self.roomLabel.textAlignment = NSTextAlignmentCenter; 95 | self.roomLabel.textColor = [UIColor redColor]; 96 | 97 | 98 | } 99 | return _roomLabel; 100 | } 101 | 102 | 103 | - (UILabel *)lineLabel { 104 | if (!_lineLabel) { 105 | self.lineLabel = [[UILabel alloc] init]; 106 | self.lineLabel.backgroundColor = kUIColorFromRGB(0xd8d8d8); 107 | } 108 | return _lineLabel; 109 | } 110 | 111 | @end -------------------------------------------------------------------------------- /RoomManage/ManageRoom/View/QTDateCollectionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // QTDateCollectionView.h 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | @class QTDate,QTDateCollectionView; 11 | 12 | @protocol QTDateCollectionViewDelegate 13 | @optional 14 | 15 | /// 监听的滚动位移 16 | - (void)dateCollectionView:(QTDateCollectionView *)collectionView DidScrollWithContentOffset:(CGPoint)contentOffset; 17 | 18 | @end 19 | 20 | @interface QTDateCollectionView : UICollectionView 21 | 22 | /// cell的大小 23 | @property (nonatomic,assign) CGSize itemSize; 24 | 25 | //**代理*/ 26 | @property (nonatomic, weak) id dateDelegate; 27 | 28 | @end 29 | 30 | @interface QTDateCollectionViewCell: UICollectionViewCell 31 | /// 日期模型 32 | @property (nonatomic,strong) QTDate *date; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/View/QTDateCollectionView.m: -------------------------------------------------------------------------------- 1 | // 2 | // QTDateCollectionView.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import "QTDateCollectionView.h" 10 | #import "QTDate.h" 11 | 12 | @interface QTDateCollectionView() 13 | 14 | /// 流水布局 15 | @property (nonatomic,strong) UICollectionViewFlowLayout *layout; 16 | /// 日期模型集合 17 | @property (nonatomic,strong) NSArray *dates; 18 | 19 | @end 20 | 21 | BOOL isFirstCell = NO; 22 | static NSString * const dateCellreuseIdentifier = @"DateCell"; 23 | 24 | @implementation QTDateCollectionView 25 | 26 | #pragma mark - 构造函数 27 | - (instancetype)init 28 | { 29 | 30 | if (self = [super initWithFrame:CGRectZero collectionViewLayout:self.layout]) { 31 | // 设置数据源 32 | self.dataSource = self; 33 | // 设置代理 34 | self.delegate = self; 35 | // 注册cell 36 | [self registerClass:[QTDateCollectionViewCell class] forCellWithReuseIdentifier:dateCellreuseIdentifier]; 37 | self.backgroundColor = [UIColor whiteColor]; 38 | } 39 | return self; 40 | } 41 | 42 | #pragma mark - UICollectionViewDataSource & UICollectionViewDelegate 43 | 44 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 45 | { 46 | self.dates = [QTDate dates]; 47 | return self.dates.count; 48 | } 49 | 50 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 51 | QTDate *date = self.dates[indexPath.item]; 52 | 53 | isFirstCell = indexPath.item == 0 ? YES : NO; 54 | QTDateCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:dateCellreuseIdentifier forIndexPath:indexPath]; 55 | 56 | // 设置显示内容 57 | cell.date = date; 58 | 59 | return cell; 60 | } 61 | 62 | //监听滚动 63 | 64 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 65 | CGPoint contentOffset = scrollView.contentOffset; 66 | // 调用代理方法 67 | if ([self.dateDelegate respondsToSelector:@selector(dateCollectionView:DidScrollWithContentOffset:)]) { 68 | [self.dateDelegate dateCollectionView:self DidScrollWithContentOffset:contentOffset]; 69 | } 70 | } 71 | 72 | #pragma mark - setter & getter 73 | 74 | - (void)setItemSize:(CGSize)itemSize { 75 | _itemSize = itemSize; 76 | self.layout.itemSize = itemSize; 77 | 78 | } 79 | 80 | 81 | #pragma mark - 懒加载 82 | 83 | - (UICollectionViewFlowLayout *)layout { 84 | if (!_layout) { 85 | _layout = [[UICollectionViewFlowLayout alloc] init]; 86 | _layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; 87 | _layout.minimumLineSpacing = 1; 88 | _layout.minimumInteritemSpacing = 1; 89 | 90 | } 91 | return _layout; 92 | } 93 | 94 | @end 95 | 96 | #pragma mark - 实现自定义cell 97 | 98 | @interface QTDateCollectionViewCell() 99 | /// 周几 100 | @property (nonatomic,strong) UILabel *weekdayView; 101 | /// 几号 102 | @property (nonatomic,strong) UILabel *dayView; 103 | 104 | @end 105 | 106 | @implementation QTDateCollectionViewCell 107 | 108 | - (instancetype)initWithFrame:(CGRect)frame { 109 | if (self = [super initWithFrame:frame]) { 110 | self.layer.borderColor = [UIColor whiteColor].CGColor; 111 | self.layer.borderWidth = 0.1; 112 | [self prepareUI]; 113 | } 114 | return self; 115 | 116 | } 117 | 118 | #pragma mark - setter 119 | 120 | - (void)setDate:(QTDate *)date 121 | { 122 | _date = date; 123 | self.dayView.text = date.day; 124 | 125 | self.weekdayView.backgroundColor = kUIColorFromRGB(0xFFFFFF); 126 | self.dayView.backgroundColor = kUIColorFromRGB(0xFFFFFF); 127 | 128 | if (isFirstCell) { 129 | self.weekdayView.text = @"今天"; 130 | [self setupTodayTextColor]; 131 | // isFirstCell = NO; 132 | }else if ([date.weekday isEqualToString:@"周五"] || [date.weekday isEqualToString:@"周六"]) { 133 | self.weekdayView.text =date.weekday; 134 | [self setupTextColorRed]; 135 | } else { 136 | self.weekdayView.text =date.weekday; 137 | [self setupTextColorGreen]; 138 | } 139 | 140 | 141 | } 142 | 143 | /// 设置今天cell的颜色 144 | - (void)setupTodayTextColor 145 | { 146 | self.weekdayView.textColor = kUIColorFromRGB(0xFFFFFF); 147 | self.weekdayView.backgroundColor = kUIColorFromRGB(0x74c8c9); 148 | self.dayView.textColor = kUIColorFromRGB(0xFFFFFF); 149 | self.dayView.backgroundColor = kUIColorFromRGB(0x74c8c9); 150 | } 151 | 152 | /// 设置周五、六、日cell的颜色 153 | - (void)setupTextColorRed 154 | { 155 | self.weekdayView.textColor = kUIColorFromRGB(0xFF5656); 156 | self.dayView.textColor = kUIColorFromRGB(0xFF5656); 157 | } 158 | /// 设置文本字体为白色 159 | - (void)setupTextColorGreen 160 | { 161 | self.weekdayView.textColor = kUIColorFromRGB(0x999999); 162 | self.dayView.textColor = kUIColorFromRGB(0x666666); 163 | } 164 | 165 | 166 | #pragma mark - 准备UI 167 | - (void)prepareUI 168 | { 169 | // 1. 添加子控件 170 | [self.contentView addSubview:self.weekdayView]; 171 | [self.contentView addSubview:self.dayView]; 172 | 173 | // 2.设置frame 174 | 175 | CGSize itemSize = self.bounds.size; 176 | self.weekdayView.frame = CGRectMake(0, 0, itemSize.width, itemSize.height*0.5+0.5); 177 | self.dayView.frame = CGRectMake(0, itemSize.height*0.5, itemSize.width, itemSize.height*0.5); 178 | } 179 | 180 | #pragma mark - 懒加载 181 | 182 | - (UILabel *)weekdayView 183 | { 184 | if (!_weekdayView) { 185 | _weekdayView = [UILabel labelWithTextColor:kUIColorFromRGB(0x999999) backgroundColor:kUIColorFromRGB(0xFFFFFF) fontSize:12]; 186 | } 187 | return _weekdayView; 188 | } 189 | 190 | - (UILabel *)dayView 191 | { 192 | if (!_dayView) { 193 | _dayView = [UILabel labelWithTextColor:kUIColorFromRGB(0x666666) backgroundColor:kUIColorFromRGB(0xFFFFFF) fontSize:16]; 194 | } 195 | return _dayView; 196 | } 197 | 198 | 199 | @end 200 | 201 | -------------------------------------------------------------------------------- /RoomManage/ManageRoom/View/QTSelectCollectionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // QTSelectCollectionView.h 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/18. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class QTSelectCollectionView,QTSelectCollectionViewCell; 12 | 13 | @protocol QTSelectCollectionViewDelegate 14 | @optional 15 | /// 监听dateCollectionView的滚动位移 16 | - (void)selectCollectionView:(QTSelectCollectionView *)collectionView DidScrollWithContentOffset:(CGPoint)contentOffset; 17 | // 监听选中某个cell 18 | - (void)selectCollectionView:(QTSelectCollectionView *)collectionView didSelectItemAtIndex:(NSInteger)index; 19 | 20 | @end 21 | 22 | @interface QTSelectCollectionView : UICollectionView 23 | 24 | /// 所有被选中cell的索引 25 | @property (nonatomic,strong) NSMutableArray *SelectedCellIndexs; 26 | /// 所有被选中cell的订单Id 27 | @property (nonatomic,strong) NSMutableArray *SelectedCellAccountingIds; 28 | 29 | /// cell的大小 30 | @property (nonatomic,assign) CGSize itemSize; 31 | 32 | //**代理/ 33 | @property (nonatomic, weak)id SelectColDelegate; 34 | 35 | @end 36 | 37 | #pragma mark - 自定义QTSelectCollectionViewCell 38 | 39 | @interface QTSelectCollectionViewCell : UICollectionViewCell 40 | 41 | /** 42 | * 显示文字的标签 43 | */ 44 | @property (nonatomic,strong) UILabel *textLabel; 45 | @end -------------------------------------------------------------------------------- /RoomManage/ManageRoom/View/QTSelectCollectionView.m: -------------------------------------------------------------------------------- 1 | // 2 | // QTSelectCollectionView.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/18. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import "QTSelectCollectionView.h" 10 | #import "QTDate.h" 11 | 12 | @interface QTSelectCollectionView() 13 | 14 | /// 流水布局 15 | @property (nonatomic,strong) UICollectionViewFlowLayout *layout; 16 | /// 日期模型集合 17 | @property (nonatomic,strong) NSArray *dates; 18 | 19 | 20 | @end 21 | 22 | static NSString *const dateCellreuseIdentifier = @"SelectCell"; 23 | 24 | @implementation QTSelectCollectionView 25 | 26 | - (instancetype)init { 27 | 28 | if (self = [super initWithFrame:CGRectZero collectionViewLayout:self.layout]) { 29 | self.dataSource = self; 30 | self.delegate = self; 31 | 32 | [self registerClass:[QTSelectCollectionViewCell class] forCellWithReuseIdentifier:dateCellreuseIdentifier]; 33 | self.backgroundColor = [UIColor whiteColor]; 34 | } 35 | return self; 36 | 37 | } 38 | 39 | #pragma mark - UICollcetionView 40 | 41 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { 42 | return 30; 43 | 44 | } 45 | 46 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 47 | QTSelectCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:dateCellreuseIdentifier forIndexPath:indexPath]; 48 | cell.backgroundColor = kUIColorFromRGB(0xf4f4f4); 49 | cell.textLabel.hidden= YES; 50 | 51 | for (id indexObj in self.SelectedCellIndexs) { 52 | NSInteger index = [indexObj integerValue]; 53 | if (index == indexPath.item) { 54 | cell.textLabel.hidden = NO; 55 | break; 56 | } 57 | } 58 | 59 | return cell; 60 | } 61 | 62 | //滚动监听 63 | 64 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 65 | // 调用代理方法 66 | if ([self.SelectColDelegate respondsToSelector:@selector(selectCollectionView:DidScrollWithContentOffset:)]) { 67 | [self.SelectColDelegate selectCollectionView:self DidScrollWithContentOffset:scrollView.contentOffset]; 68 | } 69 | } 70 | 71 | 72 | //监听选中的某个cell 73 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { 74 | 75 | if ([self.SelectColDelegate respondsToSelector:@selector(selectCollectionView:didSelectItemAtIndex:)]) { 76 | [self.SelectColDelegate selectCollectionView:self didSelectItemAtIndex:indexPath.item]; 77 | } 78 | } 79 | 80 | #pragma mark - setter & getter 81 | 82 | - (void)setItemSize:(CGSize)itemSize 83 | { 84 | _itemSize = itemSize; 85 | self.layout.itemSize = itemSize; 86 | } 87 | 88 | #pragma mark - 懒加载 89 | 90 | - (UICollectionViewFlowLayout *)layout 91 | { 92 | if (!_layout) { 93 | _layout = [[UICollectionViewFlowLayout alloc]init]; 94 | // 设置水平滚动 95 | _layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; 96 | _layout.minimumLineSpacing = 1; 97 | _layout.minimumInteritemSpacing = 1; 98 | 99 | } 100 | return _layout; 101 | } 102 | 103 | - (NSArray *)dates 104 | { 105 | if (!_dates) { 106 | _dates = [QTDate dates]; 107 | } 108 | return _dates; 109 | } 110 | 111 | - (NSMutableArray *)SelectedCellIndexs 112 | { 113 | if (!_SelectedCellIndexs) { 114 | _SelectedCellIndexs = [NSMutableArray array]; 115 | } 116 | return _SelectedCellIndexs; 117 | } 118 | 119 | - (NSMutableArray *)SelectedCellAccountingIds 120 | { 121 | if (!_SelectedCellAccountingIds) { 122 | _SelectedCellAccountingIds = [NSMutableArray array]; 123 | } 124 | return _SelectedCellAccountingIds; 125 | } 126 | @end 127 | #pragma mark - 实现自定义的ZLTSelectCollectionViewCell 128 | 129 | @interface QTSelectCollectionViewCell () 130 | 131 | @end 132 | 133 | @implementation QTSelectCollectionViewCell 134 | 135 | - (instancetype)initWithFrame:(CGRect)frame 136 | { 137 | if (self = [super initWithFrame:frame]) { 138 | [self prepareUI]; 139 | self.backgroundColor = [UIColor redColor]; 140 | } 141 | return self; 142 | } 143 | 144 | #pragma mark - 准备UI 145 | - (void)prepareUI{ 146 | // 1.添加子控件 147 | [self.contentView addSubview:self.textLabel]; 148 | // 2.设置约束 149 | self.textLabel.frame = self.contentView.bounds; 150 | } 151 | 152 | #pragma mark - 懒加载 153 | - (UILabel *)textLabel 154 | { 155 | if (!_textLabel) { 156 | _textLabel = [UILabel labelWithTextColor:[UIColor whiteColor] backgroundColor:kUIColorFromRGB(0xffb400) fontSize:16]; 157 | _textLabel.text = @"订"; 158 | _textLabel.hidden = YES; 159 | } 160 | return _textLabel; 161 | } 162 | 163 | @end 164 | 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /RoomManage/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // RoomManageDemo 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | #import "UILabel+QTCategory.h" 12 | #import "UIView+Extension.h" 13 | 14 | //RGB的颜色转换 15 | #define kUIColorFromRGB(rgbValue) [UIColor \ 16 | colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ 17 | green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ 18 | blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] 19 | 20 | //屏幕的宽/高宏 21 | #define WIDTH ([UIScreen mainScreen].bounds.size.width) 22 | #define HEIGHT ([UIScreen mainScreen].bounds.size.height) 23 | 24 | 25 | // 判断是否iPhone4 26 | #define iPhone4 ([UIScreen mainScreen].bounds.size.height == 480) 27 | // 判断是否iPhone5 28 | #define iPhone5 ([UIScreen mainScreen].bounds.size.height == 568) 29 | 30 | // 判断是否iPhone6 31 | #define iPhone6 ([UIScreen mainScreen].bounds.size.height == 667) 32 | 33 | // 判断是否iPhone6plus 34 | #define iPhone6plus ([UIScreen mainScreen].bounds.size.height == 736) 35 | 36 | 37 | 38 | #endif /* PrefixHeader_pch */ 39 | -------------------------------------------------------------------------------- /RoomManage/Screenshots/Simulator Screen Shot 2016年8月19日 14.21.57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhaoquntao/RoomManage/37e7c019d2480840033bbce4a8d891e5835c959f/RoomManage/Screenshots/Simulator Screen Shot 2016年8月19日 14.21.57.png -------------------------------------------------------------------------------- /RoomManage/Screenshots/Untitled.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhaoquntao/RoomManage/37e7c019d2480840033bbce4a8d891e5835c959f/RoomManage/Screenshots/Untitled.gif -------------------------------------------------------------------------------- /RoomManage/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/18. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /RoomManage/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/18. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "QTManageViewController.h" 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | - (IBAction)btn:(id)sender { 22 | 23 | QTManageViewController *manageVC = [[QTManageViewController alloc] init]; 24 | [self.navigationController pushViewController:manageVC animated:YES]; 25 | 26 | 27 | 28 | } 29 | 30 | - (void)didReceiveMemoryWarning { 31 | [super didReceiveMemoryWarning]; 32 | // Dispose of any resources that can be recreated. 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /RoomManage/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RoomManage 4 | // 5 | // Created by 赵群涛 on 16/8/17. 6 | // Copyright © 2016年 ZQT. 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 | -------------------------------------------------------------------------------- /RoomManageTests/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 | -------------------------------------------------------------------------------- /RoomManageTests/RoomManageTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // RoomManageTests.m 3 | // RoomManageTests 4 | // 5 | // Created by 赵群涛 on 16/8/19. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RoomManageTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation RoomManageTests 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 | -------------------------------------------------------------------------------- /RoomManageUITests/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 | -------------------------------------------------------------------------------- /RoomManageUITests/RoomManageUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // RoomManageUITests.m 3 | // RoomManageUITests 4 | // 5 | // Created by 赵群涛 on 16/8/19. 6 | // Copyright © 2016年 ZQT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RoomManageUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation RoomManageUITests 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 | --------------------------------------------------------------------------------