{"id":17977934,"url":"https://github.com/coderyi/statemachineswift","last_synced_at":"2025-10-08T00:11:07.862Z","repository":{"id":62456038,"uuid":"318041064","full_name":"coderyi/StateMachineSwift","owner":"coderyi","description":"StateMachineSwift, state machine library for Swift, supports an arbitrary number of States and Events.","archived":false,"fork":false,"pushed_at":"2022-01-20T14:39:17.000Z","size":26,"stargazers_count":41,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-16T10:08:34.219Z","etag":null,"topics":["ios","state-machine","statemachine","swift"],"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/coderyi.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":"2020-12-03T01:37:30.000Z","updated_at":"2023-08-15T13:27:12.000Z","dependencies_parsed_at":"2022-11-01T22:33:01.764Z","dependency_job_id":null,"html_url":"https://github.com/coderyi/StateMachineSwift","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/coderyi/StateMachineSwift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderyi%2FStateMachineSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderyi%2FStateMachineSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderyi%2FStateMachineSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderyi%2FStateMachineSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderyi","download_url":"https://codeload.github.com/coderyi/StateMachineSwift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderyi%2FStateMachineSwift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278867099,"owners_count":26059716,"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-07T02:00:06.786Z","response_time":59,"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":["ios","state-machine","statemachine","swift"],"created_at":"2024-10-29T17:30:12.785Z","updated_at":"2025-10-08T00:11:07.807Z","avatar_url":"https://github.com/coderyi.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"StateMachineSwift, supports an arbitrary number of States and Events.\n\n### CocoaPods\n\n```\npod 'StateMachineSwift'\n```\n\n### Features\n\n* Supports an arbitrary number of States and Events.\n* States and Events support a thorough set of callbacks for responding to state transitions.\n* Transitions support the inclusion of arbitrary user data via a userInfo dictionary, making it easy to broadcast metadata across callbacks.\n* Lightweight.\n\n### Example\n\n```\nlet orderStateMachine: SMStateMachine = SMStateMachine()\n\nlet normal: SMState = SMState(\"normal\")\nlet purchase: SMState = SMState(\"purchase\")\nlet cancel: SMState = SMState(\"cancel\")\n\norderStateMachine.addStates(arrayOfStates: [normal, purchase, cancel])\norderStateMachine.initialState = normal\n\nlet confirmOrder: SMEvent = SMEvent(\"confirmOrder\", sourceStates: [normal], destinationState: purchase)\nlet cancelOrder: SMEvent = SMEvent(\"cancelOrder\", sourceStates: [purchase, normal], destinationState: cancel)\n\norderStateMachine.addEvents(arrayOfEvents: [confirmOrder, cancelOrder])\n\norderStateMachine.activate()\norderStateMachine.isInState(\"normal\")\n\nlet userInfo = [\"hello\": \"world\"]\norderStateMachine.fireEvent(eventName: \"confirmOrder\", userInfo: userInfo)\norderStateMachine.fireEvent(eventName: \"cancelOrder\", userInfo: userInfo)\n```\n## License\nReleased under [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderyi%2Fstatemachineswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderyi%2Fstatemachineswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderyi%2Fstatemachineswift/lists"}