Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 1.19 KB

README.md

File metadata and controls

32 lines (24 loc) · 1.19 KB

FloatingSegmentedControl

Provide segment control like iOS13 photo app

This library makes this repository easy to use 👀

[FloatingSwitch]https://github.com/usagimaru/FloatingSwitch

light dark

Installation 🚀

Carthage

github "catelina777/FloatingSegmentedControl"

Usage

  1. Install a custom view on Interface Builder.
  2. Important: Assign the custom view class as FloatingSegmentedControl like this.
  3. Set an appropriate layouts. In the default implementation of FloatingSegment, the width follows the intrinsic size.
  4. Set segments with setSegments (with:) method.
  5. Set target and action with addTarget method. Then you can catch control events when users switch segments.

See ViewController.swift for usage.