Skip to content

Instantly share code, notes, and snippets.

@chaitanyaSoni96
Created June 14, 2019 11:04
Show Gist options
  • Save chaitanyaSoni96/908cad132251de81e368e7c03e6dfb0c to your computer and use it in GitHub Desktop.
Save chaitanyaSoni96/908cad132251de81e368e7c03e6dfb0c to your computer and use it in GitHub Desktop.
//topLeft Corner
nextCatBtn.backgroundColor = .clear
let nextBTNborderLayer = CAShapeLayer()
nextBTNborderLayer.fillColor = hexStringToUIColor(hex: "#DB3263").cgColor
nextBTNborderLayer.borderWidth = 2.0
let nextBtnBorderPath = UIBezierPath(roundedRect: previousCatBtn.bounds,
byRoundingCorners: [.topLeft],
cornerRadii: CGSize(width:10.0, height: 10.0))
nextBTNborderLayer.path = nextBtnBorderPath.cgPath
nextCatBtn.layer.insertSublayer(nextBTNborderLayer, at: 0)
//topRight Corner
previousCatBtn.backgroundColor = .clear
let prevBTNborderLayer = CAShapeLayer()
prevBTNborderLayer.fillColor = hexStringToUIColor(hex: "#DB3263").cgColor
prevBTNborderLayer.borderWidth = 2.0
let previousBtnBorderPath = UIBezierPath(roundedRect: previousCatBtn.bounds,
byRoundingCorners: [.topRight],
cornerRadii: CGSize(width:10.0, height: 10.0))
prevBTNborderLayer.path = previousBtnBorderPath.cgPath
previousCatBtn.layer.insertSublayer(prevBTNborderLayer, at: 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment