Search code examples
iosswift2uinavigationbardropshadow

How to add a shadow effect for UINavigation bar?


Do you have to add it programmatically? Or there is an option from the main.storyboard interface builder?and if there is a way from storyboard , How do you add it ?

Something like this : Example

Thanks


Solution

  • You would have to add it programatically.

    Do this in your UINavigationController Class

    self.navigationBar.shadowColor = UIColor.blackColor().CGColor
    self.navigationBar.shadowOffset = CGSizeMake(5, 5)
    self.navigationBar.shadowRadius = 5