user2179936
user2179936

Reputation: 455

Hide UIBarButtonItem from UINavigationBar programatically Swift2

I've tried hiding the thing, but it just appears greyed out in UINavigationController

I found a delete method, but it asks to pass in Anyobject..

Button.delete(AnyObject?)

Upvotes: 1

Views: 292

Answers (1)

Sohel L.
Sohel L.

Reputation: 9540

You can remove the UIBarButtonItem. It's just one type of deallocating the item:

self.navigationItem.rightBarButtonItem = nil

self.navigationItem.leftBarButtonItem = nil

Upvotes: 3

Related Questions