Don't know whether you need to know it in combination with other text or only detect the single shift tap, but here is my solution for detecting the former:
in my case this is only a single character within:
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)inText
this converts uppercase text to lowercase and sets the shiftPressed Value (ignored if the text is non letter text)
//Shift Detection
BOOL shiftPressed = NO;
//Detect non letter characters
NSCharacterSet *letterCharacterSet = [NSCharacterSet letterCharacterSet];
NSString *trimmedText = [text stringByTrimmingCharactersInSet:letterCharacterSet];
if ([text length] == 1) {
if (![trimmedText length])
{
NSString *upperCaseString = [text uppercaseString];
if ([upperCaseString isEqualToString:text]) {
NSString *lowerCaseString = [text lowercaseString];
text = lowerCaseString;
shiftPressed = YES;
}
}
}