= true let size:CGSize = subLayer.bounds.size var x:CGFloat = -10.0 var y:CGFloat = -10.0 let pathRef:CGMutablePath = CGMutablePath() pathRef.move(to: CGPoint(x: x, y: y)) x += size.width + 10.0 pathRef.addLine(to: CGPoint(x: x, y: y)) y += 10.0 pathRef.addLine(to: CGPoint(x: x, y: y)) x -= size.width pathRef.addLine(to: CGPoint(x: x, y: y)) y += size.height pathRef.addLine(to: CGPoint(x: x, y: y)) x -= 5.0 pathRef.addLine(to: CGPoint(x: x, y: y)) y -= size.height pathRef.addLine(to: CGPoint(x: x, y: y)) pathRef.closeSubpath() subLayer.shadowOffset = CGSize(width: 5, height: 5) subLayer.shadowColor = UIColor.black.cgColor subLayer.shadowOpacity = 0.5 subLayer.shadowPath = pathRef