Skip to content
A neat little 'focus view' for iOS
Objective-C Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ExampleProject
MXLMediaView
.gitignore
LICENSE
MXLMediaView.podspec
README.md

README.md

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 or newer.

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:@"daft_punk@2x.jpg"] 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...

You can’t perform that action at this time.