The Band Mate iOS iPhone app template is the place to start to build your band or music portfolio app. We’ve looked at the best music apps on the market and built a template with a sleek, flat design, and complete focus on showing off the music, and sharing music. Band Mate template includes 8 key screens including a slick music player.
//
// MainViewController.m
// bandmate
//
// Created by MyAppTemplates. on 3/14/13.
// Copyright (c) 2013 MyAppTemplates. All rights reserved.
//
#import "MainViewController.h"
#import "AppDelegate.h"
#import "UICustomTabbarController.h"
#import "LoginViewController.h"
//#import "MusicViewController.h"
#import "MainProfileCell.h"
#import "MainMenuItemCell.h"
@interface MainViewController ()
@end
@implementation MainViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[self insertNavBarWithScreenName:STRDIC_MAIN];
[btnLogout setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
[self.view bringSubviewToFront:imgvwTopBG];
// Searchbar
searchbar = (UICustomSearchBar *)[[UICustomSearchBar alloc] viewFromStoryboard];
[searchbar setFrame:CGRectMake( -10, 22, 290, 41 )];
[searchbar.placeFolderLabel setText:[self.appDelegate getStringWithScreenName:STRDIC_MAIN withStringID:STRID_MAIN_SEARCH_PLCFLD]];
[searchbar setSearchBarTypeWith:YES];
searchbar.delegate = self;
[self.view addSubview:searchbar];
tabController = self.appDelegate.tabController;
CGRect originalFrm = tabController.view.frame;
[tabController.view setUserInteractionEnabled:NO];
[tabController.view setFrame:CGRectMake( 272, 0, originalFrm.size.width, originalFrm.size.height )];
[self.view addSubview:tabController.view];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction) btnlogout_click:(id)sender
{
[searchbar.keywordInputField resignFirstResponder];
[[NSNotificationCenter defaultCenter] postNotificationName:@"gotoLoginView" object:@"MainView"];
}
#pragma mark --
#pragma mark -- UITableViewDelegate Method --
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 4;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 42;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
int cellRow = [indexPath row];
UITableViewCell * cell = nil;
NSString *cellid = ( cellRow == 0 ) ? @"MainProfileCell" : @"MainMenuItemCell";
cell = [tableView dequeueReusableCellWithIdentifier:cellid];
if (cell == nil) {
if( cellRow == 0 )
cell = [[MainProfileCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid];
else
cell = [[MainMenuItemCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid];
[cell setSelectionStyle:UITableViewCellSelectionStyleBlue];
}
if ( cellRow == 0 ) {
[(MainProfileCell *)cell setCellContentWith:[self.appDelegate getStringWithScreenName:STRDIC_MAIN withStringID:STRID_MAIN_CELL_PROFILE]];
}
else {
if (cellRow == 1) {
[(MainMenuItemCell *)cell setCellContentWith:cellRow title:[self.appDelegate getStringWithScreenName:STRDIC_MAIN withStringID:STRID_MAIN_CELL_UPDATE]];
}
else if (cellRow == 2) {
[(MainMenuItemCell *)cell setCellContentWith:cellRow title:[self.appDelegate getStringWithScreenName:STRDIC_MAIN withStringID:STRID_MAIN_CELL_MUSIC]];
}
else if (cellRow == 3) {
[(MainMenuItemCell *)cell setCellContentWith:cellRow title:[self.appDelegate getStringWithScreenName:STRDIC_MAIN withStringID:STRID_MAIN_CELL_BLOG]];
}
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
int cellRow = [indexPath row];
if (cellRow == 0) {
[tabController setSelectedIndex:0];
}
else if (cellRow == 1) {
[tabController setSelectedIndex:1];
}
else if (cellRow == 2) {
[tabController setSelectedIndex:2];
}
else if (cellRow == 3) {
[tabController setSelectedIndex:3];
}
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3f];
[UIView setAnimationDelegate:self];
tabController.view.transform = CGAffineTransformMakeTranslation( -272, 0 );
[tabController.view setUserInteractionEnabled:YES];
[UIView commitAnimations];
}
#pragma mark --
#pragma mark -- UICustomSearchBarDelegate --
- (void) beginInputKeyword:(UICustomSearchBar *)searchBar
{
;
}
- (void) performSearching:(UICustomSearchBar *)searchBar keyword:(NSString *)keyword
{
;
}
@end