You could do this with colored views and UIView
animation.
Set up a view with a background color that will fill the screen. Set this view's background color to "the other color". Let's call this the "fill view". Pin it to the left side of your content view, and give it a right edge constraint that's also pinned to the left edge of the content view. Add an outlet to the left edge constraint. Let's call that constraint outlet "rightEdgeConstraint.
Create a line view (call it the "line view") with a fixed width constraint and a different background color. Add a left edge constraint to the line view attaching it to the right edge of the fill view.
Now in your code, animate the right edge constraint:
UIView.animateWithDuration(1.0) {
//Make the fill view as wide as the content view.
rightEdgeConstraint.constant = view.width
view.layoutIfNeeded()
}
If you want the user to be able to drag the line left to right then you'd need to attach a pan gesture recognizer to the line view and use the change in X position to change the value of the rightEdgeConstraint.constant
(and then call layoutIfNeeded()
as above.)