All Projects → cgoldsby → Tvosmorebutton

cgoldsby / Tvosmorebutton

Licence: mit
📺 tvOS '... More' Button

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Tvosmorebutton

Centeredcollectionview
A lightweight UICollectionViewLayout that 'pages' and centers its cells 🎡 written in Swift
Stars: ✭ 965 (+1792.16%)
Mutual labels:  tvos
Flutter Neumorphic
A complete, ready to use, Neumorphic ui kit for Flutter, 🕶️ dark mode compatible
Stars: ✭ 988 (+1837.25%)
Mutual labels:  button
Snapshottest
Snapshot testing tool for iOS and tvOS
Stars: ✭ 42 (-17.65%)
Mutual labels:  tvos
Hhcustomcorner
Awesome library to customize corners of UIView and UIButton. Now you can customize each corner differently
Stars: ✭ 36 (-29.41%)
Mutual labels:  button
React Native Really Awesome Button
React Native button component. Awesome Button is a 3D at 60fps, progress enabled, social ready, extendable, production ready component that renders an awesome animated set of UI buttons. 📱
Stars: ✭ 988 (+1837.25%)
Mutual labels:  button
Swiftysound
SwiftySound is a simple library that lets you play sounds with a single line of code.
Stars: ✭ 995 (+1850.98%)
Mutual labels:  tvos
Fillingbutton
🔥Replace typical onLongClickListener with this library!
Stars: ✭ 31 (-39.22%)
Mutual labels:  button
R.swift
Strong typed, autocompleted resources like images, fonts and segues in Swift projects
Stars: ✭ 8,419 (+16407.84%)
Mutual labels:  tvos
Ftpopovermenu
FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use. Supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect.
Stars: ✭ 988 (+1837.25%)
Mutual labels:  button
Fugen
Command line tool for exporting resources and generating code from your Figma files
Stars: ✭ 41 (-19.61%)
Mutual labels:  tvos
Sica
🦌 Simple Interface Core Animation. Run type-safe animation sequencially or parallelly
Stars: ✭ 980 (+1821.57%)
Mutual labels:  tvos
Oauth2
OAuth2 framework for macOS and iOS, written in Swift.
Stars: ✭ 983 (+1827.45%)
Mutual labels:  tvos
Roundbutton
Android Button with corner, morph and animations
Stars: ✭ 39 (-23.53%)
Mutual labels:  button
Lift
Lift is a Swift library for generating and extracting values into and out of JSON-like data structures.
Stars: ✭ 33 (-35.29%)
Mutual labels:  tvos
Sizeslidebutton
A fun Swift UIControl for picking a size
Stars: ✭ 46 (-9.8%)
Mutual labels:  button
Queuer
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).
Stars: ✭ 964 (+1790.2%)
Mutual labels:  tvos
Sqlitelib
Easily build a custom SQLite static library for use in macOS and iOS frameworks and apps.
Stars: ✭ 38 (-25.49%)
Mutual labels:  tvos
Antenna
Antenna is a live TV app for Apple TV (tvOS) powered by USTVnow.
Stars: ✭ 50 (-1.96%)
Mutual labels:  tvos
Buttonanimator
自定义按钮,动画,跳转动画
Stars: ✭ 47 (-7.84%)
Mutual labels:  button
Fontblaster
Programmatically load custom fonts into your iOS and tvOS app.
Stars: ✭ 1,000 (+1860.78%)
Mutual labels:  tvos

TvOSMoreButton

📺 A tvOS button which truncates long text with '... More'.

The TvOSMoreButton is a simple view which aims to mirror the behavior of Apple's "... More" button; as seen in the Movie App.

Features

If the text is too long to fit with in the button bounds then the text will be truncated and '... More' will be appended.

By default, if the text is truncated the button will be focusable. If the text is not truncated then the button will not be focusable.

However, you can set focusableMode to manual(_ isFocusable: Bool) to alter the focus behavior. This mode will force the button to be always be focused or never be focused.

When the button is focused, pressing select on the Apple TV remote will trigger a callback.

The majority of the UI properties are configurable; like

  • the button text
  • ellipse text; defaults to '...'
  • trailing text; defaults to "More"
  • trailing text color and font
  • the button text color and font
  • shadows and radius
  • and More 😉

Requirements

  • tvOS 9.0+
  • Xcode 9

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate TvOSMoreButton into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :tvos, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'TvOSMoreButton', '~> 1.3.0'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate TvOSMoreButton into your Xcode project using Carthage, specify it in your Cartfile:

github "cgoldsby/TvOSMoreButton" ~> 1.2.2

Run carthage update to build the framework and drag the built TvOSMoreButton.framework into your Xcode project.

Usage example

Please check out the Example workspace for more details.

    import TvOSMoreButton

    private func setUpUI() {
        tvOSMoreButton.text = // Super long text
        tvOSMoreButton.buttonWasPressed = {
            [weak self] text in
            self?.moreButtonWasPressed(text: text)
        }
    }

    private func moreButtonWasPressed(text: String?) -> Void {
        // Do something. May I suggest using TvOSTextViewerViewController
        // to display the text in a full screen view!
        let viewController = TvOSTextViewerViewController()
        viewController.text = text
        viewController.textColor = .white
        viewController.textEdgeInsets = UIEdgeInsets(top: 100, left: 250, bottom: 100, right: 250)
        present(viewController, animated: true)
    }

If you would like to display a fullscreen view with just the text then definitely check out @dcordero's awesome TvOSTextViewer. So good!

Contribute

We would love for you to contribute to TvOSMoreButton, check the LICENSE file for more info. Feel free to submit any issues or PRs. ❤️

Meta

Special thanks @mona-zsh for her fantastic article on String Truncation.

Chris Goldsby – @goldsbychris

Distributed under the MIT license. See LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].