Closed chanonly123 closed 7 years ago
@chanonly123 missing a call to super in layoutSubviews.
@chanonly123 Also your for loop is in a dangerous place. Layout subviews gets called multiple times. And because you are just breaking out of it. Your for loop has no value. You can achieve the same thing by simply doing
`let subview = subviews.first subview.layer.cornerRadius = cardCornerRadius
// Note maskToBounds is useless too `
@chanonly123 I think there is a better approach to what you are trying to do. Would you please explain your goal with this code?
Thanks for reply. My goal is to use the touch pulse effect with any UIView. (here with CardView).
The Card already inherits from the PulseView. So the pulse effect is already there. Just set the pulseAnimation
property. To set the pulse effect is not the best idea as it adds two layers to each view making it an expensive addition. This is why it is isolated to its own view type. Most major components inherit or implement the pulse effect in the optimal way.
Let's move this issue to Material GItter. As this is more of a conversation for there :)
@chanonly123 - Were you able to achieve this? Even I am trying something similar.
@IBDesignable class CardView: PulseView {
}