Closed Dafenng closed 9 years ago
I see the demo code on this page:http://componentkit.org/docs/components-cant-be-delegates.html
@interface AlertDisplayComponentController : CKComponentController <UIAlertViewDelegate> @end @implementation AlertDisplayComponentController { UIAlertView *_alertView; } - (void)didTapDisplayAlert { _alertView = [[UIAlertView alloc] initWithTitle:@"Are you sure?" message:nil delegate:self ...]; [_alertView show]; } - (void)alertView:(UIAlertView *)alert didDismissWithButtonIndex:(NSInteger)buttonIndex { [self.component updateState:...]; } @end
But CKComponent actually not expose the updateState method, how can ComponentController use it?
By the way, this is not the only case, I also found cases where I should use the not exposed method like this: https://github.com/facebook/componentkit/issues/213
Just import the CKComponentSubclass.h header.
CKComponentSubclass.h
I see the demo code on this page:http://componentkit.org/docs/components-cant-be-delegates.html
But CKComponent actually not expose the updateState method, how can ComponentController use it?
By the way, this is not the only case, I also found cases where I should use the not exposed method like this: https://github.com/facebook/componentkit/issues/213