Search code examples
iosobjective-cxcodeuitableviewmessaging

TigerText simplest text conversation app


I downloaded TigerText Demo app from here and I opened it in xcode but its a huge app I just need conversation part or that single viewcontorller no need of login because I will pass that hard coded like this.

[[TTKit sharedInstance] loginWithUserId:@"username" password:@"password" 

  success:^(TTUser *user) { 
    // Handle login. 
  } failure:^(NSError *error) { 
    // Handle failure. 
  }];

After that there will be only one view where users will see there msgs. no login and not organization views required.


Solution

  • To display messages in 'ConversationViewController' you will first need a TTRosterEntry object (An object that represents a conversation), if you would like to load all TTRosterEntry objects regardless of their organization you can use this api

    NSFetchedResultsController *frc = [[TTKit sharedInstance] rosterFetchControllerForAllOrganizationsWithDelegate:self];
    NSArray *rostersForAllOrganizations = [frc fetchedObjects];
    

    Once you select a roster you can load 'ConversationViewController'

    ConversationViewController *conversation =  [GetAppDelegate.storyboard instantiateViewControllerWithIdentifier:@"ConversationViewController"];
    conversation.rosterEntry = rosterEntry;
    [self.navigationController pushViewController:conversation animated:YES];