I'm writing a tweak to edit the statusbar clock strings. I'm struggling to find a way to call the native settings if the tweak is 'disabled'. I thought that calling %orig would work. But it only works after a respring, I want to avoid a respring if possible! here's the applicable code:
%hook SBStatusBarStateAggregator
-(void)_resetTimeItemFormatter {
%orig;
// Hook _timeItemDateFormatter iVar
NSDateFormatter *newDateFormat = MSHookIvar<NSDateFormatter *>(self, "_timeItemDateFormatter");
// set new clock format if ST is enabled
if(STTime && STIsEnabled)
{
[newDateFormat setDateFormat:STTime];
} else {
// USE THE DEFAULT FORMAT
}
}
%end
I'm aware that this is probably not the correct usage of case for %orig. So for my 'else' what shall I use? I don't know what the 'default' format is going to be!
Any help appreciated.
LM