I have an object that is very similar to this one. I call it MBlob for MediaBlob. He knows how to do all kinds of things, for example, how to divide it into 2, combine with another MBlob (resize accordingly based on the form), etc. He also knows how to appear in the WebView (loading the URL), receive (for example, rotation, gestures), etc. A very convenient class for creating small applications, and I assume that many developers have something similar. A similar class is used in applications for application applications, QCount (free) and QPlus.
One way to structure, such as an object, is a child of NSObject, and then connect to some protocols for the inline elements that you want to use. For example, my interface looks like this:
@interface MBlob : NSObject <UIWebViewDelegate, UIPopoverControllerDelegate> { id _delegate; }
All properties are implemented as @synthesize varName = _varName in the .m file.
Then you can connect all kinds of views from this element. This may be redundant, but my MBlob even knows how to start the settings editor to edit its own settings without worrying about VC ownership. Here is food for thought:
@property (nonatomic, strong) UIView* preview; @property (nonatomic, strong) UIView* displayView; @property (nonatomic, strong) UIWebView* webView; @property (nonatomic, strong) UIToolbar* toolbar; @property (nonatomic, strong) UIActivityIndicatorView* activityIndicator; @property (nonatomic, strong) NSTimer* timer; @property (nonatomic, strong) NSString* mediaType; @property (nonatomic, strong) NSString* mediaValue; @property (nonatomic) CGFloat aspectRatio;
My caveat is that Apple made a lot of things easy thanks to the built-in classes, so don't overdo it. For example, in my code above, do I really need a font? I do not know, this is not active code for me, but this is an example of the type of object you are describing. If you add more functionality, go with the umbrella subclass of NSObject and create any other class that you want to use.
Good luck
Damien