Importing does not work

2019-08-09 01:08发布

I am making a cydia tweak on Xcode using IOSOpenDev and i tried to import <AppKit/AppKit.h> but i'm getting this error!
'AppKit/AppKit.h' file not found'
This is my code which changes the flash color when someone tries to take a screenshot

#include <AppKit/AppKit.h>

%hook SBScreenFlash

-(void)flashColor:(id)color {

NSDictionary *prefs=[[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.junyi00.screenshotcolor.plist"];

if ([[prefs objectForKey:@"enable"] boolValue]){
    color = [NSColor blueColor];
    %orig(color); }
else {
    %orig; }
}

%end

I looked into opt/IOSOpenDev/include and opt/theos/include and was unable to find AppKit.h
How do i fix this problem? Please help

1条回答
smile是对你的礼貌
2楼-- · 2019-08-09 01:43

AppKit is for Mac; for iOS you want UIKit:

#import <UIKit/UIKit.h>
查看更多
登录 后发表回答