Latest 0.2.4
Homepage https://github.com/mercadolibre/MPTopFloatingView
License Apache License, Version 2.0
Platforms ios 7.0, requires ARC
Authors

Use this view to show new activities inside your app. Support iOS 7+.

Example

Demo

Usage

1. Import MPTopFloatingView class

#import <MPTopFloatingView/MPTopFloatingView.h>

2. Create an intance

self.newsView = [[MPTopFloatingView alloc] initTopFloatingViewWithDismissBlock:^(MPTopFloatingViewDismissCause cause) {
    if (cause == MPTopFloatingViewDismissCauseTap) {
        //View was tapped! Use this block to execute something..
    }
}];

Use one of this alternative initializer to customize the view

・More initializers
- (nonnull instancetype)initTopFloatingViewWithText:(nonnull NSString *)text color:(nonnull UIColor *)color icon:(nonnull UIImage *)icon dismissBlock:(MPTopFloatingViewDismissBlock)dismissBlock;
- (nonnull instancetype)initTopFloatingViewWithText:(nonnull NSString *)text color:(nonnull UIColor *)color timeToDismiss:(NSTimeInterval)timeToDismiss dismissBlock:(MPTopFloatingViewDismissBlock)dismissBlock;
- (nonnull instancetype)initTopFloatingViewWithText:(nonnull NSString *)text textFont:(nullable UIFont *)font textColor:(nullable UIColor *)textColor color:(nonnull UIColor *)color icon:(nonnull UIImage *)icon finalPosition:(float)finalPosition duration:(float)duration dismissBlock:(MPTopFloatingViewDismissBlock)dismissBlock;
- (nonnull instancetype)initTopFloatingViewWithText:(nonnull NSString *)text textFont:(nullable UIFont *)font textColor:(nullable UIColor *)textColor color:(nonnull UIColor *)color icon:(nonnull UIImage *)icon finalPosition:(float)finalPosition duration:(float)duration timeToDismiss:(NSTimeInterval)timeToDismiss dismissBlock:(MPTopFloatingViewDismissBlock)dismissBlock;

3. Include the view inside the hierarchy

[self.view addSubview:newsView];
// Setup contraints...

4. Use this method to start the animation

The parameter is the final state of the view after the animation

[newsView startAnimation:MPTopFloatingViewStatusAppear];

Author

Cristian Gibert

Latest podspec

{
    "name": "MPTopFloatingView",
    "version": "0.2.4",
    "summary": "Mercado Pago Top Floating View",
    "description": "Use this Pod to add a top floating view",
    "homepage": "https://github.com/mercadolibre/MPTopFloatingView",
    "license": "Apache License, Version 2.0",
    "authors": {
        "MPMobile": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mercadolibre/MPTopFloatingView.git",
        "tag": "0.2.4"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*.{h,m}",
    "resources": [
        "Pod/Resources/**/*.{xib}",
        "Pod/Assets/**/*.{xcassets}"
    ]
}

Pin It on Pinterest

Share This