简体   繁体   中英

fbLoginView in tableViewCell

I have a sideMenuControllerView. I am trying to create last cell of the sideMenuControllerTableView a facebook logout cell. I do the following in cellforRowAtIndexPath..

        FBLoginView *loginView = [[FBLoginView alloc] init];
        [cell.sideImage addSubview:loginView];
        loginView.delegate = self;

where cell is a custom SideMenuCell having a sideImage as a property.

I also put the FBLoginViewDelegate in SideMenuController.h. And I implemented the required functions. The only thing I am missing is in didSelectRowAtIndexPath I don't know how to call

loginViewShowingLoggedOutUser:(FBLoginView *)loginView

Any quick pointers ? Thanks!

Any particular reason you need to call this method? You only need to implement this function in your controller and take any actions that are needed when user logs out. Being a delegate method,it'll be called by facebook library functions when user logs out. The FBLoginView will display a button that'll show either "Login" if user is not logged in OR it'll show "Logout" if the user is already logged in.

If you're able to setup FBLoginView into cell, then you'll only need to implement its delegate which let you know when user LoggedOut or LoggedIn , in that way you can manage to show proper UI in your side menu. I don't aware of this so can't show you the code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM