I have a UIButton like so:

```
UIButton *inviteButton = [UIButton buttonWithType:UIButtonTypeSystem];
[inviteButton setTitle:@"Invite" forState:UIControlStateNormal];
[inviteButton.titleLabel setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:(14.0)]];
[inviteButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];

```

How do I get its height and width so that I canset its frame?

If I do:

```
float width = inviteButton.frame.size.width;

```

then width is always zero.

I want the button to be right aligned in a view I have created.