Title: Can't figure out how to stop timer · Issue #36 · radex/SwiftyTimer · GitHub
Open Graph Title: Can't figure out how to stop timer · Issue #36 · radex/SwiftyTimer
X Title: Can't figure out how to stop timer · Issue #36 · radex/SwiftyTimer
Description: Hello! I want to make a function that starts the timer unless there is a bool true in params (e.g. animateStatusIcon(stop: true)) - in that case I want to stop the timer. Does anyone have an idea what's going on here? The timer starts bu...
Open Graph Description: Hello! I want to make a function that starts the timer unless there is a bool true in params (e.g. animateStatusIcon(stop: true)) - in that case I want to stop the timer. Does anyone have an idea w...
X Description: Hello! I want to make a function that starts the timer unless there is a bool true in params (e.g. animateStatusIcon(stop: true)) - in that case I want to stop the timer. Does anyone have an idea w...
Opengraph URL: https://github.com/radex/SwiftyTimer/issues/36
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't figure out how to stop timer","articleBody":"Hello! \r\n\r\nI want to make a function that starts the timer unless there is a bool true in params (e.g. animateStatusIcon(stop: true)) - in that case I want to stop the timer. Does anyone have an idea what's going on here? \r\n\r\nThe timer starts but no matter what I do it wont stop.\r\n\r\n```swift\r\nfunc animateStatusIcon(stop: Bool? = nil){\r\n \r\n let icon = NSImage(named: \"statusIcon\")\r\n let iconActive = NSImage(named: \"statusIconActive\")\r\n \r\n let timer = Timer.every(0.4.seconds) {\r\n self.statusItem.image = icon\r\n Timer.after(0.2.seconds) {\r\n self.statusItem.image = iconActive\r\n }\r\n }\r\n \r\n if(stop == true){\r\n print(stop!)\r\n print(\"should stop now\")\r\n timer.invalidate()\r\n } else {\r\n print(stop)\r\n print(\"start\")\r\n timer.start()\r\n }\r\n \r\n }\r\n```\r\n","author":{"url":"https://github.com/benpixel","@type":"Person","name":"benpixel"},"datePublished":"2017-05-10T15:53:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/36/SwiftyTimer/issues/36"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:777b3f23-dcf9-e607-15b2-9ee4fb4f10df |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E8AE:304CD9:4D5433:6C7DA8:696A0D48 |
| html-safe-nonce | e206a7db1847b6703d8676c3b012a92cca2dfc383c4e7965d33cf3b79f492862 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEFFOjMwNENEOTo0RDU0MzM6NkM3REE4OjY5NkEwRDQ4IiwidmlzaXRvcl9pZCI6IjU0MzkyNjY0NDkzNzAyNTQ2NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 220b860366b58ee8e5e39db59a6b41ae87c5eacb9565c40bea262d7923bfeb77 |
| hovercard-subject-tag | issue:227728009 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/radex/SwiftyTimer/36/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c2cd44346fdc7e74115bed6d3980f63a650f3b7f0e82140ec9e23b5a8a0f61e8/radex/SwiftyTimer/issues/36 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c2cd44346fdc7e74115bed6d3980f63a650f3b7f0e82140ec9e23b5a8a0f61e8/radex/SwiftyTimer/issues/36 |
| og:image:alt | Hello! I want to make a function that starts the timer unless there is a bool true in params (e.g. animateStatusIcon(stop: true)) - in that case I want to stop the timer. Does anyone have an idea w... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | benpixel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 699227a00bbb7fe1eec276d2ae1c3a93068bc5ba483bd9dc4b2a27a8f4f2f595 |
| turbo-cache-control | no-preview |
| go-import | github.com/radex/SwiftyTimer git https://github.com/radex/SwiftyTimer.git |
| octolytics-dimension-user_id | 183747 |
| octolytics-dimension-user_login | radex |
| octolytics-dimension-repository_id | 35327084 |
| octolytics-dimension-repository_nwo | radex/SwiftyTimer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 35327084 |
| octolytics-dimension-repository_network_root_nwo | radex/SwiftyTimer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7266b2d935baa1c6474b16dd9feaa5ca30607261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width