{"id":18270413,"url":"https://github.com/wess/Shift","last_synced_at":"2025-04-05T01:30:34.041Z","repository":{"id":9019723,"uuid":"10776584","full_name":"wess/Shift","owner":"wess","description":"Super simple category for NSObject that adds a tiny state machine.","archived":false,"fork":false,"pushed_at":"2013-06-19T00:49:52.000Z","size":101,"stargazers_count":119,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-26T00:35:07.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/wess.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":"2013-06-19T00:36:44.000Z","updated_at":"2023-05-15T19:35:19.000Z","dependencies_parsed_at":"2022-07-09T22:18:22.627Z","dependency_job_id":null,"html_url":"https://github.com/wess/Shift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wess%2FShift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wess%2FShift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wess%2FShift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wess%2FShift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wess","download_url":"https://codeload.github.com/wess/Shift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276022,"owners_count":20912285,"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":[],"created_at":"2024-11-05T11:38:36.464Z","updated_at":"2025-04-05T01:30:33.797Z","avatar_url":"https://github.com/wess.png","language":"Objective-C","readme":"# Shift\nShift is just a tiny category that adds a cute little state machine to NSObject. It's also a little bit of a learning project\nthat turns out to be a little bit useful at times.\n\n## Usage:\nIt's very simple to use, there really isn't a lot to it.\n\n```objective-c\n#import \"NSObject+Shift.h\"\n\n// First we create an object.\nNSString *string = @\"Hello world\";\n\n// Set a state for it.\nstring.shiftState = @\"inactive\";\n\n// Setup some callbacks when that state changes.\n\n[string on:@\"active\" do:^(id self) {\n  NSLog(@\"I have become active\");\n}];\n\n[string before:@\"active\" do:^(id self) {\n  NSLog(@\"Going to print this before i become active\");\n}];\n\n[string after:@\"inactive\" do:^(id self) {\n  NSLog(@\"Going to print after state has changed\");\n}];\n\n[string when:@\"inactive\" transitionsTo:@\"active\" do:^(id self) {\n  NSLog(@\"OMG, My state is transitioning to!!\");\n}];\n\n[string when:@\"active\" transitionsFrom:@\"inactive\" do:^(id self) {\n  NSLog(@\"OMG, My state is transitioning from!\");\n}];\n\n\nstring.shiftState = @\"active\";\n\n````\n\n\n***\n\n* [Github](http://www.github.com/wess)\n* [@WessCope](http://www.twitter.com/wesscope)\n\n## License\nRead LICENSE file for more info.\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwess%2FShift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwess%2FShift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwess%2FShift/lists"}