Skip to content

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

Notifications You must be signed in to change notification settings

yashthaker7/TYHeightPicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages