binchik/SubscriptionPrompt

dispatch_async only on some properties?

AndrewSB opened this issue · 1 comments

Hey!

Awesome library, thanks for all your work!

I was looking through your class and I noticed an inconsistency - I'm sure you had your reasons for writing SubscriptionViewController, and I'd love to understand.

For some of the properties (dimColor, dimView, restoreButtonTitle), you wrap the property observer in a dispatch_async(mainThread) {}, whereas for others (titleFont, titleColor) you don't.

Can you help me understand why?

Hello, thank you for your question. Property observers without the mainThread (titleFont, titleColor) set SubscriveView's properties. Those properties's didSets are wrapped in dispatch_async(mainThread). Only those chunks of code, that operate on UI, are wrapped in dispatch_async(mainThread).