Tag Archives: UIView

Set border around the view

There is no border property in UIView…. classes but we can access CALayer class to set border. Since layer property is defined in the UIView class, all of UIView inherited class can use this property to set border. It needs to have #import <QuartzCore/QuartzCore.h> to access CALayer.

view.layer.borderWidth = 1;
view.layer.borderColor = [[UIColor grayColor] CGColor];
Leave a comment Continue Reading →

Applying animation while resizing or moving the view

Animation can be applied while its frame, bounds, center, transform, alpha… is being changed. ┬áThe key is set start and end values between beginAnimations and commitAnimations, so called animation block.

Leave a comment Continue Reading →