{"id":13434396,"url":"https://github.com/iluuu1994/ITSwitch","last_synced_at":"2025-03-17T14:31:19.811Z","repository":{"id":13738003,"uuid":"16432353","full_name":"iluuu1994/ITSwitch","owner":"iluuu1994","description":"ITSwitch is a replica of UISwitch for Mac OS X","archived":false,"fork":false,"pushed_at":"2018-04-01T10:42:47.000Z","size":1215,"stargazers_count":289,"open_issues_count":3,"forks_count":42,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-15T15:40:17.535Z","etag":null,"topics":["objective-c","uiswitch"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iluuu1994.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":"2014-02-01T10:45:12.000Z","updated_at":"2024-11-18T07:13:19.000Z","dependencies_parsed_at":"2022-09-08T07:34:39.701Z","dependency_job_id":null,"html_url":"https://github.com/iluuu1994/ITSwitch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iluuu1994%2FITSwitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iluuu1994%2FITSwitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iluuu1994%2FITSwitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iluuu1994%2FITSwitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iluuu1994","download_url":"https://codeload.github.com/iluuu1994/ITSwitch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244050198,"owners_count":20389655,"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":["objective-c","uiswitch"],"created_at":"2024-07-31T02:01:55.495Z","updated_at":"2025-03-17T14:31:19.805Z","avatar_url":"https://github.com/iluuu1994.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"ITSwitch\n========\n\n`ITSwitch` is a simple and lightweight replica of iOS 7 `UISwitch` for Mac OS X.\n\n![](./demo.png)\n\nUsage\n-----\n\nNot much to it, simply set the custom class of a `NSView` to `ITSwitch` in Interface Builder.  \nYou can create an IBAction and simply connect the two in Interface Builder.  \nOr you can use Cocoa Bindings to directly bind it to one of your properties:\n\n```objc\n[switch bind:@\"checked\" toObject:self withKeyPath:@\"prop\" options:nil];\n```\n\nUse these two properties to explicitely mutate the switches state:\n\n```objc\n/**\n *  @property checked - Gets or sets the switches state\n */\n@property (nonatomic, assign) IBInspectable BOOL checked;\n\n/**\n *  @property tintColor - Gets or sets the switches tint\n */\n@property (nonatomic, strong) IBInspectable NSColor *tintColor;\n```\n\nSince `ITSwitch` uses its `CALayer` to draw a drop-shadow, you should also layer-back it's superview.\nIf you don't use Core Animation, you can also simply embed the view in a layer-backed view.\n\nRequirements\n------------\n\nITSwitch requires 10.9+ and linking against the QuartzCore.framework. \n\nTips\n----\n\nYou may want to consider setting the width of the view to the golden ratio * height. \n\nSo for example:\n\n```objc\nheight = 20;\nwidth = height * 1.618;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filuuu1994%2FITSwitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filuuu1994%2FITSwitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filuuu1994%2FITSwitch/lists"}