In case of a successful Foursquare checkin, my iPhone app shows adds a view on top of the view which is shown.
I want the view to be centered on the X and Y and for it to have a definite width and height using autolayout, but I'm not sure which constraints to add programmatically. I know how to do it in Storyboard, but I'm not sure what exactly to type in code to do the same as this view is added later in response to a successful action in the app.
I can't get it working properly and the UIView has a nib which it loads with loadNibNamed:.
SuccessView *successfulCheckInView = [[SuccessView alloc] initWithFrame:CGRectZero];
successfulCheckInView.placeNameLabel.text = properVenue.name;
successfulCheckInView.placeAddressLabel.text = properVenue.address;
successfulCheckInView.delegate = self;
[self.ownerVC.view addSubview:successfulCheckInView];
Try this:
Updated for Swift: