#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
self.backgroundColor=UIColorFromRGB(0x212221);
// Tell iOS this as a background task in case we get backgrounded
UIBackgroundTaskIdentifier taskId = [[UIApplication sharedApplication]
beginBackgroundTaskWithExpirationHandler:NULL];
//----------------------------------------------
// Perform your operations here
//----------------------------------------------
// Tell iOS that we are done with stuff that needed to keep going even if backgrounded
[[UIApplication sharedApplication] endBackgroundTask:taskId];
-(void)textFieldDidBeginEditing:(UITextField *)textField { //Keyboard becomes visible
//perform actions.
}
Also have to set delegate self
self.mField.delegate=self;
@interface YourViewController : ViewController<UITextFieldDelegate>