iOS开源:WJClipsButton-Clips 按钮的完整实现
<p style="text-align:center"><img src="https://simg.open-open.com/show/d7a292b7dcad5f129f6aa0b2c08c34b4.jpg"></p> <h2>效果</h2> <p style="text-align:center"><img src="https://simg.open-open.com/show/64a0d7411c87470b96a9d209d213383b.gif"></p> <h2>要求</h2> <ul> <li>Swift 3.0</li> <li>iOS 8.0</li> <li>Xcode 8.0</li> </ul> <h2>安装</h2> <p>WJClipsButton is available through <a href="/misc/goto?guid=4958869288453138992" rel="nofollow,noindex">CocoaPods</a> . To install it, simply add the following line to your Podfile:</p> <pre> <code class="language-objectivec">pod "WJClipsButton"</code></pre> <h2>使用</h2> <h3>Code</h3> <p>Import</p> <pre> <code class="language-objectivec">import WJClipsButton</code></pre> <p>Init && Setup</p> <pre> <code class="language-objectivec">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)</code></pre> <h3>Storyboard</h3> <p>Picture is truth</p> <p>@IBInspectable Supported</p> <p><img src="https://simg.open-open.com/show/d34f7a54b108adaa5cd8b5f620d7b2d7.jpg"></p> <h3>Delegate</h3> <pre> <code class="language-objectivec">// button tap action func didTapClipsButton() // button unlock action func clipsButtonDidUnlock() // button lock action func clipsButtonDidLock()</code></pre> <h2>作者</h2> <p>jingzhilehuakai, <a href="/misc/goto?guid=4959750160659948978" rel="nofollow,noindex">wj_jingzhilehuakai@163.com</a></p> <h2>许可</h2> <p>WJClipsButton is available under the MIT license. See the LICENSE file for more info.</p> <p> </p> <p>项目主页:<a href="http://www.open-open.com/lib/view/home/1498720580554">http://www.open-open.com/lib/view/home/1498720580554</a></p> <p> </p> <p> </p>
本文由用户 ArlParsons 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!