This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dropsahdow | |
extension UIView{ | |
func dropShadow(shadowColor: UIColor = UIColor.black, | |
fillColor: UIColor = UIColor.white, | |
opacity: Float = 0.2, | |
offset: CGSize = CGSize(width: 0.0, height: 1.0), | |
radius: CGFloat = 10) -> CAShapeLayer { | |
let shadowLayer = CAShapeLayer() | |
shadowLayer.path = UIBezierPath(roundedRect: self.bounds, cornerRadius: radius).cgPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Date { | |
public func toLabel(pattern: String = "HH:mm dd-MM-yy", locale: Locale = .current, abbreviation: String = "GMT") -> String { | |
let dateFormatter = DateFormatter() | |
dateFormatter.timeZone = TimeZone(abbreviation: abbreviation) | |
dateFormatter.locale = locale | |
dateFormatter.dateFormat = pattern | |
return dateFormatter.string(from: self) | |
} | |
} |