A replication of a segmented control in the iOS 13 Photos.app.
Demo.mp4
FloatingSwitchView.swiftFloatingSwitchView.xibFloatingSwitchSegment.swiftFloatingSwitchSegment.xib
- Install a custom view on Interface Builder.
- Assign the custom view class as
FloatingSwitchView. - Set an appropriate layouts. In the default implementation of FloatingSwitch, the width follows the intrinsic size.
- Set segments with
setSegments(with:)method. - Set
targetandaction. Then you can catch control events when users switch segments.
See SampleViewController.swift for usage.
See LICENSE for details.

