Hi All,
Now days , we start booking seats online so if you also want to implement seat selection functionality than follow these steps .
Download ZSeatSelector from this link https://github.com/richzertuche/ZSeatSelector
Now drag two files from this folder zseat and zseatselector.
In ViewController add this code in viewDidLoad method :-
NSString *map = @"AAAAA_DAAAA/"
                    @"UAAAA_DAAAA/"
                    @"UUUUU_DAAAA/"
                    @"UAAAA_AAAAA/"
                    @"ASSAA_AAAAA/";
    ZSeatSelector *seat = [[ZSeatSelector alloc]initWithFrame:CGRectMake(0, 30, self.view.frame.size.width, 160)];
    [seat setSeatSize:CGSizeMake(32, 32)];
    [seat setAvailableImage:[UIImage imageNamed:@"A"]
        andUnavailableImage:[UIImage imageNamed:@"U"]
           andDisabledImage:[UIImage imageNamed:@"D"]
           andSelectedImage:[UIImage imageNamed:@"S"]];
    [seat setSeat_price:30];
    [seat setMap:map];
    seat.seat_delegate = self;
    [self.view addSubview:seat];
Above code is to add zseatselector dynamically , If you are using storyboard than you simple add scroll view and add its constraint. Now give ZSeatSelector class to scroll view in storyboard and make a IBOutlet 
of ZSeatSelector than use this code.
NSString *map = @"AAAAA_DAAAA/"
                    @"UAAAA_DAAAA/"
                    @"UUUUU_DAAAA/"
                    @"UAAAA_AAAAA/"
                    @"ASSAA_AAAAA/";
    self.seat = [[ZSeatSelector alloc]initWithFrame:CGRectMake(0, 30, self.view.frame.size.width, 160)];
    [_seat setSeatSize:CGSizeMake(32, 32)];
    [_seat setAvailableImage:[UIImage imageNamed:@"A"]
        andUnavailableImage:[UIImage imageNamed:@"U"]
           andDisabledImage:[UIImage imageNamed:@"D"]
           andSelectedImage:[UIImage imageNamed:@"S"]];
    [_seat setSeat_price:30];
    [_seat setMap:map];
    _seat.seat_delegate = self;
    [_self.view addSubview:seat];
SeatSelector
                       
                    
0 Comment(s)