Domanda

Does anyone know if there is a notification I can listen to within a UIViewController to know if the tint colour is being desaturated currently due to an alert or popover being shown?

I know i can subclass the specific view and override the tintColorDidChange: method to make my changes, but in my design something like a notification is more desirable.

È stato utile?

Soluzione

What if you just subclassed UIWindow and did the following?

-(void)tintColorDidChange
{
    [[NSNotificationCenter defaultCenter] postNotificationName:@"tintColorDidChange" object:self];
}

As far as I am aware, there is no system notification for this and the above suggestion would only be suitable if you was listening out for app-wide tint colour changes.

If you wanted to be notified about changes to specific views then you would have to subclass them yourself manually.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top