GradientBorderButton
Gradient Border Button Swift
Install / Use
/learn @DemonionFF/GradientBorderButtonREADME
GradientBorderButton
Button with gradient border or fill.
GradientBorderButton is a Swift library which can help you avoid some boilerplate code.
Main features:
- Gradient border color for button
- Dark Mode support
- Custom gradient direction
|Fill|Border| |-|-| |<img width="352" alt="Screenshot 2023-05-31 at 14 47 40" src="https://github.com/DemonionFF/GradientBorderButton/assets/21122119/706f384e-366c-4a87-84de-19b0694bfd19">|<img width="352" alt="Screenshot 2023-05-31 at 14 47 54" src="https://github.com/DemonionFF/GradientBorderButton/assets/21122119/f1cc5c57-25ab-40bc-9966-6a095ca7a334">|
Installation
Cocoapods
pod 'GradientBorderButton'
Manually
- Download and drop
Sourcesfolder in your project. - Congratulations!
Usage example
- Using storyboard, just set class of your button to
GradientBorderButton - Programmatically
let gradientButton = GradientBorderButton(frame: CGRect(x: 0, y: 0, width: 200, height: 50))
view.addSubview(gradientButton)
Default values
- BorderWidth = 1
- Colors = [.systemGreen, .systemYellow]
- CornerRadius = .zero
- Direction = .horizontal
Customization
- Available
GradientBorderButton.State's:.none,.fill,.border
yourGradientBorderButton.update(state: .fill)
- Using
GradientBorderButton.Options
Available parameters:
- direction
- borderWidth
- colors
- cornerRadius
Instantiate your options and pass them to button.
let options = GradientBorderButton.Options(borderWidth: 4)
yourGradientBorderButton.configure(with: options)
Note
Each update with GradientBorderButton.Options updates only options you passed in.
Meta
Distributed under the MIT license. See LICENSE for more information.
Related Skills
node-connect
352.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
