I am trying to make a tweak in Xcode with IOSOpenDev, but i met an error which is Use of undeclared identifier "UIColor"
!
I used the same code from my iPhone yet it works, why doesn't it work here? (I want to use IOSOpenDev since it looks much better then using theos)
This is the code
%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 = [UIColor blueColor];
%orig(color); }
else {
%orig; }
}
%end
Please help me here
You should check if you have
PROJECTNAME_FRAMEWORKS = UIKit Foundation
Also
#import <UIKit/UIKit.h>
In your tweak.xm (On the top) like this
#import <UIKit/UIKit.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 = [UIColor blueColor];
%orig(color); }
else {
%orig; }
}
%end