以下は、トップのみ罫線を引く例です。 func drawTopBorder(borderWidth: CGFloat, borderColor: UIColor) { var border = CALayer(layer: self.layer) border.frame = CGRectMake(0.0, 0.0, self.frame.size.width, borderWidth) border.backgroundColor = borderColor.CGColor self.layer.addSublayer(border) }
