How to disable UIBarButtonItem?

You can disable the left navigation button from inside an UIViewController like this, without using any IBOutlet:

self.navigationItem.leftBarButtonItem.enabled = NO;

To disable the right navigation button:

self.navigationItem.rightBarButtonItem.enabled = NO;

Swift3

self.navigationItem.rightBarButtonItem?.isEnabled = false

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)