Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Seat Selector For iOS

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.20k
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: