I was able to do it in this way,
Added a custom delegate in above library (SPUserResizableView.h
), - (void)userResizableViewIsResizing:(SPUserResizableView *)userResizableView {}
- (void)userResizableViewIsResizing:(SPUserResizableView *)userResizableView {
id contentView = userResizableView.contentView;
if([contentView isKindOfClass:[iOTextField class]]) {
iOTextField *textField = (iOTextField *)contentView;
if([self isResizingUpWithOriginalSize:textField.referenceiOProperties.originalSize currentSize:userResizableView.frame.size withiOTextField:textField]) {
[textField increaseFont];
} else {
[textField decreaseFont];
}
}
}
- (BOOL) isResizingUpWithOriginalSize:(CGSize)original currentSize:(CGSize)currentSize withiOTextField:(iOTextField *)textField {
CGFloat width = (currentSize.width - original.width);
CGFloat height = (currentSize.height - original.height);
if(width <= 0.0f && height <= 0.0f) {
textField.lastWidth = width;
textField.lastHeight = height;
return NO;
} else if(width > textField.lastWidth) {
if(textField.lastWidth <= 0.0f) {
textField.lastWidth = width;
textField.lastHeight = height;
return NO;
}
textField.lastWidth = width;
textField.lastHeight = height;
return YES;
} else if(height > textField.lastHeight) {
if(textField.lastHeight <= 0.0f) {
textField.lastWidth = width;
textField.lastHeight = height;
return NO;
}
textField.lastWidth = width;
textField.lastHeight = height;
return YES;
} else {
textField.lastWidth = width;
textField.lastHeight = height;
return NO;
}
}
Make a small change in this touch event in SPUserResizableView.m
class.
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
if(self.delegate && [self.delegate respondsToSelector:@selector(userResizableViewIsResizing:)]) {
[self.delegate userResizableViewIsResizing:self];
}
}