Hey Hi. First of all thank you so much for posting unique and interesting things. I have a quick question about the feature flag. Let's say I have class which has logics for a feature and I wanted it expose to only one target then how can we handle the feature flag. Example I have two apps sharing same code base where one needed Google maps and other doesn't. I know we can achieve it to #if Debug or Any User defined flags as you pointed it out in the video but is there any other better way to do it.
That's a good remark! The reason why I made it a var is because I wanted to be able to either inject a different configuration (for a test) or update it dynamically (either in a debug screen or by using a service like Firebase Remote Config). However, if you don't need any of these extra features, then a static could indeed do the job 👍
That's a good remark! The reason why I made it a var is because I wanted to be able to either inject a different configuration (for a test) or update it dynamically (either in a debug screen or by using a service like Firebase Remote Config). However, if you don't need any of these extra features, then a static could indeed do the job 👍
Did you find this explanation useful? Are you planning on using Feature Flags in your apps? Let me know in the comments 🚀
Very nice, thanks for the explanation. I am going to use this procedure with an enum to implement a paywall over several different cases!
Oh yes, that's a great use case!
Hey Hi. First of all thank you so much for posting unique and interesting things. I have a quick question about the feature flag. Let's say I have class which has logics for a feature and I wanted it expose to only one target then how can we handle the feature flag. Example I have two apps sharing same code base where one needed Google maps and other doesn't. I know we can achieve it to #if Debug or Any User defined flags as you pointed it out in the video but is there any other better way to do it.
I think in the last part you made a mistake, you should use static instead of var, because you are working with Value type.
That's a good remark! The reason why I made it a var is because I wanted to be able to either inject a different configuration (for a test) or update it dynamically (either in a debug screen or by using a service like Firebase Remote Config). However, if you don't need any of these extra features, then a static could indeed do the job 👍
Why just don't make static let isDetailViewEnabled static var? (by the way, FeatureFlags should be enum, not struct)
That's a good remark! The reason why I made it a var is because I wanted to be able to either inject a different configuration (for a test) or update it dynamically (either in a debug screen or by using a service like Firebase Remote Config). However, if you don't need any of these extra features, then a static could indeed do the job 👍