TYHeightPicker Save

It's custom height picker for your health app. you can you this where picking up height or number from user.

Project README

TYHeightPicker

It's custom height picker for your health app. you can use this where picking up height from user, Or you can use as a custom picker too.

gif

How to use

Import YTHeightPicker.swift into your project.

   class ViewController: UIViewController {
       
    var heighPicker: TYHeightPicker!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        setupTYHeightPicker()
    }
    
    func setupTYHeightPicker() {
        heighPicker = TYHeightPicker()
        heighPicker.translatesAutoresizingMaskIntoConstraints = false
        heighPicker.delegate = self
        self.view.addSubview(heighPicker)
        
        heighPicker.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true
        heighPicker.rightAnchor.constraint(equalTo: self.view.rightAnchor).isActive = true
        heighPicker.centerYAnchor.constraint(equalTo: self.view.centerYAnchor).isActive = true
        heighPicker.heightAnchor.constraint(equalToConstant: 145).isActive = true
    }
    
}

Delegate Method

    func selectedHeight(height: CGFloat, unit: HeightUnit) {
        print(height, unit)
    }

Set default selected height

    heighPicker.setDefaultHeight(67, unit: .Inch)

gif

Open Source Agenda is not affiliated with "TYHeightPicker" Project. README Source: yashthaker7/TYHeightPicker
Stars
39
Open Issues
2
Last Commit
5 years ago

Open Source Agenda Badge

Open Source Agenda Rating