Skip to content

Repository files navigation

ALBusSeatView 💺

VersionLicensePlatform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Screenshots

StartSelectGender SelectionVoilà!

Installation

ALBusSeatView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod'ALBusSeatView'

Usage

// If you want to config more
// let config = ALBusSeatViewConfig()
// ALBusSeatView(withConfig: config)
letseatView=ALBusSeatView()
seatView.delegate =self
seatView.dataSource =self
view.addSubview(seatView)
//ALBusSeatViewDataSource
func seatView(_ seatView:ALBusSeatView, numberOfSeatInSection section:Int)->Int{return43 // Total seat count
}func seatView(_ seatView:ALBusSeatView, seatNumberForIndex indexPath:IndexPath)->String{return"10" // Seat Number
}func seatView(_ seatView:ALBusSeatView,
seatTypeForIndex indexPath:IndexPath)->ALBusSeatType{return.empty
}
// Seat Types
publicenumALBusSeatType:Int{
/// Free to pick
case empty
/// Already sold by woman or man
case sold
/// Being selected
case selected
/// Already sold by woman
case soldWoman
/// Already sold by man
case soldMan
/// Not a seat. Can not be able to select
case none
}

Documentation

Config (ALBusSeatViewConfig)

Layout

ParamDescDefaultType
leftHandDrivePositionLeft drive position statusTrueBool
marginBetweenSeatsMargin between seats5.0CGFloat

Seat

ParamDescDefaultType
seatEmptyBGColorEmpty seat color.whiteUIColor
seatSoldBGColorSeat color purchased by woman or man. (Common seat).grayUIColor
seatSelectedBGColorSelected seat color.greenUIColor
seatSoldWomanBGColorSeat color purchased by woman.redUIColor
seatSoldManBGColorSeat color purchased by man.blueUIColor
seatCornerRadiusSeat corner radius8.0CGFloat
seatBorderColorSeat border color.clearUIColor
seatBorderWidthSeat border width0CGFloat
seatShadowColorSeat shadow color.lightGrayUIColor
seatShadowRadiusSeat shadow radius5.0CGFloat
seatShadowSizeSeat shadow size1,1CGSize
seatShadowOpacitySeat shadow opacity0.7Float
seatRemoveImageThe remove button image for selected seatnilUIImage?
seatNumberFontSeat number label font.system(15)UIFont
seatNumberSelectedFontSelected seat number label font.systemBold(15)UIFont
seatNumberColorSeat number label color.blackUIColor
seatNumberSelectedColorSelected seat number label color.whiteUIColor

Hall

ParamDescDefaultType
centerHallHeightBus hall height20CGFloat
centerHallInfoTextHall information label text""String
centerHallInfoTextColorHall information label text color.blackUIColor
centerHallInfoTextFontHall information label text font.system(12)UIFont

Bus Front Section

ParamDescDefaultType
busFrontImageBus front imagenilUIImage?
busFrontImageWidthBus front image width50CGFloat

Bus Floor Section

ParamDescDefaultType
floorSeperatorWidthFloor section width50CGFloat
floorSeperatorImageFloor section imagenilUIImage?

Gender Tooltip

ParamDescDefaultType
tooltipTextGender selection tooltip title"Select Gender"String

Author

sonifex, sonerguler93@gmail.com

License

ALBusSeatView is available under the MIT license. See the LICENSE file for more info.

Releases

Packages

Used by

Contributors

Languages