/WTYFirstResponder

A convenient UIResponder category(objc)/extension(swift) to find the first responder

Primary LanguageObjective-CMIT LicenseMIT

WTYFirstResponder

About

WTYFirstResponder is a convenient UIResponder category(objective-c)/extension(swift) with which you can get the current first responder with just one line of code.

Usage

For objective-c

#import "UIResponder+WTYFirstResponder.h"

id firstResponder = [UIResponder wty_firstResponder];

For swift

firstResponder = UIResponder.wty_firstResponder()

Then you got the first responder.

HowTo

Just copy the UIResponder+WTYFirstResponder.h/.m to your objective-c project or UIResponder+WTYFirstResponder.swift to your swift project, then you are good to go.

License

WTYFirstResponder is released under the MIT license. See LICENSE.