开源IM SDK即时通讯社交APP

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    _loginView = [[IMLoginView alloc] initWithFrame:self.view.bounds];
    
    [_loginView setDelegate:self];
    [[self view] addSubview:_loginView];
    

    
    if ([g_pIMMyself loginStatus] != IMMyselfLoginStatusNone) {
        IMRootViewController *controller = [[IMRootViewController alloc] init];
        
        [self addChildViewController:controller];
        [[self view] addSubview:controller.view];
    }
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logout) name:IMLogoutNotification object:nil];
    
}

编程技巧