Autolayout – Position by Percentage

Yes, you can position the dot as a fraction of the view’s width. The NSLayoutConstraint method, constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:, has that multiplier parameter that lets you use a fractional relationship between a superview and its subview. The superview’s right edge will be the width of that view (the screen if its a full width view), so if … Read more

When would a UIView’s bounds.origin not be (0, 0)?

View’s frame determines its location in superview. View’s bounds determines its subviews locations. That means, if you change view’s bounds, its location won’t be changed, but all of its subviews location will be changed. Positive width and height is like you draw a view from upper-left to bottom-right, while negative value is from bottom-right to … Read more

How to add particle effects to an iOS App that is not a game using iOS 7 SpriteKit Particle?

Create a SKScene in your UIView to add a SKEmitterNode particle effect. One way of doing this: 1.In storyboard (or programatically if you prefer) add a View object on top of the existing View and resize it to your needs. 2.Change the class of the new view to SKView 3.In your view controller .h file … Read more

How to add a toolbar to the bottom of a UITableViewController in Storyboards?

if you want show toolbar in one view controller which placed in some navigation controller. select view controller in storyboard in utilities, show “attribute inspector”. select “bottom bar” style. add bar button item add code in view controller, to show and hide toolbar: code: – (void)viewWillAppear:(BOOL)animated { [self.navigationController setToolbarHidden:NO animated:YES]; } – (void)viewWillDisappear:(BOOL)animated { [self.navigationController … Read more

Detect if certain UIView was touched amongst other UIViews

In order to check whether certain view inside another view was touched you can use hitTest. – (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event; In your custom implementation of touchesBegan check every touch in touches set. The point for hitTest method can be obtained using – (CGPoint)locationInView:(UIView *)view; method, where the view is your superView (the one that … Read more

Creating a shadow for a UIImageView that has rounded corners?

If you set clipsToBounds to true, this will round the corners but prevent the shadow from appearing. In order to resolve this, you can create two views. The container view should have the shadow, and its subview should have the rounded corners. The container view has clipsToBounds set to false, and has the shadow properties … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)