UITableViewCell: How to prevent blue selection background w/o borking isSelected property?

You must also override setHighlighted: to prevent the blue gradient from ever showing. If you just override setHighlighted: then you end up with a momentary selection effect. so you’ll have these two methods: – (void)setHighlighted: (BOOL)highlighted animated: (BOOL)animated { // don’t highlight } – (void)setSelected: (BOOL)selected animated: (BOOL)animated { // don’t select //[super setSelected:selected animated:animated]; …

Read more

Can font size of UILabel be changed with smooth animation on iPhone?

Set the font on the UILabel to be the size that you want when it is enlarged. Then scale it down. When you want the label to swell, scale it back up to it’s original size. messageLabel.font = [UIFont boldSystemFontOfSize:45]; messageLabel.transform = CGAffineTransformScale(messageLabel.transform, 0.25, 0.25); [self.view addSubview:messageLabel]; [UIView animateWithDuration:1.0 animations:^{ messageLabel.transform = CGAffineTransformScale(messageLabel.transform, 4, 4); …

Read more

How to go back one view in UINavigationController?

I don’t mean to be rude, but this is really well documented. A google search or even an Apple documentation search on UINavigationController will turn up exactly what you need. To programmatically pop the current view controller you use: [[self navigationController] popViewControllerAnimated:YES]; To pop to a specific view controller, you use: [[self navigationController] popToViewController:controller animated:YES]; …

Read more

How to reference UITableViewController from a UITableViewCell class?

I wouldn’t create this kind of dependency between the cell and the view controller – that makes the architecture more intricate and the cell not reusable. I suggest you to use the delegation pattern, which may sound a little complicated – although you’re already using (UITableViewDelegate is a typical example): create a protocol MyCellProtocol with …

Read more

Custom smaller Detents in UISheetPresentationController?

For iOS 16+ Swift – custom(identifier:resolver:) ObjC – customDetentWithIdentifier:resolver: For iOS 15 : Use +[UISheetPresentationControllerDetent _detentWithIdentifier:constant:]. It’s a private method. Sample Summary: UIKitCore`+[UISheetPresentationControllerDetent _detentWithIdentifier:constant:] Address: UIKitCore[0x00000001838d50fc] (UIKitCore.__TEXT.__text + 17876312)