Skip to content

Instantly share code, notes, and snippets.

@jameswomack
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameswomack/9280991 to your computer and use it in GitHub Desktop.
Save jameswomack/9280991 to your computer and use it in GitHub Desktop.
//
// NGViewController.h
// TextFieldChanges
//
// Created by James Womack on 2/28/14.
// Copyright (c) 2014 James Womack. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NGViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *correctableTextField;
@end
//
// NGViewController.m
// TextFieldChanges
//
// Created by James Womack on 2/28/14.
// Copyright (c) 2014 James Womack. All rights reserved.
//
#import "NGViewController.h"
@interface NGViewController ()
@end
@implementation NGViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(textDidChange:)
name:UITextFieldTextDidChangeNotification
object:self.correctableTextField];
}
- (void)textDidChange:(id)textInput
{
NSLog(@"%@", self.correctableTextField.text);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment