Created
October 26, 2015 18:34
-
-
Save PaulTaykalo/bfe7e1778cc55cb730c1 to your computer and use it in GitHub Desktop.
UpdateOnClassInjection for liver reload Componens from Componentkit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation CKComponent (Injection) | |
- (void)updateOnClassInjection { | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
// Search for the first component hostig view | |
id comp = self; | |
while (comp) { | |
comp = [comp nextResponder]; | |
if ([comp isKindOfClass:[CKComponentHostingView class]]) { | |
break; | |
} | |
} | |
// Emulate full update | |
[(id <CKComponentStateListener>)comp componentScopeHandleWithIdentifier:0 rootIdentifier:0 didReceiveStateUpdate:nil mode:CKUpdateModeAsynchronous]; | |
}); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment