# heshammegid/hmsegmentedcontrol architecture

> Architecture diagram of the GitHub repository heshammegid/hmsegmentedcontrol, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/heshammegid/hmsegmentedcontrol
- Repository: https://github.com/heshammegid/hmsegmentedcontrol

## Overview

HMSegmentedControl is an iOS UI component that replaces UISegmentedControl. An app supplies segment titles and/or images, configures selection and display options, then embeds the control; user selection updates its selected index and emits a value-change event or invokes the optional index-change block. The README documents text and image segments, styling, sizing, and horizontal scrolling. The implementation file is present but its contents were not sampled, so internal rendering and event-dispatch links are not expanded.

Main entry points: [`HMSegmentedControl/HMSegmentedControl.m`](https://github.com/heshammegid/hmsegmentedcontrol/blob/master/HMSegmentedControl/HMSegmentedControl.m) (Segmented control), [`HMSegmentedControl/HMSegmentedControl.h`](https://github.com/heshammegid/hmsegmentedcontrol/blob/master/HMSegmentedControl/HMSegmentedControl.h) (Control API)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_app(("iOS app"))
node_api["Control API"]
node_control["Segmented control"]
node_user(("App user"))

node_app -->|"configures"| node_api
node_app -->|"creates"| node_control
node_user -->|"selects segment"| node_control
node_control -->|"emits value change"| node_app

click node_api "https://github.com/heshammegid/hmsegmentedcontrol/blob/master/HMSegmentedControl/HMSegmentedControl.h"
click node_control "https://github.com/heshammegid/hmsegmentedcontrol/blob/master/HMSegmentedControl/HMSegmentedControl.m"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app toneIndigo
class node_api toneMint
class node_control toneTeal
class node_user toneBlue
```

## Components

### Other components

- **iOS app**
- [Control API](https://github.com/heshammegid/hmsegmentedcontrol/blob/master/HMSegmentedControl/HMSegmentedControl.h): `HMSegmentedControl/HMSegmentedControl.h`
- [Segmented control](https://github.com/heshammegid/hmsegmentedcontrol/blob/master/HMSegmentedControl/HMSegmentedControl.m): `HMSegmentedControl/HMSegmentedControl.m`
- **App user**

## Connections

- iOS app → Control API: configures
- iOS app → Segmented control: creates
- App user → Segmented control: selects segment
- Segmented control → iOS app: emits value change
