{"id":1155,"url":"https://github.com/hemantasapkota/GCDTimer","last_synced_at":"2025-08-06T14:33:00.861Z","repository":{"id":33207143,"uuid":"36849814","full_name":"hemantasapkota/GCDTimer","owner":"hemantasapkota","description":"Well-tested GCD Timer in Swift","archived":false,"fork":false,"pushed_at":"2023-01-13T00:59:31.000Z","size":104,"stargazers_count":190,"open_issues_count":2,"forks_count":22,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-12-01T08:11:55.675Z","etag":null,"topics":["dispatch","gcd","swift","timer"],"latest_commit_sha":null,"homepage":"","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/hemantasapkota.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-04T05:26:00.000Z","updated_at":"2024-05-15T14:37:45.000Z","dependencies_parsed_at":"2023-01-14T23:54:38.559Z","dependency_job_id":null,"html_url":"https://github.com/hemantasapkota/GCDTimer","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantasapkota%2FGCDTimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantasapkota%2FGCDTimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantasapkota%2FGCDTimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantasapkota%2FGCDTimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hemantasapkota","download_url":"https://codeload.github.com/hemantasapkota/GCDTimer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228915455,"owners_count":17991409,"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":["dispatch","gcd","swift","timer"],"created_at":"2024-01-05T20:15:40.102Z","updated_at":"2024-12-09T15:30:49.825Z","avatar_url":"https://github.com/hemantasapkota.png","language":"Swift","funding_links":[],"categories":["GCD","Libs","WebSocket","Thread [🔝](#readme)"],"sub_categories":["Getting Started","Thread","Other free courses","Linter"],"readme":"[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n### GCDTimer ###\nWell tested Grand Central Dispatch (GCD) Timer in Swift. Checkout the [test](GCDTimerTests/GCDTimerTests.swift) file.\n\n### Usage ###\n\n#### Long running timer ####\n```swift\nimport GCDTimer\n\nclass Demo {\n\n  init() {\n    let timer = GCDTimer(intervalInSecs: 20)\n    \n    timer.Event = {\n      println(\"Hello World\")\n      \n      // Send some data to the server\n    }\n    \n    timer.start()\n    \n    //Don't forget to pause the timer in the AppDelegate:applicationWillResignActive(application: UIApplication) method.\n  }\n\n}\n\n```\n\n#### Autofinishing timer ####\n\n```swift\nimport GCDTimer\n\nclass Demo {\n\n  init() {\n    let timer = GCDTimer(intervalInSecs: 2)\n    \n    timer.Event = {\n      timer.pause()\n      //Process after finishing the timer\n    }\n    \n    timer.start()\n  }\n  \n}\n```\n\n#### Dispatch After - Delay ####\n\n```swift\nvar index = 0\nGCDTimer.delay(2) {\n    index += 1\n}\n```\n\n### Installation ###\n\n* Add ```github \"hemantasapkota/GCDTimer\"``` to your ```cartfile```\n* Execute ```carthage update```\n\n### Example ###\nThe example shows how to use GCDTimer to periodically poll newly submitted items from Hacker News.\n\n![ExampleSS](Example/GCDTimerExample/ExampleSS.png)\n\n### License ###\nThe MIT License (MIT)\n\nCopyright (c) 2023 Hemanta Sapkota\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemantasapkota%2FGCDTimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhemantasapkota%2FGCDTimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemantasapkota%2FGCDTimer/lists"}