{"id":32320188,"url":"https://github.com/leningradspb/instaprogressview","last_synced_at":"2025-10-23T11:52:42.480Z","repository":{"id":56915535,"uuid":"314072282","full_name":"leningradspb/InstaProgressView","owner":"leningradspb","description":null,"archived":false,"fork":false,"pushed_at":"2020-11-19T18:57:08.000Z","size":29,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T11:52:15.406Z","etag":null,"topics":["instagram","instagram-stories","sberbank","snapchat","snapchat-stories","stories","swfit","tinkoff","vk"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leningradspb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-18T22:20:33.000Z","updated_at":"2024-12-23T13:36:49.000Z","dependencies_parsed_at":"2022-08-20T21:20:20.587Z","dependency_job_id":null,"html_url":"https://github.com/leningradspb/InstaProgressView","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/leningradspb/InstaProgressView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leningradspb%2FInstaProgressView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leningradspb%2FInstaProgressView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leningradspb%2FInstaProgressView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leningradspb%2FInstaProgressView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leningradspb","download_url":"https://codeload.github.com/leningradspb/InstaProgressView/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leningradspb%2FInstaProgressView/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280614533,"owners_count":26360841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["instagram","instagram-stories","sberbank","snapchat","snapchat-stories","stories","swfit","tinkoff","vk"],"created_at":"2025-10-23T11:52:39.993Z","updated_at":"2025-10-23T11:52:42.475Z","avatar_url":"https://github.com/leningradspb.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InstaProgressView\nIt's awesome and useful control looks like Snapchat, Instagram or other apps that have progress views (loading white strips).\n\nDown below you can read details about implementation and see screenshot of example project🧐\n\n![Image of animation](https://scontent.fhel3-1.fna.fbcdn.net/v/t1.0-9/126138214_3612263292163676_4787320952628979909_o.jpg?_nc_cat=109\u0026ccb=2\u0026_nc_sid=730e14\u0026_nc_ohc=wiAmBuKIzq8AX_dgrv5\u0026_nc_ht=scontent.fhel3-1.fna\u0026oh=4ad2ad2a196d57d8130b185736f71915\u0026oe=5FDA0F5B)\n\n\n## How to use this cool boy? Pretty simple! 🥳\nFirst of all add new pod in your podfile. Dont't forget do pod install or pod update 😏\n```swift\npod 'InstaProgressView'\n```\n\nAnd then just import framework in controller.\n```swift\nimport InstaProgressView\n```\nUnfortunately is't not end. You should add some code 🤓\n\nIn your ViewController just initialize InstaProgressView. You need something like that.\n\n```swift\nlet progressView = InstaProgressView(progressTintColor: .white, trackTintColor: UIColor.white.withAlphaComponent(0.5), segmentsCount: 5, spaceBetweenSegments: 8, duration: 10)\n```\nprogressTintColor - top color, trackTintColor - bottom color of progress view, segmentsCount - it's segmentsCount 😄, spaceBetweenSegments - it's spaceBetweenSegments 😄, and duration - it's time \nfor loading one progress view in control.\n\nWhen progress view will be added on view just call\n\n```swift\nprogressView.startAnimation()\n```\nReally often you need pause animation when user hold finger on screen and continue animation when finger put off.\n```swift\nprogressView.pauseAnimation()\nprogressView.continueAnimation()\n```\nBy the way you can need show next info (for example image or video like in Instagram) on screen by left swipe or previous for right swipe. \n```swift\nprogressView.skip()\nprogressView.back()\n```\nOf course don't forget about delegate to handle next, skip, back or end of all loadings.\n```swift\nprogressView.delegate = self\n```\nYou can use extension for required delegate methods.\n```swift\nextension ViewController: InstaProgressViewDelegate {\n    func instaProgressViewChangedIndex(index: Int) {\n        // here you can show new image or video in controller\n        // something like that\n        //imageView.image = UIImage(named: imageNames[index])\n    }\n\n    func instaProgressViewFinished() {\n        print(\"Finished\")\n        // Here you can hadle end loading of last element in control\n    }\n}\n```\nThat's all! Enjoy useful control.\n\n## If you still nothing understand this example special for you 🤪\n```swift\n//\n//  ViewController.swift\n//  Created by Eduard Sinyakov on 11/19/20.\n//\n\nimport UIKit\nimport InstaProgressView\n\nclass ViewController: UIViewController {\n    let imageView: UIImageView = {\n        let imageView = UIImageView()\n        imageView.contentMode = .scaleAspectFill\n        return imageView\n    }()\n    // image can gets from back-end or dont forget add images in Assets.xcassets\n    // and just add image names in array\n    let imageNames = [\"0\", \"1\", \"2\", \"3\", \"4\"]\n\n    let progressView = InstaProgressView(progressTintColor: .white, trackTintColor: UIColor.white.withAlphaComponent(0.5), segmentsCount: 5, spaceBetweenSegments: 8, duration: 10)\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        setupGesturesRecognizers()\n        setupImageView()\n\n    }\n\n    override func viewDidAppear(_ animated: Bool) {\n        super.viewDidAppear(animated)\n        progressViewSetup()\n    }\n\n    private func setupImageView() {\n        view.addSubview(imageView)\n        imageView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 0).isActive = true\n        imageView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 0).isActive = true\n        imageView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: 0).isActive = true\n        imageView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: 0).isActive = true\n        imageView.translatesAutoresizingMaskIntoConstraints = false\n    }\n\n    private func progressViewSetup() {\n        view.backgroundColor = .black\n        imageView.addSubview(progressView)\n        progressView.delegate = self\n        progressView.topAnchor.constraint(equalTo: imageView.safeAreaLayoutGuide.topAnchor, constant: 20).isActive = true\n        progressView.leadingAnchor.constraint(equalTo: imageView.safeAreaLayoutGuide.leadingAnchor, constant: 10).isActive = true\n        progressView.trailingAnchor.constraint(equalTo: imageView.safeAreaLayoutGuide.trailingAnchor, constant: -10).isActive = true\n        progressView.heightAnchor.constraint(equalToConstant: 6).isActive = true\n        progressView.translatesAutoresizingMaskIntoConstraints = false\n\n        progressView.startAnimation()\n\n    }\n\n    private func setupGesturesRecognizers() {\n        let longPressRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(longPressed))\n        view.addGestureRecognizer(longPressRecognizer)\n\n        let swipeLeft = UISwipeGestureRecognizer(target: self, action: #selector(handleGesture))\n        swipeLeft.direction = .left\n        view.addGestureRecognizer(swipeLeft)\n\n        let swipeRight = UISwipeGestureRecognizer(target: self, action: #selector(handleGesture))\n        swipeRight.direction = .right\n        view.addGestureRecognizer(swipeRight)\n    }\n\n    @objc private func handleGesture(gesture: UISwipeGestureRecognizer) {\n        if gesture.direction == .right {\n            progressView.back()\n        } else if gesture.direction == .left {\n            progressView.skip()\n        }\n    }\n\n    @objc private func longPressed(sender: UILongPressGestureRecognizer) {\n        if sender.state == .began {\n            print(\"pause\")\n            progressView.pauseAnimation()\n        }\n\n        if sender.state == .ended {\n            print(\"continueLoading\")\n            progressView.continueAnimation()\n        }\n    }\n}\n\nextension ViewController: InstaProgressViewDelegate {\n    func instaProgressViewChangedIndex(index: Int) {\n        imageView.image = UIImage(named: imageNames[index])\n    }\n\n    func instaProgressViewFinished() {\n        print(\"Finished\")\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleningradspb%2Finstaprogressview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleningradspb%2Finstaprogressview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleningradspb%2Finstaprogressview/lists"}