I have found the answer! The problem was that I want setting the frame of the border layer using the profileImageView frame, but because I am using autolayout that property is not set until after the view is displayed on screen.
I ended up doing:
/*! This function adds a border layer to the profile image view. */
- (void)addBorderLayerToProfileImageView {
CALayer *borderLayer = [CALayer layer];
CGRect borderFrame = CGRectMake(-1.0, -1.0, (PROFILE_IMAGE_DIAMETER+2.0), (PROFILE_IMAGE_DIAMETER+2.0));
[borderLayer setBackgroundColor:[[UIColor clearColor] CGColor]];
[borderLayer setFrame:borderFrame];
[borderLayer setCornerRadius:PROFILE_IMAGE_DIAMETER/2.0];
[borderLayer setBorderWidth:PROFILE_IMAGE_BORDER_WIDTH+1.0];
[borderLayer setBorderColor:[UIColor whiteColor].CGColor];
[self.profileImageView.layer addSublayer:borderLayer];
}
The reason I was adding a border layer at all is because the border on the layer leaves a small artifact between the edge of the image view and the border.