Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MKTextField Ripple effect #31

Open
ed-mejia opened this issue Jun 30, 2015 · 1 comment
Open

MKTextField Ripple effect #31

ed-mejia opened this issue Jun 30, 2015 · 1 comment

Comments

@ed-mejia
Copy link

If you add a MKTextField into a ScrollView or TableView, ripple effect does not play on tap, how can we solve this issue?

@mollywoodnini
Copy link

ScrollViews / TableViews swallow all the touches of any subviews. You have to subclass UIScrollView and pass the touches to the MKTextField like this:

override func touchesShouldBegin(touches: Set<UITouch>, withEvent event: UIEvent?, inContentView view: UIView) -> Bool {
        if let textField = view as? MKTextField, let touch = touches.first {
            textField.beginTrackingWithTouch(touch, withEvent: event)
        }

        return true
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants