Giter Club home page Giter Club logo

mxlmediaview's Introduction

MXLMediaView

This is a class designed to show a UIImage and blur & shrink the background. Similar to the Facebook app.

Compatibility

MXLMediaView uses UIKit Dynamics for the gravity effect so is only compatible with iOS 7 right now.

alt text

Usage

The only externa dependency is on Apple's UIImage+ImageEffects, which is included in this repo.

The process of showing an image in your app is dead simple. First import the class:

#import "MXLMediaView.h"

And then:

-(void)pushShowImageButton:(id)sender {
    MXLMediaView *mediaView = [[MXLMediaView alloc] init];
    [mediaView setDelegate:self];

    [mediaView showImage:[UIImage imageNamed:@"[email protected]"] inParentView:self.view completion:^{
      NSLog(@"Done showing MXLMediaView");
    }];
}

or to show a video...

-(void)pushShowVideoButton:(id)sender {
    MXLMediaView *mediaView = [[MXLMediaView alloc] init];
    [mediaView setDelegate:self];
    
    // The best video on the Internet.
    NSURL *videoURL = [NSURL URLWithString:@"http://website.com/video.mp4"];
    
    [mediaView showVideoWithURL:videoURL inParentView:self.navigationController.view completion:^{
        NSLog(@"Complete");
    }];
}

Delegate methods:

-(void)mediaView:(MXLMediaView *)mediaView didReceiveLongPressGesture:(id)gesture {
    NSLog(@"MXLMediaViewDelgate: Long pressed received");
}

-(void)mediaViewWillDismiss:(MXLMediaView *)mediaView {
    NSLog(@"MXLMediaViewDelgate: Will dismiss");
}

-(void)mediaViewDidDismiss:(MXLMediaView *)mediaView {
    NSLog(@"MXLMediaViewDelgate: Did dismiss");
}

Installation

MXLMediaView is now installable via Cocoapods!

pod 'MXLMediaView', '~> 1.1'

Licence

MIT. See LICENCE file for more info.

If you do use this in your app, send me a tweet!

Pitch

How much do you think this advanced open source project is worth? Wait just one minute before you answer!

Watch as MXLMediaView shows any image with just the call of a method! Now you can take any image you like and show it right in your app!

That's right, all these features for just... how much did you guess? $500? $1000? Even more?! No! It's just $0. That's right! It's incredible value but it's true! Order today PO Box MXL, GitHub, Chicago - Except in Nebraska...

mxlmediaview's People

Contributors

kiranpanesar avatar skeletongamer avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.