Changing font color of UIBarButtonItem
Please try this
sortButton.setTitleTextAttributes([NSAttributedStringKey.foregroundColor : UIColor.white], for: .normal)
This should do the trick (if you have plain text)
let rightBarButtonItem = UIBarButtonItem(title: "Some text", style: .plain, target: self, action: #selector(someAction))
rightBarButtonItem.tintColor = UIColor.myMusicPurple
navigationItem.rightBarButtonItem = rightBarButtonItem