ios - Handling Two Login Buttons -
i have login screen app uses facebook login , twitter login. want set if facebook used, users data saved through facebook, , if twitter used uses twitter information.
currently trying if statement profile images alone, doesnt seem working way want... using uibutton twitter login, , fbloginview built in class facebook sdk facebook login. here code snippet if statement in loginviewcontroller.m:
- (void)profilepicturechoose:(id)sender{ if (sender == twloginbutton){ theprofilepicture = twitterprofpicture; } else if(sender == fbloginbutton){ theprofilepicture = profpicture; } } i have fb login button linked fbloginbutton property , uibutton twitter liked property twloginbutton. these 2 properties saved in loginviewcontroller.has such:
@property (weak, nonatomic) iboutlet fbloginview *fbloginbutton; @property (strong, nonatomic) iboutlet uibutton *twloginbutton; i have these 2 properties profile pictures in same .h file:
@property (nonatomic) uiimage *profpicture; @property (nonatomic) uiimage *twitterprofpicture; with theprofilepicture variable using access picture controller.
i'm not sure how have if statement check correctly button clicked. if me appreciate it
what giving buttons tag?
fbloginbutton.tag = 1; twloginbutton.tag = 2; and modify profile picture method follows:
- (void)profilepicturechoose:(id)sender{ if (sender.tag == 1){ //facebook button theprofilepicture = profpicture; } else if(sender.tag == 2){ //twitter button theprofilepicture = twitterprofpicture; } } try out , tell me if helped you, or results of are.
Comments
Post a Comment