Interactive and fully animated Material Design button for iOS developers.

Overview

WYMaterialButton

Version License Platform

Inspired by Google Material Design, written purely in Swift 3.

WYMaterialButton implemented Material Design on iOS and add more dynamic motions, allowing iOS buttons to be more responsive and interactive.

Integrated with Spring animations and enhanced by Facebook's POP, WYMaterialButton is super animated and programmer-friendly. All settings can be customized in storyboard inspector.

Installation

WYMaterialButton is available through CocoaPods.

To install via CocoaPods add this lines to your Podfile

use_frameworks!
pod "WYMaterialButton"

Note: Due to CocoaPods/CocoaPods#4420 issue there is problem with compiling project with Xcode 7.1 and CocoaPods v0.39.0. However there is a temporary workaround for this: Add next lines to the end of your Podfile

post_install do |installer|
    `find Pods -regex 'Pods/pop.*\\.h' -print0 | xargs -0 sed -i '' 's/\\(<\\)pop\\/\\(.*\\)\\(>\\)/\\"\\2\\"/'`
end

Or download the git repository

git clone https://github.com/yuwang17/WYMaterialButton.git

Drag WYMaterialButton related files into your own project, and install facebook's POP via cocoapods

Then import the module in your file

import WYMaterialButton

If you're Objective-C user, please include the header file

#import "WYMaterialButton-Swift.h"

Usage

  1. Add a UIButton in the Storyboard of your project.

  2. Subclass the UIbutton as WYMaterialButton in identity inspector.

  3. Select a color as Material Color, the first row in attribute inspector, and let WYMaterialButton do everything else for you. You can also do other setting as well for further customizations.

c

Specification

  • For most cases, Material Color is the only property you need to set. Leave others as default.

  • Pulse Enable enable defautly, which control the bounce effect.

  • With Touch Location Enable enabled defautly, WYMaterialButton tracks your touch location and generate a ripple animation upon that. You can disable to always center the ripple effect on the button.

  • Material Effect Percent speicifies the percentage of area of the button will have material effect when being pressed. Default to 0.8.

  • You can of course access all these properties and more by using codes. For example:

    myButton.materialColor = .blue

Demo

  1. Download the repository
git clone https://github.com/yuwang17/WYMaterialButton.git
cd WYMaterialButton/Example
  1. Open the workspace
open WYMaterialButton.xcworkspace
  1. Compile and run the app in simulator
  • Under Xcode, press Ctrl + R

Supported OS & SDK Versions

  • Xcode 7
  • iOS 7

Credits

Spring: subclass @Mengto's Spring framework for supporting additional animations and quick settings in the button.

POP: Facebook's animation framework for simulating the bounce effect.

Material Design: animation idea and effects come from Google's material design concept.

License

WYMaterialButton is available under the MIT License, see LICENSE for more infomation.

You might also like...
Floaty is simple floating action button for iOS.
Floaty is simple floating action button for iOS.

Floaty is simple floating action button for iOS. (formerly KCFloatingActionButton) Why change the name? Follow the swift naming convention. KCF

iOS Pod for a Soft UI (Neumorphic) Button for UIKit written in Swift
iOS Pod for a Soft UI (Neumorphic) Button for UIKit written in Swift

iOS Pod for a Soft UI (Neumorphic) Button for UIKit written in Swift

iOS 7-style bouncy button.

SSBouncyButton SSBouncyButton is simple button UI component with iOS 7-style bouncy animation. Take A Look Try It! pod 'SSBouncyButton', '~ 1.0' Use

A high-performance button control with rounded corners for iOS.
A high-performance button control with rounded corners for iOS.

TORoundedButton TORoundedButton is an open source UI control of a standard user button. Its design consists of displaying text on top of a solid recta

Easily customizable floating button menu created with SwiftUI
Easily customizable floating button menu created with SwiftUI

FloatingButton Easily customizable floating button menu created with SwiftUI We are a development agency building phenomenal apps. Usage Create main b

LTHRadioButton - A radio button with a pretty animation
LTHRadioButton - A radio button with a pretty animation

LTHRadioButton Slightly inspired by Google's material radio button. The clip below has 3 sections: full speed, 25% and 10%, but after converting it to

Multiple state tap-to-toggle UIButton (like old camera flash button)
Multiple state tap-to-toggle UIButton (like old camera flash button)

Multiple State Toggle UIButton A UIButton subclass that implements tap-to-toggle button text. (Like the camera flash and timer buttons) Usage Just cre

Lickable-Button We made the buttons on the screen look so good you'll want to lick them

