iOS開源:WJClipsButton-Clips 按鈕的完整實現

ArlParsons 8年前發布 | 18K 次閱讀 iOS開發 移動開發

效果

要求

  • Swift 3.0
  • iOS 8.0
  • Xcode 8.0

安裝

WJClipsButton is available through CocoaPods . To install it, simply add the following line to your Podfile:

pod "WJClipsButton"

使用

Code

Import

import WJClipsButton

Init && Setup

let wjButton = WJClipsButton.init(frame: CGRect.init(x: 0, y: 0, width: 300, height: 50))
wjButton.center = self.view.center
wjButton.cornerRadius = 10
wjButton.setButtonColor(.blue, status: .normal)
wjButton.setButtonColor(.yellow, status: .highlighted)
wjButton.setButtonColor(.red, status: .selected)
wjButton.setButtonTitle("I gonna start ... en ?", for: .normal)
wjButton.setButtonTitle("Touching ... friction.", for: .highlighted)
wjButton.setButtonTitle("Locked, locked.", for: .selected)
self.view.addSubview(wjButton)

Storyboard

Picture is truth

@IBInspectable Supported

Delegate

// button tap action
func didTapClipsButton()

// button unlock action
func clipsButtonDidUnlock()

// button lock action
func clipsButtonDidLock()

作者

jingzhilehuakai, wj_jingzhilehuakai@163.com

許可

WJClipsButton is available under the MIT license. See the LICENSE file for more info.

 

項目主頁:http://www.baiduhome.net/lib/view/home/1498720580554

 

 

 本文由用戶 ArlParsons 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!