wty21cn / WTYFirstResponder

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

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

License:MIT License


Languages

Language:Objective-C 57.8%Language:Swift 42.2%