0

I'm currently creating a iOS app for guitar players in Objective-C, and when the user wants to add a new song he has to pick a key. The problem with music is that there are 2 kinds of keys: majors and minors. If the user wants to pick a major key and he's scrolling through, I want the minor keys row to be blurred, or somewhat do not let the user pick a minor key, because he has to select either a minor or a major key.

So my question is: how can I blur and block user interaction with a row of UIPickerView, while the other one is enabled?

Thanks in advance!

Daniel Pop
  • 456
  • 1
  • 6
  • 23

1 Answers1

2

Use viewForRow to blur the unselected views then "unblur" the selected view in didSelectRow. The code is pretty straightforward at that point. Use the following functions to achieve what you want.

UIPickeView

Blurring a view

func pickerView(pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusingView view: UIView!) -> UIView

func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int)
Community
  • 1
  • 1
Mark McCorkle
  • 9,349
  • 2
  • 32
  • 42