Last active
September 15, 2015 02:34
-
-
Save demonar/f5a7e79b2e7d8e488fe3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
private var kAssociationKeyNextField: UInt8 = 0 | |
extension UITextField { | |
@IBOutlet var nextField: UITextField? { | |
get { | |
return objc_getAssociatedObject(self, &kAssociationKeyNextField) as? UITextField | |
} | |
set(newField) { | |
objc_setAssociatedObject(self, &kAssociationKeyNextField, newField, UInt(OBJC_ASSOCIATION_RETAIN)) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment