A convenient UIResponder category(objc)/extension(swift) to find the first responder
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
UIResponder+WTYFirstResponder.h
UIResponder+WTYFirstResponder.m
UIResponder+WTYFirstResponder.swift

README.md

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.