CosmicMind / Material

A UI/UX framework for creating beautiful applications.
http://cosmicmind.com
MIT License
12k stars 1.26k forks source link

Modify the title with self.navigationItem.title doesn't work #702

Closed DamienLevel closed 6 years ago

DamienLevel commented 7 years ago

Hi everyone,

Thank you for your awesome lib !

I just want to use the ErrorTextField component in my app but since I've imported Material in my project, I can't change programmatically the title of my ViewController with self.navigationItem.title because your Extension override the variable title.

/// Title text.
@nonobjc
public var title: String? {
    get {
        return titleLabel.text
    }
    set(value) {
        titleLabel.text = value
        navigationItem.reload()
    }
}

I don't want to use self.title to modify the title of my UINavigationBar because I have also a tabBar and self.title modify the title of the tabBarItem.

What can I do ?

Thanks.

daniel-jonathan commented 7 years ago

On the next release, I will have an update for this. This conflict shouldn't exist. Thank you!

DamienLevel commented 7 years ago

Great, thank you @danieldahan ! I'll check that when the update will be released.

daniel-jonathan commented 7 years ago

Sorry, closed the wrong issue. This has been reopened.

daniel-jonathan commented 7 years ago

Linked issue https://github.com/CosmicMind/Material/issues/722, and a solution will be out shortly. Thank you!

daniel-jonathan commented 6 years ago

To avoid conflicts, the navigationItem.title and navigationItem.detail have been moved to navigationItem.titleLabel.text and navigationItem.detailLabel.text, respectively.