iOS swift导航条添加按钮

// 在右侧添加一个按钮
let barButtonItem = UIBarButtonItem(title: "Next", style: UIBarButtonItemStyle.plain, target: self, action: #selector(showRank))
self.navigationItem.rightBarButtonItem = barButtonItem

你可能感兴趣的:(iOS swift导航条添加按钮)