高仿猫眼选票模块,因为公司业务需求,要对接猫眼电影,网上也没有很完整的库,所以就结合了网上已有的几个库封装一个符合公司要求的库。
在基础的选座功能上实现了情侣座的选择和是否落单的判断
To run the example project, clone the repo, and run pod install
from the Example directory first.
Demo中的数据为真实猫眼电影座位数据
创建SeatsView:
#import "YSSeatsPickerHeader.h"
YSSeatsPicker *picker = [YSSeatsPicker new];
picker.frame = CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, 500);
picker.seats = section.seats;
[self.view addSubview:picker];
展示数据:
[picker reloadData];
更新Frame后需要刷新:
[picker updateSeatsView];
校验是否落单:
[YSMovieTools checkSeatsWhetherAloneWithSelectsSeats:picker.selectSeats forSeats:picker.seats];
YSSeatsPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'YSSeatsPicker'
YSSeatsPicker is available under the MIT license. See the LICENSE file for more info.