GithubHelp home page GithubHelp logo

wclshinebutton's Introduction

WCLShineButton

Version License Platform Support  Language

This is a UI lib for iOS. Effects like shining.

Chinese (Simplified):

CocoaPods

CocoaPods is the recommended way to add WCLShineButton to your project.

Add a pod entry for WCLShineButton to your Podfile.

pod 'WCLShineButton'

Second, install WCLShineButton into your project:

pod install

Include WCLShineButton wherever you need it with import WCLShineButton.

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate WCLShineButton into your Xcode project using Carthage, specify it in your Cartfile:

github "imwcl/WCLShineButton"

Run carthage update to build the framework and drag the built WCLShineButton.framework (in Carthage/Build/iOS folder) into your Xcode project (Linked Frameworks and Libraries in Targets).

Usage

var param1 = WCLShineParams()
param1.bigShineColor = UIColor(rgb: (153,152,38))
param1.smallShineColor = UIColor(rgb: (102,102,102))
let bt1 = WCLShineButton(frame: .init(x: 100, y: 100, width: 60, height: 60), params: param1)
bt1.fillColor = UIColor(rgb: (153,152,38))
bt1.color = UIColor(rgb: (170,170,170))
bt1.addTarget(self, action: #selector(action), for: .valueChanged)
view.addSubview(bt1)

Complex Usage

Property Description
color Default button color
fillColor Fill button color
allowRandomColor Allow shine color random
animDuration shine anim duration
bigShineColor big shine color
enableFlashing Enable effect like flash
shineCount shine count around button
shineTurnAngle turn angle of shine
shineDistanceMultiple multiple of distance to button
smallShineOffsetAngle angle offset of small shine to big shine
smallShineColor small shine color
shineSize size of shine by pixel
colorRandom shine color random
image button image (png)

Contacts

blog

CSDN

Code Reference

ShineButton

License

WCLShineButton is released under the MIT license. See LICENSE for details.

wclshinebutton's People

Contributors

eyrefree avatar imwcl avatar nathangaskin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wclshinebutton's Issues

已点赞

首先感谢楼主
写的这么漂亮的功能框架
能出个OC版的吗?
毕竟项目混合开发,不太敢用
只是提议下,没别的意思

关于OC的兼容

我项目是OC。本想直接桥接你的按钮。但是发现你的params这个类使用了结构体,这样桥接并不能直接转成OC方法。很无奈我使用不了。若可以,期待做个OC兼容,好像需要把结构体修改为类

Initial state

There is no way to set the initial state of the button to be ON. For example, if it was ON previously.

WCLShineButton rejection issue

  1. on TableViewcell I am clicking a cell WCLShineButton but it refection showing on another cell WCLShineButton.
  2. In ios 14.2 on the tap WCLShineButton it showing some other background color on the image which is I have set for selection and default state.

Image is never added to WCLShineButton

I am using this code to display an image on the button

if let image = UIImage(named: "heart-smile") {
      likebutton.image = WCLShineImage.custom(image)
}

This simply does not work but it does if you change your button to a UIButton instead of a WCLShineButton. This is a bug

Crash on 32 bit devices

I noticed a crash when running on older devices. This crashes the app on an iPhone 5, but not 5s. Here is a screenshot to help understand where the app crashes.

screen shot 2017-05-07 at 11 50 33 pm

Add ability to change the click state programmatically

Thanks for a nice project!

As asked in #8 it would be nice to change the clicked state in code with the animation.

A use case it that you want to increase the touch area but dont want to increase the button image size. So you make a gesture recogniser that sets the clicked/selected state but still show the animation.

Can't set ShineButton to RightBarButtonItem

I am trying to add shinebutton to navigation bar but i failed

let favoriteButton = WCLShineButton()
favoriteButton.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
favoriteButton.image = .star

let customFavoriteButton = UIBarButtonItem(customView: favoriteButton)
navigationItem.setRightBarButton(customFavoriteButton, animated: true)

At this point ShineButton is not showing but when clicked it is shining like very small

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.