TOSegmentedControl is an iOS UI library that reimplements the modern UISegmentedControl appearance from iOS 13+ for backward compatibility with older iOS versions (back to iOS 9). The library consists of a main control class (TOSegmentedControl) that manages the overall appearance and behavior, and a segment class (TOSegmentedControlSegment) that represents individual items. It supports both text and image segments, dynamic addition/removal of items, configurable appearance (colors, fonts, corner radius), and special features like 'reversible' segments that toggle direction when tapped. The implementation includes sophisticated touch handling with spring-based animations, custom layout management, and proper adaptation to system appearance changes (dark/light mode).