项目作者: applogistdev

项目描述 :
Bus Seat View Selection
高级语言: Swift
项目地址: git://github.com/applogistdev/ALBusSeatView.git
创建时间: 2020-02-14T07:34:37Z
项目社区:https://github.com/applogistdev/ALBusSeatView

开源协议:MIT License

下载


ALBusSeatView 💺

Version License Platform

Example

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

Screenshots

Start Select Gender Selection Voilà!

Installation

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

  1. pod 'ALBusSeatView'

Usage

  1. // If you want to config more
  2. // let config = ALBusSeatViewConfig()
  3. // ALBusSeatView(withConfig: config)
  4. let seatView = ALBusSeatView()
  5. seatView.delegate = self
  6. seatView.dataSource = self
  7. view.addSubview(seatView)
  8. //ALBusSeatViewDataSource
  9. func seatView(_ seatView: ALBusSeatView, numberOfSeatInSection section: Int) -> Int {
  10. return 43 // Total seat count
  11. }
  12. func seatView(_ seatView: ALBusSeatView, seatNumberForIndex indexPath: IndexPath) -> String {
  13. return "10" // Seat Number
  14. }
  15. func seatView(_ seatView: ALBusSeatView,
  16. seatTypeForIndex indexPath: IndexPath) -> ALBusSeatType {
  17. return .empty
  18. }
  19. // Seat Types
  20. public enum ALBusSeatType: Int {
  21. /// Free to pick
  22. case empty
  23. /// Already sold by woman or man
  24. case sold
  25. /// Being selected
  26. case selected
  27. /// Already sold by woman
  28. case soldWoman
  29. /// Already sold by man
  30. case soldMan
  31. /// Not a seat. Can not be able to select
  32. case none
  33. }

Documentation

Config (ALBusSeatViewConfig)

Layout

Param Desc Default Type
leftHandDrivePosition Left drive position status True Bool
marginBetweenSeats Margin between seats 5.0 CGFloat

Seat

Param Desc Default Type
seatEmptyBGColor Empty seat color .white UIColor
seatSoldBGColor Seat color purchased by woman or man. (Common seat) .gray UIColor
seatSelectedBGColor Selected seat color .green UIColor
seatSoldWomanBGColor Seat color purchased by woman .red UIColor
seatSoldManBGColor Seat color purchased by man .blue UIColor
seatCornerRadius Seat corner radius 8.0 CGFloat
seatBorderColor Seat border color .clear UIColor
seatBorderWidth Seat border width 0 CGFloat
seatShadowColor Seat shadow color .lightGray UIColor
seatShadowRadius Seat shadow radius 5.0 CGFloat
seatShadowSize Seat shadow size 1,1 CGSize
seatShadowOpacity Seat shadow opacity 0.7 Float
seatRemoveImage The remove button image for selected seat nil UIImage?
seatNumberFont Seat number label font .system(15) UIFont
seatNumberSelectedFont Selected seat number label font .systemBold(15) UIFont
seatNumberColor Seat number label color .black UIColor
seatNumberSelectedColor Selected seat number label color .white UIColor

Hall

Param Desc Default Type
centerHallHeight Bus hall height 20 CGFloat
centerHallInfoText Hall information label text “” String
centerHallInfoTextColor Hall information label text color .black UIColor
centerHallInfoTextFont Hall information label text font .system(12) UIFont

Bus Front Section

Param Desc Default Type
busFrontImage Bus front image nil UIImage?
busFrontImageWidth Bus front image width 50 CGFloat

Bus Floor Section

Param Desc Default Type
floorSeperatorWidth Floor section width 50 CGFloat
floorSeperatorImage Floor section image nil UIImage?

Gender Tooltip

Param Desc Default Type
tooltipText Gender 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.