let fullPath = UIBezierPath(rect: view.bounds) let tempPath = UIBezierPath(roundedRect: CGRect(x: 100, y: 100, width: 50, height: 50), cornerRadius: 16) fullPath.append(tempPath.reversing()) shapeLayer.path = fullPath.cgPath