PointDirection Constants Reference

Declared in CMPopTipView.h

PointDirection

Definition

typedef NS_ENUM(NSInteger, PointDirection ) {
   PointDirectionAny = 0,
   PointDirectionUp,
   PointDirectionDown,
};

Constants

PointDirectionAny

Display a speech bubble-like popup on screen, pointing at the designated view or button.

A UIView subclass drawn using core graphics. Pops up (optionally animated)
a speech bubble-like view on screen, a rounded rectangle with a gradient
fill containing a specified text message, drawn with a pointer dynamically
positioned to point at the center of the designated button or view.

Example 1 - point at a UIBarButtonItem in a nav bar:

- (void)showPopTipView {
    NSString *message = @"Start by adding a waterway to your favourites.";
    CMPopTipView *popTipView = [[CMPopTipView alloc] initWithMessage:message];
    popTipView.delegate = self;
    [popTipView presentPointingAtBarButtonItem:self.navigationItem.rightBarButtonItem animated:YES];

    self.myPopTipView = popTipView;
    [popTipView release];
}

- (void)dismissPopTipView {
    [self.myPopTipView dismissAnimated:NO];
    self.myPopTipView = nil;
}


#pragma mark CMPopTipViewDelegate methods
- (void)popTipViewWasDismissedByUser:(CMPopTipView *)popTipView {
    // User can tap CMPopTipView to dismiss it
    self.myPopTipView = nil;
}

Example 2 - pointing at a UIButton:

- (IBAction)buttonAction:(id)sender {
    // Toggle popTipView when a standard UIButton is pressed
    if (nil == self.roundRectButtonPopTipView) {
        self.roundRectButtonPopTipView = [[[CMPopTipView alloc] initWithMessage:@"My message"] autorelease];
        self.roundRectButtonPopTipView.delegate = self;

        UIButton *button = (UIButton *)sender;
        [self.roundRectButtonPopTipView presentPointingAtView:button inView:self.view animated:YES];
    }
    else {
        // Dismiss
        [self.roundRectButtonPopTipView dismissAnimated:YES];
        self.roundRectButtonPopTipView = nil;
    }
}

#pragma mark CMPopTipViewDelegate methods
- (void)popTipViewWasDismissedByUser:(CMPopTipView *)popTipView {
    // User can tap CMPopTipView to dismiss it
    self.roundRectButtonPopTipView = nil;
}

Declared In CMPopTipView.h.

PointDirectionUp

Display a speech bubble-like popup on screen, pointing at the designated view or button.

A UIView subclass drawn using core graphics. Pops up (optionally animated)
a speech bubble-like view on screen, a rounded rectangle with a gradient
fill containing a specified text message, drawn with a pointer dynamically
positioned to point at the center of the designated button or view.

Example 1 - point at a UIBarButtonItem in a nav bar:

- (void)showPopTipView {
    NSString *message = @"Start by adding a waterway to your favourites.";
    CMPopTipView *popTipView = [[CMPopTipView alloc] initWithMessage:message];
    popTipView.delegate = self;
    [popTipView presentPointingAtBarButtonItem:self.navigationItem.rightBarButtonItem animated:YES];

    self.myPopTipView = popTipView;
    [popTipView release];
}

- (void)dismissPopTipView {
    [self.myPopTipView dismissAnimated:NO];
    self.myPopTipView = nil;
}


#pragma mark CMPopTipViewDelegate methods
- (void)popTipViewWasDismissedByUser:(CMPopTipView *)popTipView {
    // User can tap CMPopTipView to dismiss it
    self.myPopTipView = nil;
}

Example 2 - pointing at a UIButton:

- (IBAction)buttonAction:(id)sender {
    // Toggle popTipView when a standard UIButton is pressed
    if (nil == self.roundRectButtonPopTipView) {
        self.roundRectButtonPopTipView = [[[CMPopTipView alloc] initWithMessage:@"My message"] autorelease];
        self.roundRectButtonPopTipView.delegate = self;

        UIButton *button = (UIButton *)sender;
        [self.roundRectButtonPopTipView presentPointingAtView:button inView:self.view animated:YES];
    }
    else {
        // Dismiss
        [self.roundRectButtonPopTipView dismissAnimated:YES];
        self.roundRectButtonPopTipView = nil;
    }
}

#pragma mark CMPopTipViewDelegate methods
- (void)popTipViewWasDismissedByUser:(CMPopTipView *)popTipView {
    // User can tap CMPopTipView to dismiss it
    self.roundRectButtonPopTipView = nil;
}

Declared In CMPopTipView.h.

PointDirectionDown

Display a speech bubble-like popup on screen, pointing at the designated view or button.

A UIView subclass drawn using core graphics. Pops up (optionally animated)
a speech bubble-like view on screen, a rounded rectangle with a gradient
fill containing a specified text message, drawn with a pointer dynamically
positioned to point at the center of the designated button or view.

Example 1 - point at a UIBarButtonItem in a nav bar:

- (void)showPopTipView {
    NSString *message = @"Start by adding a waterway to your favourites.";
    CMPopTipView *popTipView = [[CMPopTipView alloc] initWithMessage:message];
    popTipView.delegate = self;
    [popTipView presentPointingAtBarButtonItem:self.navigationItem.rightBarButtonItem animated:YES];

    self.myPopTipView = popTipView;
    [popTipView release];
}

- (void)dismissPopTipView {
    [self.myPopTipView dismissAnimated:NO];
    self.myPopTipView = nil;
}


#pragma mark CMPopTipViewDelegate methods
- (void)popTipViewWasDismissedByUser:(CMPopTipView *)popTipView {
    // User can tap CMPopTipView to dismiss it
    self.myPopTipView = nil;
}

Example 2 - pointing at a UIButton:

- (IBAction)buttonAction:(id)sender {
    // Toggle popTipView when a standard UIButton is pressed
    if (nil == self.roundRectButtonPopTipView) {
        self.roundRectButtonPopTipView = [[[CMPopTipView alloc] initWithMessage:@"My message"] autorelease];
        self.roundRectButtonPopTipView.delegate = self;

        UIButton *button = (UIButton *)sender;
        [self.roundRectButtonPopTipView presentPointingAtView:button inView:self.view animated:YES];
    }
    else {
        // Dismiss
        [self.roundRectButtonPopTipView dismissAnimated:YES];
        self.roundRectButtonPopTipView = nil;
    }
}

#pragma mark CMPopTipViewDelegate methods
- (void)popTipViewWasDismissedByUser:(CMPopTipView *)popTipView {
    // User can tap CMPopTipView to dismiss it
    self.roundRectButtonPopTipView = nil;
}

Declared In CMPopTipView.h.

Declared In

CMPopTipView.h