Re: CGContext always creating a black rect.
On 24 Jul 2021, at 12:56 pm, Alex Zavatone via groups.io <zav@...> wrote:I initially felt that way too, several years ago, when first coming from Obj-C. However, I learned to embrace the tools (which make it easy to find the declaration) and also be mindful of writing clear and well-organized code to keep the mental burden of symbol bookkeeping to a minimum.
Moreover, following conventional style (which, in Swift, eschews the redundant `self.`) makes it easier to work with other developers.
Seems like your `configure(…)` method is the ideal place for those calculations.- That same function seems like it ought to be pure; i.e., have no side effects -- just draw a rect based on its argument. However, it does math and sets instance variables. If it needs to affect and act on persistent state, it ought to be refactored.Refactored how? [...]
In Swift, I HATE how they have done method parameters, so I’m opting for redundant redundancy over terseness or brevity.I'm not sure what you're referring to about "how they have done method parameters".