Yes you can.I am using one class in existing class . One is extending UIView
and other is extending NSObject
.
MultiLayout.h
@interface MultiLayout : UIView
{
// methods and properties
}
@end
@interface SingleControl : NSObject
{
// methods and properties
}
@end
MultiLayout.m
@implementation SingleControl
//methods and variables declaration and property synthesization
@end
@implementation MultiLayout
//methods and variables declaration and property synthesization
@end
For getting the static value of SingleControl in MultiLayout . you have to call class method like:
MultiLayout.h
@interface MultiLayout : UIView
{
// methods and properties
}
@end
@interface SingleControl : NSObject
{
// methods and properties
}
// add class method
+(int)getValue;
@end
MultiLayout.m
@implementation SingleControl
// add static value
static int values = 100;
// implement method
+(int)getValue{
return values;
}
@end
@implementation MultiLayout
// call method to get value
[SingleChoiceControl getValue];
@end