Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/D-32/SegmentedProgressBar
Snapchat / Instagram Stories like progress indicator
https://github.com/D-32/SegmentedProgressBar
cocoa instagram ios snapchat swift swift3
Last synced: 7 days ago
JSON representation
Snapchat / Instagram Stories like progress indicator
- Host: GitHub
- URL: https://github.com/D-32/SegmentedProgressBar
- Owner: D-32
- License: mit
- Created: 2017-03-04T17:01:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-02T15:49:03.000Z (over 5 years ago)
- Last Synced: 2024-11-24T01:41:36.525Z (18 days ago)
- Topics: cocoa, instagram, ios, snapchat, swift, swift3
- Language: Swift
- Homepage:
- Size: 8.81 MB
- Stars: 470
- Watchers: 9
- Forks: 56
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios-star - SegmentedProgressBar - Snapchat / Instagram Stories style animated indicator. (UI / Font)
- awesome-ios - SegmentedProgressBar - Snapchat / Instagram Stories style animated indicator. (UI / Font)
- awesome - SegmentedProgressBar - Snapchat / Instagram Stories like progress indicator. (OOM-Leaks-Crash / WebView-ProgressBar)
README
[![Swift Version][swift-image]][swift-url]
[![twitter: @dylan36032](http://img.shields.io/badge/twitter-%40dylan36032-blue.svg?style=flat)](https://twitter.com/dylan36032)# SegmentedProgressBar
A simple little control that animates segments like Snapchat or Instagram Stories.![Screenshot](screenshot.png)
## Requirements
- iOS 8.0+
- Xcode 8## Installation
Drag and drop [`SegmentedProgressBar.swift`](https://raw.githubusercontent.com/D-32/SegmentedProgressBar/master/SegmentedProgressBar/SegmentedProgressBar.swift) into your project. That's it.
## Usage
```swift
let spb = SegmentedProgressBar(numberOfSegments: 3, duration: 5)
spb.frame = CGRect(x: 15, y: 15, width: view.frame.width - 30, height: 4)
view.addSubview(spb)spb.startAnimation()
```## Additional Stuff
Delegate:```swift
spb.delegate = self // has to conform to SegmentedProgressBarDelegatefunc segmentedProgressBarChangedIndex(index: Int) {
}func segmentedProgressBarFinished() {
}
```Styling:
```swift
spb.topColor = UIColor.white
spb.bottomColor = UIColor.white.withAlphaComponent(0.25)
spb.padding = 2
```Pausing / Resuming
```swift
spb.isPaused = true
spb.isPaused = false
```Skip / Rewind
```swift
spb.skip()
spb.rewind()
```[swift-image]:https://img.shields.io/badge/swift-3.0-orange.svg
[swift-url]: https://swift.org/