Using The Same Shape For a Button's Mask and Outline
Daily Coding Tip 064

By using the some Shape opaque return type, we can return shapes that can be used for multiple purposes. The same code would not work if it was some View, as views themselves cannot be used as masks. Although what we’re doing here has a similar effect to setting cornerRadius to 10, the masking shape can be any custom s…
Keep reading with a 7-day free trial
Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

