There is an ios library called HGKOptionPane by Jon Arrien. It is a show/hide dropdown panel. While I was implementing it to my demo app, I noticed this UIView frame linked with the UIButton.
I’m sure it has something to do with the code below, I didn’t understand the code and I would appreciate if you could explain it. Most importantly, how is the UIButton linked with the UIView or Option Panel it self.
The 2 methods inside HGKOptionPanel.m :
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
- (void)drawRect:(CGRect)rect{
[super drawRect:rect];
isExpanded = YES;
}
Photo:

Option Panel is the UIView with black Background color.
The UIButton is an IBOutlet which is not linked by code.
It is actually all saved in the xib file here:
https://raw.github.com/Hegaka/HGKOptionPanel/master/HGKOptionPanel/HGKOptionPanel/en.lproj/MainWindow.xib