@RyanQinqhw wrote:
> Making all for tweak cntv_hook…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (arm64)…
Tweak.xm:3:9: fatal error: ‘UIViewController.h’ file not found
#import “UIViewController.h”
^
1 error generated.
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>#import “HomeViewController.h”
%hook HomeViewController
(void)viewDidAppear:(BOOL)animated{
%orig;
//[super viewDidAppear:animated];
UIAlertController *alertVC=[UIAlertController alertControllerWithTitle:@"" message:@“测试” preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *acttion1=[UIAlertAction actionWithTitle:@“取消” style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {}]; [alertVC addAction:acttion1]; [self presentViewController:alertVC animated:YES completion:nil];
}
%end
Posts: 1
Participants: 1