Swift + Parse: Facebook login flow has "Back to Safari" in iOS9 -
now, know button in status bar new feature of ios 9, how prevent showing "back safari" on left of status bar once user has logged in facebook ? see other apps not having issue, how go ensuring that not happen?
i can edit in code or more information if needed. want figure out.
as reply long put in comment textfield:
i used techniques in 1 of apps.
in appdelegate
write method example:
func builduserinterface(){ let objectid:string? = nsuserdefaults.standarduserdefaults().stringforkey("user_id") if objectid != nil { let mainstoryboard:uistoryboard = uistoryboard(name: "main", bundle: nil) let singlemode:singlemodevc = mainstoryboard.instantiateviewcontrollerwithidentifier("singlemodevc") as! singlemodevc let mainpagenav = uinavigationcontroller(rootviewcontroller: singlemode) let appdelegate:appdelegate = uiapplication.sharedapplication().delegate as! appdelegate appdelegate.window?.rootviewcontroller = mainpagenav } }
it can therefore used, when got user logged in or created.
in viewcontroller
handling regristration/loggin in within login block put this:
if pfuser.currentuser() != nil { objectid = pfuser.currentuser()?.objectid nsuserdefaults.standarduserdefaults().setobject(objectid, forkey: "user_id") nsuserdefaults.standarduserdefaults().synchronize() // singlemodevc let mainstoryboard:uistoryboard = uistoryboard(name: "main", bundle: nil) let singlemode:singlemodevc = mainstoryboard.instantiateviewcontrollerwithidentifier("singlemodevc") as! singlemodevc let mainpagenav = uinavigationcontroller(rootviewcontroller: singlemode) let appdelegate:appdelegate = uiapplication.sharedapplication().delegate as! appdelegate appdelegate.window?.rootviewcontroller = mainpagenav
singlemodevc name , class of view controller appear after signing in. hope helps.
Comments
Post a Comment