Open brototyp opened 8 years ago
The proposal:
We configure the TBODeveloperOverlayKVDebugger with an array of TBODeveloperOverlayKVDebuggerItem.
@interface TBODeveloperOverlayKVDebuggerItem : NSObject
- (instancetype)initWithType:(id)type detailViewControllerClass:(Class)detailViewControllerClass andEditingBlock:(void (^)(id))editingBlock;
@end
On row select in TBODeveloperOverlayKVDebugger we initialize a DetailViewController conforming to the following protocol.
@protocol
- (instancetype)initWithValue:(id)value andEditingBlock:(void (^)(id))editingBlock;
@end
We check for the type at the selected indexPath and initialize a DetailViewController for the specified type.
All DetailViewControllers are inheritating from a TBODeveloperOverlayKVDebuggerBaseDetailViewController. This ViewControllers is responsible for sharing certain items via UIActivityViewController, for that matter all Subclasses need to implement
- (NSArray *)sharableItems;
to return the desired items.
When editing the values in the DetailViewControllers their editingBlock gets called with the updated values on which TBODeveloperOverlayKVDebugger can update it's Datasource.
@brototyp @thorstenstark What are your ideas to the proposal?
I think it would be great to have a way to set custom ViewController for custom classes in the KVDebugger. This way, one could add custom (possibly complex) objects to it and be able to not only see the
-description
of it but inspect and edit in a way specific to this class.This could work by add a mapping between the Class names of the Objects and Class names of the responsible ViewController