-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to set a custom view class. #82
base: master
Are you sure you want to change the base?
Conversation
In preparation for allowing custom notification views.
Use this to tighten up the validation for the notification view class option.
The reason that I made the If this is too much exposure, I could make client code keep track of this stuff itself, but the defaults would have to be duplicated since they currently aren't available from the outside. |
Hmmm, I really wanna add this feature, but I was thinking more an opt in and bring your own view kinda thing or use the built in stuff. Kinda like |
@@ -908,7 +870,7 @@ - (void)setOptions:(NSDictionary *)options { | |||
key, | |||
obj); | |||
[cleanOptions removeObjectForKey:key]; | |||
} else if (![obj isKindOfClass:NSClassFromString(kCRToastKeyClassMap[key])]) { | |||
} else if (![[obj class] isSubclassOfClass:NSClassFromString(kCRToastKeyClassMap[key])]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has the same behavior as isKindOfClass
for instances, but will also work as expected on Class
objects.
Guys, when you plan to marge this useful stuff? |
Since @cruffenach has weighed in I don't want to jump the gun. It's up to him - once he has the time. 👍 from me. |
Any plans to merge this CR? I need exactly this in my project and may have to fork the repo if not provided. |
This changeset enables the creation of custom layouts for notifications. I had to make a few things public that weren't before, namely the option defaults system and some parts of
CRToastView
, but hopefully the extra functionality is worth it.