{"id":32316338,"url":"https://github.com/mrustaa/buttonclickstyle","last_synced_at":"2025-10-23T11:00:10.574Z","repository":{"id":42038641,"uuid":"478106068","full_name":"mrustaa/ButtonClickStyle","owner":"mrustaa","description":"This is a Customizable/Designable Button View, with 15 animated click styles, that allows you to design your own buttons from subviews, in storyboard and xib right away.","archived":false,"fork":false,"pushed_at":"2022-06-04T14:09:13.000Z","size":1218,"stargazers_count":50,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-23T10:59:59.484Z","etag":null,"topics":["animation","button","buttons","click","cocoapods","custom-button","customizable","customizable-button","designable","ios","layers","package","storyboard","style","swift","swift-package-manager","tap","views","xib","xml"],"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/mrustaa.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":"2022-04-05T11:52:34.000Z","updated_at":"2025-08-11T09:12:04.000Z","dependencies_parsed_at":"2022-08-12T03:01:17.251Z","dependency_job_id":null,"html_url":"https://github.com/mrustaa/ButtonClickStyle","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/mrustaa/ButtonClickStyle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrustaa%2FButtonClickStyle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrustaa%2FButtonClickStyle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrustaa%2FButtonClickStyle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrustaa%2FButtonClickStyle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrustaa","download_url":"https://codeload.github.com/mrustaa/ButtonClickStyle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrustaa%2FButtonClickStyle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280606609,"owners_count":26359387,"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-23T02:00:06.710Z","response_time":142,"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":["animation","button","buttons","click","cocoapods","custom-button","customizable","customizable-button","designable","ios","layers","package","storyboard","style","swift","swift-package-manager","tap","views","xib","xml"],"created_at":"2025-10-23T11:00:08.295Z","updated_at":"2025-10-23T11:00:10.561Z","avatar_url":"https://github.com/mrustaa.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n![image](https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/header.png)\n![image](https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/preview_10sec33fps.gif)\n\n# ButtonClickStyle\n\n[![Platform](https://img.shields.io/cocoapods/p/ButtonClickStyle.svg?style=flat)](https://cocoapods.org/pods/ButtonClickStyle)\n[![Version](https://img.shields.io/cocoapods/v/ButtonClickStyle.svg?style=flat)](https://cocoapods.org/pods/ButtonClickStyle)\n[![Xcode](https://img.shields.io/badge/Xcode-13-blue.svg)](https://developer.apple.com/xcode) \n[![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat)](https://swift.org/)\n[![Swift 5.2](https://img.shields.io/badge/Swift-5.5-orange.svg?style=flat)](https://swift.org/)\n[![License](https://img.shields.io/github/license/almazrafi/Fugen.svg)](https://github.com/mrustaa/ButtonClickStyle/LICENSE)\n\n- This is a customizable/designable Button View, \n- with 15 animated click styles, \n- that allows you to design your own buttons from subviews, \n- in storyboard and xib right away.\n\n\u003c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\u003e\n\n## Watch video with examples\n\n[▶️ Xcode Create in Storyboard/Xib](https://youtu.be/VNupvYMYPmk)\n\n[▶️ Styling Buttons TableList in iPhone](https://youtu.be/OjpMy_LUCIU) \n\n[![ Xcode Create Storyboard/Xib](https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/XcodeCreateXib40.png)](https://youtu.be/VNupvYMYPmk)\n\n\u003c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\u003e\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n  - [CocoaPods](#cocoapods)\n  - [Swift Package Manager](#swift-package-manager)\n- [Getting Started](#getting-started)\n  - [Usage `ButtonClickStyleView`](#usage-buttonclickstyleview)\n    - [Designable Attributes Storyboard/Xib files](#designable-attributes-storyboardxib-files)\n  - [Init Programmatically](#init-programmatically)\n    - [Addition `ButtonClickStyleDesignView`](#addition-buttonclickstyledesignview)\n  - [Button Click/Action Closure](#button-clickaction-closure)\n- [Author](#author)\n- [License](#license)\n\n\n\u003c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\u003e\n\n## Requirements\n\n- Xcode 13+\n- iOS 9.0+\n- Swift 5.5+\n\n\u003c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\u003e\n\n## Installation \n\n### CocoaPods\n\nContainerControllerSwift is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'ButtonClickStyle'\n```\n\n### Swift Package Manager\n\nSelect Xcode menu `File \u003e Add Packages...` and paste in the repository URL, enter.\n\nFollow [this doc](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app).\n\n```swift\nhttps://github.com/mrustaa/ButtonClickStyle\n```\n\n\n\n\u003c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\u003e\n\n## Getting Started \n\n### Usage `ButtonClickStyleView`\n\n#### Designable Attributes Storyboard/Xib files\n\n1) Create a `UIView` that inherits from `ButtonClickStyleView`\n\n2) Inside this View, create design your own button from subviews\n\n3) In Attributes Inspector of Interface Builder,\n   you can immediately select the button click style `animType`\n\n   - IBDesignable ...... | `animType` ........ | Number Value | Init Interface Builder\n   - ButtonClick.State | `animationType` | Number Value | Init Programmatiсaly State\n   - ButtonClick.State | `animationStyle` | Style Value | Init Programmatiсaly State\n\n![image](https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/click_styles_example_2x_10sec33fps.gif)\n\n```swift\nextension ButtonClick {  \n  //                          Number Value\n  enum Style {                \n    case alpha                //  0\n    case flash                //  1\n    case shadow               //  2\n    case shadowColor          //  3\n    case color                //  4\n    case colorFlat            //  5\n    case pulsateNew           //  6\n    case pulsate              //  7\n    case press                //  8\n    case shake                //  9\n    case shakeNew             // 10\n    case androidClickable     // 11\n    case androidClickableDark // 12\n    case fave                 // 13\n    case glare                // 14\n  }\n}  \n```\n\n4) Also you can select specific subviews to animate / or just 1 specific one-view `allSubviews`\n\n5) Add animation duration `animDuration`\n\n6) Add animation value `animValue` -  meaning means for some types - alpha or power\n\n- Hide       \n   .Alpha / .Flash       \n   Will change alpha for \"self.view\" from 0.0 to 1.0\n \n- Add       \n   .Shadow / .Color / .ColorFlat       \n   Will change alpha for \"add.view\" from 0.0 to 1.0\n\n- Move       \n   .Pulsate / .Press / .Shake       \n   Will change the strength of movement for \"self.view\" from 0.0 to 1.0\n\n- Tap Gesture       \n   .Fave / .AndroidClickable       \n   Will increase bubble radius for \"add.view\"\n\n- Loading   \n   .Glare       \n   No change for \"add.view\"\n\n\u003c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\u003e\n\n#### Addition `ButtonClickStyleDesignView`\n\nAlso you can use in special custom Designable `ButtonClickStyleDesignView` or `ButtonClickStyleDesignLabel` \n   with bunch of options, adding \n   + cornerRadius \n   + figure type \n   + gradient \n   + shadows \n   + borders \n   + blur\n   + etc\n\n\u003c!-- ![image](https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/ui3.gif) --\u003e\n\n\u003c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\u003e\n\n### Init Programmatically\n\nIf initializing programmatically\nThere is a property `addViews` - allows you to pass views / layers\nwhich you definitely want to use in the click animation only\n\n\u003c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\u003e\n\n#### Usage `ButtonClick.State`\n\nOr initialize through a struct `ButtonClick.State`\n\n```swift\nimport ButtonClickStyle\nimport UIKit\n\nclass ViewController: UIViewController {\n  \n  //MARK: Init Xib/Storyboards\n  \n  @IBOutlet var xibButtonClickStyleView: ButtonClickStyleView?\n  \n  //MARK: Init Programmaticaly\n  \n  var prgmButtonClickStyleView: ButtonClickStyleView?\n  var prgmFigureView: UIView!\n  var prgmRectangleView: UIView!\n  \n  override func viewDidLoad() {\n    super.viewDidLoad()\n    \n    let figureView = UIView(frame: .init(x: 50, y: 10, width: 80, height: 40))\n    figureView.backgroundColor = .systemIndigo\n    figureView.layer.cornerRadius = 20\n    self.prgmFigureView = figureView\n    \n    let rectangleView = UIView(frame: .init(x: 15, y: 50, width: 50, height: 60))\n    rectangleView.backgroundColor = .systemPurple\n    self.prgmRectangleView = rectangleView\n    \n    let state = ButtonClick.State(\n      titleText: \"Hello\",       // debug text button\n      allSubviews: true,        // click animation all subviews \n      animationType: 2,         // style 15 \n      animationTypeValue: 0.5,  // value - alpha/power move\n      animationDuration: nil,   // anim duration\n      new: false,               // same styles one of them new \n      color: UIColor.green,     // value color for styles shadowColor/color/colorFlat \n      startClick: true,         // animate on creation\n      debugButtonShow: false,   // debug highlight the real button inside\n      addBackgrondColor: true   // debug add background color/view\n    )\n    \n    let btnView = ButtonClickStyleView(\n      state: state,\n      frame: .init(x: 0, y: 300, width: 240, height: 128),\n      radius: 20,\n      addViews: [figureView],    // addViews - allows you to pass views / layers which you definitely want to use in the click animation only\n      click: { event in\n        \n      }\n    )\n    btnView.backgroundColor = .yellow.withAlphaComponent(0.5)\n    \n    btnView.updateSubviews()\n    self.prgmButtonClickStyleView = btnView\n    \n    btnView.addSubview(figureView)\n    btnView.addSubview(rectangleView)\n    self.view.addSubview(btnView)\n  }\n}\n```\n\nFor an already created ButtonView to update the animation type\n\n```swift\n self.prgmButtonClickStyleView?.update(animationType: type, allSubviews: true)\n```\n\n\u003c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\u003e\n\n### Button Click/Action Closure\n\nAdd at init programmatically Button Action-Closure event \n\n```swift\n let btnView = ButtonClickStyleView(\n      state: state, \n      frame: frame,\n      click: { event in\n          ... \n      }\n    )\n```\n\nOr define Action-Closure after\n\n```swift\n self.prgmButtonClickStyleView?.click = { event in\n    ...  \n }\n```\n\n\u003c!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --\u003e\n\n![image](https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/ui3.gif)\n\n## Author\n\n\u003cmotionrustam@gmail.com\u003e 📩| [mrustaa](https://github.com/mrustaa/) APRIL 2022\n\n## License\n\nButtonClickStyle is released under the MIT license.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrustaa%2Fbuttonclickstyle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrustaa%2Fbuttonclickstyle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrustaa%2Fbuttonclickstyle/lists"}