Dismissing Keyboard on Scrollview Swift

Hi Guys!

My very first question here.
Could anyone help with how to dismiss the keyboard using the scroll view?

I have some textfields within my scrollview and the touches are not recognized within the scroll view to dismiss the keyboard.

Any help on this please?

    
    func textFieldShouldReturn(textField: UITextField) -> Bool {
        textField.resignFirstResponder()
        println("yes") // this is of no use since I am using a numeric keyboard :'(
        return true;
    }
    override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
        self.view.endEditing(true)
        println("touched") // Nothing is printed when I touch anyhting in the scrollview
    }

Dismiss by starting a scroll:


override func scrollViewWillBeginDragging(scrollView: UIScrollView) {

view.endEditing(true)

}

When I try to implement this method I get an errror, that it's not overriding any method from its superclass

delete override keyword

Dismissing Keyboard on Scrollview Swift
 
 
Q