{"id":2269,"url":"https://github.com/andresinaka/SnapTimer","last_synced_at":"2025-08-02T23:32:47.072Z","repository":{"id":62455713,"uuid":"67363252","full_name":"andresinaka/SnapTimer","owner":"andresinaka","description":"Implementation of Snapchat's stories timer. ","archived":false,"fork":false,"pushed_at":"2016-09-17T15:32:26.000Z","size":2439,"stargazers_count":282,"open_issues_count":5,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-26T02:32:20.553Z","etag":null,"topics":["animation","completion-handler","snapchat-stories","timer"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andresinaka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-04T19:07:55.000Z","updated_at":"2024-10-11T17:17:09.000Z","dependencies_parsed_at":"2022-11-01T22:46:27.834Z","dependency_job_id":null,"html_url":"https://github.com/andresinaka/SnapTimer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresinaka%2FSnapTimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresinaka%2FSnapTimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresinaka%2FSnapTimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresinaka%2FSnapTimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andresinaka","download_url":"https://codeload.github.com/andresinaka/SnapTimer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503167,"owners_count":17930527,"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","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":["animation","completion-handler","snapchat-stories","timer"],"created_at":"2024-01-05T20:16:09.395Z","updated_at":"2024-12-06T17:30:57.053Z","avatar_url":"https://github.com/andresinaka.png","language":"Swift","readme":"![SnapTimer](images/snaptimer-logo.png)\n\n# SnapTimer\n\nSnapTimer is a custom UIView that behaves exactly the same as the one on Snapchat's stories. \n\n[![Build Status](https://travis-ci.org/andresinaka/SnapTimer.svg?branch=master)](https://travis-ci.org/andresinaka/SnapTimer) [![codecov.io](https://codecov.io/github/andresinaka/SnapTimer/badge.svg?branch=master)](https://codecov.io/github/andresinaka/SnapTimer?branch=master)\n\n```\nSwift 3.0 Support on master branch! 👌👌 \nSwift 2.3 Support on Swift2.3.\n```\n\n## Features\n\n- Two different timers, 'outer' and 'inner'.\n- Independent animations for each of the timers.\n- Customizable colors.\n- Completion handlers.\n- Fully Swift.\n\n# What does it look like?\n\n\u003e A picture is worth a thousand words\n\n![samples](images/sample-timers.png)\n\n# Installation\n\nYou can just clone the repo and copy the ```SnapTimer``` folder to your project or you can use one of the following options:\n \n### Setting up with [CocoaPods](http://cocoapods.org/)\n\n```ruby\npod 'SnapTimer'\n```\n\nThen:\n\n```swift\nimport SnapTimer\n```\n\nAnd you are all set! \n\n### Setting up with [Carthage](https://github.com/Carthage/Carthage)\n\n- TODO\n\n# How do I add it?\n\n1. Add a `UIView` to your Storyboard.\n2. Select the view, go to the `Identity Inspector` and set the class to `SnapTimerView`\n \n    ![identity-inspector](images/identity-inspector.png)\n\n3. Create an `@IBOutlet` in your view controller and that's it.\n \n    `SnapTimerView` implements `@IBDesignable` so the view should automatically render in your Interface Builder. Also it implements `@IBInspectable` for the view properties:\n\n   ![properties](images/properties.png)\n\n4. That's it!\n\n### Setting inner and outer values\n\n**innerValue** and **outerValue** ranges go from 0 to 100.\n\n* To set values without animations you just have to:\n\n    ```swift\nself.snapTimerView.outerValue = 25\nself.snapTimerView.innerValue = 50\n```\n   ![ej1](images/ej1.gif)\n\n* To animate values:\n\n    ```swift\nself.snapTimerView.animateOuterValue(50)\nself.snapTimerView.animateInnerValue(25)\n```\n   ![ej1](images/ej2.gif)\n\n* To animate values setting the time and a completion handler:\n\n  ```swift\n  self.snapTimerView.animateOuterToValue(50, duration: 30) {\n\t  puts(\"Done!\")\n  }\n \n  self.snapTimerView.animateInnerToValue(100, duration: 30) {\n\t  puts(\"Done!\")\n  }\n  ```\n \n### Pausing and resuming animations:\n\nif your app goes to background or the Notifications/Control center are opened you may want to pause the animations, to do that SnapTimer has two handy methods:\n\n```swift\nself.snapTimerView.resumeAnimation()\nself.snapTimerView.pauseAnimation()\n```\n\n# Check the sample project!\n\n![samples](images/ej3.gif)\n\n# Cool ways to improve it?\n\nHey, If you have cool ideas to add to this please feel free to send a PR! Also if you are using this in your app and what to let me know I'll be happy to add a section here with the apps currently using this!\n","funding_links":[],"categories":["UI","Swift"],"sub_categories":["Activity Indicator","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandresinaka%2FSnapTimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandresinaka%2FSnapTimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandresinaka%2FSnapTimer/lists"}