I have found a good answer about this problem, look at here How to hide iOS7 UINavigationBar 1px bottom line
but i want to know how to implement it with swift, i've tried in this way
func findHairlineImageViewUnder(view:UIView!) {
if view is UIImageView && view.bounds.size.height <= 1.0 {
return view
}
var subview: UIView
for subview in view.subviews {
var imageView:UIImageView = self.findHairlineImageViewUnder(subview)
if imageView {
return imageView
}
}
}
i can't make it because the compiler told me
- 'UIView' is not convertible to ()
- cannot convert the expression's type 'AnyObject' to type 'UIImageView'
- Type 'UIImageView' does not conform to protocol 'BoooleanType'
i know why these errors came out but how can i fix it?