Skip to content

Instantly share code, notes, and snippets.

//static consts from static class
static const int kSection1 = 0;
static const int kSection2 = 1;
static const int kSection3 = 2;
static const int kSection4 = 3;
//call to below function
NSDictionary * pageData = [[dataModel sharedInstance] getPageDataFromArray:kSection1 atIndex:0];
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
if (currentPageNumber != 4) {
NSLog(@"scrollViewDidEndDecelerating");
//find current page
currentPageNumber = (self.scrollView.contentOffset.x / 1024.0);
//set counter and load new view
counter = currentPageNumber;
NSDictionary *pageData = [self dataForPage:counter];
reactorsView = [[SupplyChainReactors alloc] initWithFrame:CGRectMake(0.0, 0.0, 1024.0, 500.0)];
[[self view] addSubview:reactorsView];
[reactorsView release];
reactorsView.alpha = 0;
[reactorsView fadeIn];
currSection = reactorsView;
}
-(void)stopBtnAnimations
{
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return 40;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
if(footerView == nil) {
footerView = [[[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 0.0, 0.0)] autorelease];
[footerView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[footerView setContentMode:UIViewContentModeTopLeft];
-(void) loadView {
UINavigationController * nav = [[UINavigationController alloc] initWithNibName:nil bundle:nil];
[self setNavController:nav];
nav.navigationBar.tintColor = [UIColor grayColor];// colorWithRed:0.3176f green:0.3568f blue:0.3647f alpha:1.0f];
CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.frame = CGRectMake(0.0, 0.0, 320.0, 44.0);
gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor whiteColor] CGColor], (id)[[UIColor colorWithRed:0.7843 green:0.7843 blue:0.7843 alpha:1.0] CGColor], nil];
[[[nav navigationBar] layer] insertSublayer:gradient atIndex:0];