reusable component
开发者_C百科I want to learn how to create reusable component so that I can use them anywhere. I want to create a ScrollView that i can use in any file (.m) by its object.any guidance ?
you can create an UIView Class , keep that one as global.
In that
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
// Initialization code.
}
//code for UISCrollview with frame.
return self;
}
now just call this class where you want to put a scrollview , this will work as globally, you need to call this call with it's object and what ever code you have written it will be implemented.
Hope this is what you were needed.
精彩评论