Pulsing a Tab Item
Send Feedback

Glossary Item Box

Topic Overview

Purpose

This topic provides an overview of pulsing a tab item on the IGSlideTabView™ control, and using a code example to demonstrate its usage.

In this topic


Introduction

Pulsing a tab summary

Use pulses to draw attention to a tab item, when using the default tab view, by calling the pulseTab: method found on the IGSlideTabView. This method directs your focus on the tab item and generates a pulse effect, by repeatedly ramping the brightness of the tab item shape layer’s fill color down to 0.5 and then back up to 1.0 a total of 5 times.

When adopting the IGSlideTabViewDelegate protocol you may override or even cancel the pulse animation by using the slideTabView:tabPulsing: method. This method expects a return of either YES or NO indicating whether or not to allow the pulse. To override the animation, create your own attention grabbing effect inside the pulseTab: method and return NO.


Pulsing a Tab Item – Code Example

Description

The code example below creates and adds a tab item to the IGSlideTabView and then pulses the tab item after a 2 second delay.

Prerequisites

This code example requires the inclusion of the IG framework; details about how to add this framework are available in the Adding the IG Framework File topic.

Code

In Objective-C:

IGSlideTabView *slideTabView;
IGSlideTabItem *tabItem;
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    slideTabView = [[IGSlideTabView alloc] initWithFrame:self.view.bounds];
    slideTabView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
    [self.view addSubview:slideTabView];
    tabItem = [IGSlideTabItem tabWithLocation:IGSlideTabLocationBottom title:@"Example" tabView:nil contentView:nil];
    tabItem.contentSize = [IGSlideTabContentSize sizeWithPercentageWidth:0.3 percentageHeight:0.3];
    [slideTabView addTab:tabItem];
    [self performSelector:@selector(pulseTab) withObject:nil afterDelay:2.0];
}
- (void)pulseTab
{
    [slideTabView pulseTab:tabItem];
}

In C#:

IGSlideTabView slideTabView;
IGSlideTabItem tabItem;
public override void ViewDidLoad ()
{
      base.ViewDidLoad ();
      this.View.BackgroundColor = UIColor.White;
      
      slideTabView = new IGSlideTabView ();
      slideTabView.Frame = this.View.Bounds;
      slideTabView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
      this.View.Add (slideTabView);
      tabItem = new IGSlideTabItem ();
      tabItem.TabLocation = IGSlideTabLocation.IGSlideTabLocationBottom;
      tabItem.Title = "Example";
      tabItem.ContentSize = IGSlideTabContentSize.CreatePercentageSize (0.3f, 0.3f);
      slideTabView.AddTab(tabItem);
      this.PerformSelector (new MonoTouch.ObjCRuntime.Selector ("PulseTab"), null, 2.0f);
}
[Export("PulseTab")]
public void PulseTab()
{
      slideTabView.PulseTab (tabItem);
}

Related Content

Topics

The following topic provides additional information related to this topic.

Topic

Purpose

The topics in this group cover enabling, configuring, and using the IGSlideTabView control’s supported features.