{"id":23333619,"url":"https://github.com/amirdaliri/amholderbutton","last_synced_at":"2025-09-20T01:24:30.193Z","repository":{"id":216953347,"uuid":"114106499","full_name":"AmirDaliri/AMHolderButton","owner":"AmirDaliri","description":"For an example of creating a AMHoldButton in storyboard, check out the example project.","archived":false,"fork":false,"pushed_at":"2018-01-03T09:39:44.000Z","size":24,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T20:23:59.699Z","etag":null,"topics":["custombutton","holderbutton","programatically","storyboard","uibutton"],"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/AmirDaliri.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-12-13T10:22:51.000Z","updated_at":"2020-01-22T09:35:44.000Z","dependencies_parsed_at":"2024-01-13T21:28:47.627Z","dependency_job_id":"fd25da0c-b006-4679-9e26-b47873846dc6","html_url":"https://github.com/AmirDaliri/AMHolderButton","commit_stats":null,"previous_names":["amirdaliri/amholderbutton"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmirDaliri%2FAMHolderButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmirDaliri%2FAMHolderButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmirDaliri%2FAMHolderButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmirDaliri%2FAMHolderButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmirDaliri","download_url":"https://codeload.github.com/AmirDaliri/AMHolderButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248086200,"owners_count":21045295,"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":["custombutton","holderbutton","programatically","storyboard","uibutton"],"created_at":"2024-12-21T00:18:48.688Z","updated_at":"2025-09-20T01:24:25.088Z","avatar_url":"https://github.com/AmirDaliri.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# AMHolderButton  swift 4, iOS 11\n\n![ezgif-3-32e9f9344e](https://user-images.githubusercontent.com/17800816/33937652-80375b8c-e019-11e7-970b-8289bb089acf.gif)\n\n### Storyboard\n- Drag a UIButton onto your view.\n- Change it's class to `AMHolderButton`\n- Edit it's appearance using the custom properties in the Attributes Inspector\n- Create the button as a property of it's View Controller\n- In the `viewDidLoad()` method of your View Controller, set the button's `holdButtonCompletion` property to tell the button what to do when it's done animating.\n\nFor an example of creating a AMHoldButton in storyboard, check out the example project.\n\n### Programatically\n- Initialize the button\n- Set the button's `holdButtonCompletion` property to tell the button what to do when it's done animating.\n\nExample:\n```swift 4\nlet bttn = AMHoldButton(frame: CGRect(x: 0, y: 0 , width: 200, height: 50), slideColor: UIColor.green, slideTextColor: UIColor.white, slideDuration: 1.0)\nbttn.backgroundColor = UIColor.clear\nbttn.setText(\"👍🏻\")\nbttn.setTextFont(UIFont.boldSystemFont(ofSize: 18))\nbttn.textColor = UIColor.green\nbttn.holdButtonCompletion = {() -\u003e Void in\nprint(\"Hold button has completed!\")\n}\nbttn.resetDuration = 0.2\nbttn.borderWidth = 3.0\nbttn.borderColor = UIColor.green\nbttn.cornerRadius = bttn.frame.width / 2\nself.view.addSubview(bttn)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirdaliri%2Famholderbutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famirdaliri%2Famholderbutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirdaliri%2Famholderbutton/lists"}