Skip to content

Instantly share code, notes, and snippets.

View Aman2306's full-sized avatar
💭
On journey to be a great iOS Developer

Aman Meena Aman2306

💭
On journey to be a great iOS Developer
View GitHub Profile
@Aman2306
Aman2306 / GradientView.swift
Created May 10, 2020 05:46
Custom Gradient View
import UIKit
@IBDesignable // this means that it will work inside storyboard, means it will render storyboard
class GradientView: UIView {
@IBInspectable var topColor: UIColor = #colorLiteral(red: 0.2980392157, green: 0.3019607843, blue: 0.8588235294, alpha: 1) {
didSet {
self.setNeedsLayout()
}
}
@Aman2306
Aman2306 / CustomButton.swift
Created May 6, 2020 19:17
A Custom UIButton
import UIKit
@IBDesignable
class CustomButton: UIButton {
@IBInspectable var borderColor: UIColor? = UIColor.clearColor() {
didSet {
layer.borderColor = self.borderColor?.CGColor
}
}
@IBInspectable var borderWidth: CGFloat = 0 {