I was just wondering how does setStroke know to set the stroke for context when context isn't mentioned at all in the setStroke method?
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 10);
[[UIColor colorWithRed:0.6 green:0.6 blue:0.6 alpha:1.0] setStroke];
Btw how often do you programmatically draw your own objects?
This is the implementation of setStroke for your color:
- (void)setStroke {
CGContextSetStrokeColorWithColor(UIGraphicsGetCurrentContext(), self.CGColor);
}
It uses the same function to get the context that you're using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With