I wanted to make a ViewController that had some text editing functionality I wanted through out my application. So, I did this.
#import <UIKit/UIKit.h>
@interface superViewController : UIViewController
<UITextFieldDelegate>{
//these are instance variables, remember them?
CGFloat animatedDistance;
}
@end
Then, I added the implementation (not shown in these stubs)
#import "superViewController.h"
@implementation superViewController
static const CGFloat KEYBOARD_ANIMATION_DURATION = 0.3;
static const CGFloat MINIMUM_SCROLL_FRACTION = 0.2;
static const CGFloat MAXIMUM_SCROLL_FRACTION = 0.8;
static const CGFloat PORTRAIT_KEYBOARD_HEIGHT = 216;
static const CGFloat LANDSCAPE_KEYBOARD_HEIGHT = 162;
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
//code commented out for shortness. This work by itself. }
- (void)textFieldDidEndEditing:(UITextField *)textField
{
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
}
Then, I wanted to try it out. So I made a subclass of it as shown here.
@interface salesViewController : superViewController {
I was expecting the text editing capabilities of superViewController to be in salesViewController, but they are not. I am not sure why or to fix.
Thanks in advance.