{"id":779,"url":"https://github.com/dcordero/FocusTvButton","last_synced_at":"2025-07-30T19:32:16.348Z","repository":{"id":10843773,"uuid":"67214951","full_name":"dcordero/FocusTvButton","owner":"dcordero","description":"Light wrapper of UIButton that allows extra customization for tvOS","archived":false,"fork":false,"pushed_at":"2023-08-24T02:45:28.000Z","size":3057,"stargazers_count":73,"open_issues_count":1,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-02T00:04:11.663Z","etag":null,"topics":[],"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/dcordero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null},"funding":{"github":["dcordero"]}},"created_at":"2016-09-02T10:48:53.000Z","updated_at":"2023-09-16T07:38:32.000Z","dependencies_parsed_at":"2024-04-21T18:11:32.443Z","dependency_job_id":null,"html_url":"https://github.com/dcordero/FocusTvButton","commit_stats":{"total_commits":84,"total_committers":6,"mean_commits":14.0,"dds":"0.40476190476190477","last_synced_commit":"29b859ab3d797c38a0762106b98f1304c242325b"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcordero%2FFocusTvButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcordero%2FFocusTvButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcordero%2FFocusTvButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcordero%2FFocusTvButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcordero","download_url":"https://codeload.github.com/dcordero/FocusTvButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228178887,"owners_count":17881105,"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-01-05T20:15:31.135Z","updated_at":"2024-12-04T19:31:56.797Z","avatar_url":"https://github.com/dcordero.png","language":"Swift","readme":"# FocusTvButton\n\nLight wrapper of UIButton that allows extra customization for tvOS\n\n![](art/preview.gif)\n\nIf you would like to have the same level of customization in tableview cells, you should definitely check out [TvOSCustomizableTableViewCell](https://github.com/zattoo/TvOSCustomizableTableViewCell)\n\n## Description\n\nFocusTvButton allows the customization of UIButtons in tvOS, adding extra properties to customize layout attributes which are not customizable on UIButtons out of the box.\n\nCustom properties:\n\n- Focused background color\n- Unfocused background color\n- Selected background color\n- Corner radius\n- Scale factor when focused\n- Shadow radius when focused\n- Shadow opacity when focused\n- Shadow color\n- Shadow offset when focused\n- Duration of the focus animation\n- Title color when focuses/unfocused\n\nTwo color, linear gradient properties:\n- Focused background end color\n- Unfocused background end color\n- Selected background end color\n- gradient start \u0026 end points\n\nA simple two color, linear gradient can be configured by setting either \"background end\" color properties. If neither \"background end\" color properties are set then `FocusTvButton` will use a solid background color by default.\n\n## Requirements\n\n- tvOS 10.2+\n- Xcode 11.0+\n\n## Usage\n\nFocusTvButton can be integrated both programmatically or embedded in a xib file.\n\n## Programmatically\n\nFocusTvButton is a subclass of UIButton, so it can be created and used as a regular UIButton.\n\n```swift\nlet myButton = FocusTvButton()\nmyButton.focusedBackgroundColor = .red\nmyButton.normalBackgroundColor = .white\nmyButton.cornerRadius = 12.0\n\n// with optional gradient\nmyButton.focusedBackgroundEndColor = .green\nmyButton.normalBackgroundColor = .black\nmyButton.gradientStartPoint = .zero\nmyButton.gradientEndPoint = CGPoint(x: 0, y: 1)\n```\n\n## Embedded in a xib or storyboard file\n\nDue to the fact that FocusTvButton is a subclass of UIButton, the first step is to drag and drop a regular UIButton from the Object library to your view.\n\n![](art/buttonObjectLibrary.png)\n\nThen change the value of \"Custom Class\" to \"FocusTvButton\", and the Button type to \"Custom\" to avoid the default focus behavior.\n\n![](art/buttonCustomClass.png) ![](art/buttonTypeCustom.png)\n\nAnd that's all...\n\nThe custom properties can be configured directly on the Storyboard using IBInspectables.\n\n![](art/ibinspectables.png)\n\n## Installation\n\n### Cocoapods\n\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```\n$ gem install cocoapods\n```\n\nTo integrate FocusTvButton into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :tvos, '9.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'FocusTvButton', '~\u003e 3.1.1'\nend\n```\n\nThen, run the following command:\n\n```\n$ pod install\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with Homebrew using the following command:\n\n```\n$ brew update\n$ brew install carthage\n```\n\nTo integrate FocusTvButton into your Xcode project using Carthage, specify it in your Cartfile:\n\n```\ngithub \"dcordero/FocusTvButton\" ~\u003e 3.1.1\n```\n\nRun carthage update to build the framework and drag the built FocusTvButton.framework into your Xcode project.\n\n### Manually\n\nIf you prefer, you can also integrate FocusTvButton into your project manually, just copying FocusTvButton.swift to your project.\n","funding_links":["https://github.com/sponsors/dcordero"],"categories":["Apple TV","HarmonyOS"],"sub_categories":["Windows Manager","Other free courses","Getting Started"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcordero%2FFocusTvButton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcordero%2FFocusTvButton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcordero%2FFocusTvButton/lists"}