Posts

Showing posts with the label UITableView

Add shadow to text in UITextView

Image
    NSShadow * shadow = [[NSShadow alloc] init];     shadow.shadowColor = [UIColor blackColor];     shadow.shadowOffset = CGSizeMake(1, 2);        NSDictionary * textAttributes =  @{                                        NSForegroundColorAttributeName : [UIColor blueColor],                                        NSShadowAttributeName          : shadow,                       ...

Scroll UITextField above Keyboard in a UITableView OR UIScrollView in Swift and Objective C

In Objective C -(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {     CGPoint pointInTable = [textField.superview convertPoint:textField.frame.origin toView:_tableview];     CGPoint contentOffset = _tableview.contentOffset;         contentOffset.y = (pointInTable.y - textField.inputAccessoryView.frame.size.height);         NSLog(@"contentOffset is: %@", NSStringFromCGPoint(contentOffset));        [_tableview setContentOffset:contentOffset animated:YES];        return YES; } -(BOOL)textFieldShouldEndEditing:(UITextField *)textField {     [textField resignFirstResponder];        if ([textField.superview.superview isKindOfClass:[UITableViewCell class]])     {         CGPoint buttonPosition = [textField convertPoint:CGPointZero  ...