【发布时间】:2014-09-04 18:19:30
【问题描述】:
如何让我的 UISwitch 调用此函数:https://ghostbin.com/paste/y2xrc 开启时,返回 FALSE;当它关闭时。 (我用theos编译)
(我在 Messages.app (MobileSMS.app) 的“CKTranscriptCollectionViewController”中显示了开关,现在我希望它在打开或关闭时执行某些操作,这就是我在上面的链接中发布的内容)。
#import <UIKit/UIKit.h>
#import <ChatKit/ChatKit.h>
#import <ChatKit/CKConversation.h>
@interface CKTranscriptCollectionViewController : UIViewController
@property (nonatomic, strong) UISwitch *mySwitch;
- (void)loadView;
@end
%hook CKTranscriptCollectionViewController
- (void)viewDidLoad {
%orig;
UISwitch *mySwitch = [[UISwitch alloc] initWithFrame:CGRectMake(10, 10, 51, 31)];
[mySwitch setOn:NO animated:YES];
[self.view addSubview:mySwitch];
}
%end
【问题讨论】:
标签: ios objective-c iphone theos