Skip to content

Instantly share code, notes, and snippets.

@Alos
Created May 5, 2013 04:36
Show Gist options
  • Save Alos/5519721 to your computer and use it in GitHub Desktop.
Save Alos/5519721 to your computer and use it in GitHub Desktop.
- (BOOL)tabView:(CPTabView)tabView shouldSelectTabViewItem:(CPTabViewItem )tabViewItem{
if([tabViewItem identifier] == "AddCharacterTabViewItem"){
tabCounter ++;
CPLog.trace("Tabview was add character, returning no");
var newCharacterSheetView = [[CharacterSheetView alloc] initWithFrame:CPRectMakeZero()];
var newCharacterViewTab = [[CPTabViewItem alloc] initWithIdentifier: tabCounter];
[newCharacterViewTab setLabel: @"New Character"];
[newCharacterViewTab setView: newCharacterSheetView];
[characterTabs insertTabViewItem: newCharacterViewTab atIndex: tabCounter];
return NO;
} else {
return YES;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment