Setting the attributes for a navigation controller

When setting the attributes of a navigation bar, it’s common to set the attributes on the navigation bar. This was possible before iOS 13, but from this version onwards, we would need to use UINavigationBarAppearance which is an object for customizing the appearance of a navigation bar.

After creating a UINavigationBarAppearance object, use the methods and properties of this class to specify the appearance you want for items in the navigation bar. Use the inherited properties from UIBarAppearance to configure the background and shadow attributes of the navigation bar itself.

You can use the code snippet pasted above to customize your navigation bar.



Leave a Reply

Your email address will not be published. Required fields are marked *