No, I would suggest a different approach. Write your init method to call super initWithFrame. That's the designated initializer for UIView. By calling it yourself, you assure that any OS setup that needs to take place gets invoked.
You can pass in CGRectZero as the frame if you need to, and then set the frame later.
Note that you should also plan to support initialization using initWithCoder. That's the method that gets called if you put your view into an XIB file or Storyboard.
What I do is to create a method doInitSetup, and put my custom initialization there. I then call that method from both initWithFrame and initWithCoder.
In your case, you could add properties for your custom settings, and if you put one of your views in an XIB/Storyboard, you could set those properties using user runtime attributes.
Using IB to design your forms is a good idea. I would counsel you to learn to use them. They make like easier and give you access to features that are all but impossible to use from code.
Your code might look like this:
- (id) initWithWord: (NSString *) theWord
{
self = [super initWithFrame: CGRectZero];
if (!self)
return nil;
[self doInitSetupWithWord: theWord];
return self;
}
- (void) doInitSetupWithWord: (NSString *) theWord
{
//Do whatever you need to do to set up your view.
}
- (id) initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder: aDecoder];
if (!self) {
return nil;
}
[self doInitSetupWithWord: nil];
return self;
}
- (void) setWord: (NSString *) theWord
{
_theWord = theWord;
//If possible, set things up for the new word
}