am adding a border to my view like this:
func addBottomBorderWithColor(color: UIColor, width: CGFloat) {
let border = CALayer()
border.backgroundColor = color.cgColor
border.frame = CGRect(x: 0, y: self.frame.size.height, width: self.frame.size.width, height: width)
self.layer.addSublayer(border)
}
but strangley this works fine on Iphone 7 but in iphone 7 plus .. i will get this result:
as you can see there's a space at the beginning of the view's border.. why?
same thing is happening with view's shadow .. am doing it like this:
func dropShadow(scale: Bool = true) {
layer.shadowColor = UIColor.lightGray.cgColor
layer.shadowOpacity = 0.5
layer.shadowOffset = CGSize.zero
layer.shadowRadius = 1
layer.shadowPath = UIBezierPath(rect: bounds).cgPath
layer.shouldRasterize = true
layer.rasterizationScale = scale ? UIScreen.main.scale : 1
}
and getting space at the end of the view on iphone 7 plus
how to solve it?