Extending with your own categories
Creating your own categories is simple.
- Ensure that the category has a distinct name to distinguish it from any others, in this example we'll call it:
`KGJavascriptBridge+playFromMediaLibrary.h`
- Declare and implement a method that uses the category name for it's name and that received an NSDictionary and a KGPagedDocControl object:
`- (void)playFromMediaLibrary:(NSDictionary *)parameters andPageControl:(KGPagedDocControl *)pageControl;`
- If you need to store the page control or any of the parameters into properties for use in other methods in the category, then you will need to use associated objects from the runtime.
There is a good reference here and the provided cameraCapture category uses them so reference that code for a working example.
Comments
0 comments
Please sign in to leave a comment.