Is it possible to change a UIView background color a particular selected area?
Change UIView Background Color.
If I understand correctly:
- you have a view with a background color
- you want to change this background color on a specific part ?
A simple way to do this is to insert a subview, of the given shape and size, at the bottom of the subviews hierarchy.
First create subView (areaView), add it to overallView, then send to back:
let rect = CGRect(x: 10, y: 10, width: 100, height: 100) // Whatever rect you want
let areaView = UIView(frame: rect)
overallView.addSubview(areaView)
overallView.sendSubviewToBack(areaView)
If you want a non rectangular shape, create it with a BezierPath.