0
在側面菜單tableview中有3個部分。第二部分中一行的值取決於登錄。基於登錄的Didselectrowatindexdexpath導航
情況1:用戶A登錄時,在第二部分中項目的是iAdmin
,Dashboard
,Tickets
..等
案例2:如果用戶B的日誌,在第二部分中項目的是Dashboard
,Tickets
等 即iAdmin
不會在
問題是在第2節中,如果用戶B登錄使用的是:我需要導航到特定頁面,當我在
這裏的門票點擊inspite無論用戶登錄的是代碼因爲它:
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
{
if indexPath.section==1 && indexPath.row==2
{
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let controller = storyboard.instantiateViewController(withIdentifier: "TicketsViewController") as! Tickets
let transition = CATransition()
transition.duration = 0.5
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
view.window!.layer.add(transition, forKey: kCATransition)
self.present(controller,animated: false,completion: nil)
}
Thankyou :) This was helpful –