gpt4 book ai didi

ios - Facebook 在 IOS 上登录但如果需要

转载 作者:行者123 更新时间:2023-11-29 03:27:11 25 4
gpt4 key购买 nike

在大多数有关 iOS 上 Facebook 登录的教程中,一旦启动应用程序,您就需要识别您的身份。我不希望登录 View 作为我的第一个 View 。

我的第一个 View 是一个菜单,用户可以在其中选择 3 个选项,如果他选择 n°3,那么他就可以登录 Facebook。

请问如何修改我的代码?

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// Function called to create a copy of the database if needed.
[self createCopyOfDatabaseIfNeeded];


self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];

/*
Here I create the root view controller, and a navigation
controller to contain it. I then set the window's root
controller equal to the navigation controller.
*/
LBRootViewController *rootViewController =
[[LBRootViewController alloc] init];

UINavigationController *navController =
[[UINavigationController alloc]
initWithRootViewController:rootViewController];

self.window.rootViewController = navController;


[self.window makeKeyAndVisible];

最佳答案

这很简单...但与您到目前为止放置在此处的应用程序委托(delegate)的编码没有太大关系...要执行您所描述的操作,需要在 View Controller 中处理 Facebook 登录您实际想要执行登录的点。

如果您使用 FBLoginView,为了防止用户从第一个屏幕登录,请勿放置:

- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView

代码位于初始 View Controller 中,因此它不会自动登录事件用户。我建议将这三个登录选择放在一个 View Controller 上,然后转换到另一个 View Controller 来处理实际的登录。

关于ios - Facebook 在 IOS 上登录但如果需要,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20305523/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com