The subscription.isActive == true could be shortened to the more readable subscription.isActive. I don't know, however, if you have to explicitly add the operators in Swift.
Nice video. The issues with the implementation of the `isActive` function is a perfect use case for unit testing. Also it's worth noting that the .enabled section is never going to be met, since if the subscription isn't active, then the button won't be rendered due to the `if subscription.isActive` line.
Love your content but have a hard time watching due to sensitive eyes. Can you please record in Dark Mode going forward? Many people suffer from this problem. Thanks either way! Not to also ignore the fact that the contrast and colors show up so much better when using a dark theme.
Awesome content! Very informative and inspiring! Please keep publishing more of these videos! 💯
You can instead use something like:
extenstion Bool {
func not() -> Bool {
!self
}
}
Then it will be:
.disabled(subscription.isActive.not())
Thanks for very useful tip avoiding negative statements. Your channel is outstanding.
The subscription.isActive == true could be shortened to the more readable subscription.isActive. I don't know, however, if you have to explicitly add the operators in Swift.
Me too, I would prefer the shorter version
I find the shorter version more readable, too. I think it reads nearly like a sentence.
Nice video. The issues with the implementation of the `isActive` function is a perfect use case for unit testing. Also it's worth noting that the .enabled section is never going to be met, since if the subscription isn't active, then the button won't be rendered due to the `if subscription.isActive` line.
Love your content but have a hard time watching due to sensitive eyes. Can you please record in Dark Mode going forward? Many people suffer from this problem. Thanks either way! Not to also ignore the fact that the contrast and colors show up so much better when using a dark theme.