ios - Black screen when tab bar is selected -
i having problem black screen when switch "friends" tab on application. happen because of friendsviewcontroller. know because removed link viewcontroller , presented me normal screen. hope can see have done wrong
friendsviewcontroller:
import uikit import fbsdkloginkit class friendsviewcontroller: uitabbarcontroller, uitableviewdelegate,uitableviewdatasource{ @iboutlet weak var tableview: uitableview! @iboutlet weak var friendtypeswitch: uisegmentedcontrol! @iboutlet weak var friendsearchbar: uitextfield! var user:user = user() override func viewdidload() { super.viewdidload() print("friends tab") // additional setup after loading view. } override func viewdidappear(_ animated: bool) { print("view did appear") } func tableview(_ tableview: uitableview, numberofrowsinsection section: int) -> int { return 30 } //what tableview func tableview(_ tableview: uitableview, cellforrowat indexpath: indexpath) -> uitableviewcell { let cell = self.tableview.dequeuereusablecell(withidentifier: "friendcell", for: indexpath) as! friendscustomcell user.username = "kulgut123" cell.friendname.text = user.username return cell } func tableview(_ tableview: uitableview, heightforrowat indexpath: indexpath) -> cgfloat { return uitableviewautomaticdimension } func tableview(_ tableview: uitableview, estimatedheightforrowat indexpath: indexpath) -> cgfloat { return uitableviewautomaticdimension } } class friendscustomcell: uitableviewcell{ @iboutlet weak var friendimg: uiimageview! @iboutlet weak var friendname: uilabel! }
as ronatory suggests, should subclass friendsviewcontroller uiviewcontroller instead of uitabbarcontroller.
class friendsviewcontroller: uiviewcontroller, uitableviewdelegate,uitableviewdatasource { //type code here }
Comments
Post a Comment