Here is the objective-c code:
UIBezierPath *maskPath;
maskPath = [UIBezierPath bezierPathWithRoundedRect:_backgroundImageView.bounds byRoundingCorners:(UIRectCornerBottomLeft | UIRectCornerBottomRight) cornerRadii:CGSizeMake(3.0, 3.0)];
What I would like to do is, I would like to parse 4 booleans, and modify the byRoundingCorners
. But the problem is that, for example, I have isRectCornerBottomLeft
is YES
, and rest of them is NO
, I will do something like this:
maskPath = [UIBezierPath bezierPathWithRoundedRect:_backgroundImageView.bounds byRoundingCorners:(UIRectCornerBottomLeft) cornerRadii:CGSizeMake(3.0, 3.0)];
But how can I control the UIRectCorner
? of course, I can do many if else to check whether the isRectCornerBottomLeft
is YES
, and which one is NO
to write every conditions out. But apart from that, how can I simplify that logic? Thanks.