I have a custom UIView
and xib called DialPad
and I'm trying to use this object in my storyboard, but the custom DialPad isn't being add as a subview with the buttons
my custom DialPad :UIView
@implementation DialPad
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
self.backgroundColor = [UIColor clearColor];
}
return self;
}
and my view controllers look like this
#import <UIKit/UIKit.h>
#import "DialPad.h"
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIView *dial;
@end
#import "ViewController.h"
@interface ViewController ()
{
DialPad *d;
}
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
d = [[DialPad alloc] initWithFrame:self.dial.frame];
[self.dial addSubview:d];
}
@end
but the border around the view looks strange
#import "DialPad.h"
#import <QuartzCore/QuartzCore.h>
@implementation DialPad
- (void)drawRect:(CGRect)rect
{
// Drawing code
self.layer.borderColor = [UIColor redColor].CGColor;
self.layer.borderWidth = 1;
}
@end