Xcode 9 beta compiler shows the following error for the navigationItem.title
and also for the self.navigationController?.navigationBar.topItem?.title
:
Ambiguous use of 'title'
This is my code:
self.title = BMLocalized("Select Number of Passengers")
navigationItem.title = navigationTitleString // here showing error
submitButton.setTitle(submitButtonTitle, for: .normal)
Can anyone help for solving this issue?
UPDATE:
Just use this code:
navigationItem.titleLabel.text = "text"
OLD ANSWER:
It happen because you use third party library which extends UINavigationItem class and reimplements property title. So, this library conflict with UIKit.
Solution:
Just use
title
instead of
navigationItem.title
Or remove extension of UINavigationItem class in the third-party library. The name of this library you can see in the issue navigator:
For MATERIAL solution is:
remove from Material -> Core -> NavigationItem.swift those lines:
public var title: String? {
get {
return titleLabel.text
}
set(value) {
titleLabel.text = value
navigationItem.reload()
}
}