ユーザーが画面をクリックすると、ユーザーが触れた場所に円が描画されます。私のコードの何が問題なのですか?
{
BOOL _touchHasBegun;
CGPoint whereUserClicked;
float pointWhereUserClickedX;
float pointWhereUserClickedY;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
_touchHasBegun = YES;
}
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetRGBStrokeColor(context, 0, 0, 225, 1);
CGContextSetRGBFillColor(context, 0, 0, 255, 1);
CGRect rectangle = CGRectMake(pointWhereUserClickedX, pointWhereUserClickedY, 10, 10);
CGContextStrokeEllipseInRect(context, rectangle);
}