ios - Subclassing UIView and adding a property -
I've tried UIView subclassing. Because I want an enum in my UIView so I can check whether UIView has to tap into my game twice. But I do not have much experience with subclassing and it is not working
- Make subclasses
- Build assets within a custom subclass
- Change sub-squares from UIView in the storyboard
- Change all UIView announcements from my game class in the subclassic declaration
Code:
#import & lt; UIKit / UIKit.h & gt; Type-FED NSNUm (NSITF, VISU SATAT) {ENNYMALAPEP, EUNDUBEBELTAP}; @ Interface bannerview: UIView @property (nonatomic, assign) viewStaat staatVanDeView; @end
and declare a property in the INIT from the UIVVI.
@setuphesize staatVanDeView; - (id) initWithFrame: (CGRect) frame {self = [super initWithFrame: frame]; If (self) {staatVanDeView = ENUMDubbelTap; NSLog (@ "Set"); } Healthy return; }
The log is not being called, so I do not know what is wrong. The integer 0 stays at all times from staatVanDeView
.
method -weitframe:
from the storyboard not called when installing a scene Will go Use the -initWithCoder:
instead:
- (id) initWithCoder: (NSCoder *) aDecoder {self = [super initWithCoder: aDecoder]; If (self) {staatVanDeView = ENUMDubbelTap; } Healthy return; }
and you will not need a line
@ synthesis Statvenview;
Because the properties for gates and the sets are automatically created in recent iOS versions.
Comments
Post a Comment