Lickable-Button We made the buttons on the screen look so good you'll want to lick them. - Steve Jobs A little SwiftUI button project at WWDC 2021 Lic

Craft that perfect SwiftUI button effect 👌🏼
Craft that perfect SwiftUI button effect 👌🏼

buttoncraft (SwiftUI 3.0 App) Experimenting with SwiftUI 3.0 whilst creating a practical app to craft that perfect button style. ✈️ Testflight https:/

Comments
  • Repeating taps have delay ?

    Repeating taps have delay ?

    Hi

    I'm trying now the library and I found (sorry or at least I can't figure out) , if I want the user to double tap or tap very quickly one after another (because is not working for me) how this can be achieved and still the material effect to be there.

    Can you hep with this please. Thanks in advance.

    opened by YHSX88 3
  • Failed to render IB Designables in Xcode 9, Swift 4

    Failed to render IB Designables in Xcode 9, Swift 4

    Hey, this is very similar to an old issue. Basically, it doesn't prevent my project from building successfully. It's just that my buttons won't preview in the storyboard. However when the project runs, the buttons work as intended. I'm guessing this is an Xcode issue? screen shot 2018-01-11 at 2 42 27 pm screen shot 2018-01-11 at 2 45 18 pm screen shot 2018-01-11 at 2 49 26 pm screen shot 2018-01-11 at 2 51 30 pm

    opened by chris-gong 1
  • xcode 8 has problem to use WYMaterialButton

    xcode 8 has problem to use WYMaterialButton

    Hi I'm using the storyboard.

    I got an error like this.

    file:///Users/{user}/Documents/{dir}/{dir}/Base.lproj/CheckOut.storyboard: error: IB Designables: Failed to render and update auto layout status for CheckoutViewController (cXb-N2-E0w): dlopen(WYMaterialButton.framework, 1): Library not loaded: @rpath/pop.framework/pop Referenced from: WYMaterialButton.framework Reason: image not found

    Anyone knows about this problem? My xcode version is 8.1, using swift 2.3

    opened by amoghpalnitkar 1
  • Change Text Color

    Change Text Color

    First of all, Let me start by saying Thank you for this great project ! Second, For some reason I'm not able to change the Text Color of the button. I've tried in the Identifier and with code but still no good.

    opened by moheny 1
Releases(0.2.4)
Owner
Yu Wang
Code & Design
Yu Wang
Flat design pressable button for iOS developers.

HTPressableButton HTPressableButton is designed for iOS developers to be able to spend time developing ideas, not building basic buttons. These stylis

Famolus 859 Dec 12, 2022
Custom UIButton effect inspired by Google Material Design

ZFRippleButton iOS Custom UIButton effect inspired by Google Material Design written in Swift Usage Set the UIButton class in Nib to ZFRippleButton or

Amornchai Kanokpullwad 1.4k Dec 1, 2022
Customizable download button with progress and transition animations. It is based on Apple's App Store download button.

AHDownloadButton is a customizable download button similar to the download button in the latest version of Apple's App Store app (since iOS 11). It fe

Amer Hukić 465 Dec 24, 2022
Revamped Download Button. It's kinda a reverse engineering of Netflix's app download button.

NFDownloadButton Revamped Download Button Requirements Installation Usage License Requirements iOS 8.0+ Swift 4.2+ Xcode 10.0+ Installation CocoaPods

Leonardo Cardoso 433 Nov 15, 2022
Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation.

AnimatablePlayButton Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation. features Only using CAShapeLayer, CAKeyframe

keishi suzuki 77 Jun 10, 2021
Cute Animated Button written in Swift.

DOFavoriteButton Cute Animated Button written in Swift. It could be just right for favorite buttons! Requirements iOS 7.0+ Swift 1.2 Installation Cart

Daiki Okumura 3.6k Dec 29, 2022
Jorge Ovalle 305 Oct 11, 2022
Customizable and easy to use expandable button in Swift.

ExpandableButton Requirements iOS 9.0+ Installation CocoaPods: Add the following line to your Podfile: pod 'ExpandableButton' #for swift less than 4.

Dmytro Mishchenko 98 Dec 5, 2022
IGStoryButtonKit provides an easy-to-use button with rich animation and multiple way inspired by instagram story/stories.

Introduction Have you ever seen UI like instagram story, haven't you? Actually, features like instagram story have been implemented in many applicatio

mutation 34 Nov 8, 2022
Simple and customizable button in Swift

SwiftyButton Maintainer(s): @nickm01 @pmacro @aryamansharda Simple and customizable button in Swift. Installation Cocoapods pod 'SwiftyButton' Cartha

Scoop 542 Dec 13, 2022