Search code examples
iosxcodeuipickerviewswift2

Display PickerView when touch UITextView


I Word with Xcode 7 and Swift 2 I would like to create a function that displays a PickerView when I click on my UITextView. How should I do? Thanks !


Solution

  • This can be done by changing the inputView property of your UITextView to your UIPickerView object.
    something like this:

    myTextView.inputView = myPickerView;  
    

    Hope this helps!