Skip to content

Instantly share code, notes, and snippets.

View macram's full-sized avatar
💭
I may be slow to respond.

Manu Mateos macram

💭
I may be slow to respond.
View GitHub Profile
@macram
macram / innerShadow.swift
Last active June 4, 2018 11:26 — forked from r-plus/innerShadow.swift
inner shadow extension and playground. This is forked from another but updated to a more recent Swift version
import UIKit
import PlaygroundSupport
extension UIView {
public func addInnerShadow(topColor: UIColor = UIColor.black.withAlphaComponent(0.3)) {
let shadowLayer = CAGradientLayer()
shadowLayer.cornerRadius = layer.cornerRadius
shadowLayer.frame = bounds
shadowLayer.frame.size.height = 10.0
shadowLayer.colors = [