我正在尝试获取 SLComposeViewController 的 UITextView,我该如何获取呢?我尝试了以下方法,但它不起作用:
[viewController presentViewController:facebookController
animated:YES
completion:^{
for (UIView *viewLayer1 in facebookController.view.subviews) {
for (UIView *viewLayer2 in viewLayer1.subviews) {
if ([viewLayer2 isKindOfClass:[UIView class]]) {
for (UIView *viewLayer3 in viewLayer2.subviews) {
if ([viewLayer3 isKindOfClass:[UITextView class]]) {
[(UITextView *)viewLayer3 setDelegate:self];
}
}
}
}
} }];
仅供参考,上面的代码如果是SLServiceTypeTwitter
,则可以正常工作,但如果是,则无法正常工作 SLServiceTypeFacebook