Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
iosdec authored May 28, 2018
1 parent 68b9779 commit c539f6a
Show file tree
Hide file tree
Showing 4 changed files with 412 additions and 0 deletions.
19 changes: 19 additions & 0 deletions UIMedia.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// UIMedia.h
// UIMediaAlertController
//
// Created by R3V0 on 25/05/2018.
// Copyright © 2018 iosdec. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

@interface UIMedia : NSObject

@property (strong, nonatomic) UIImage *image;
@property (strong, nonatomic) NSURL *imageURL;
@property (strong, nonatomic) NSURL *videoURL;
@property (strong, nonatomic) UIImage *videoThumb;

@end
13 changes: 13 additions & 0 deletions UIMedia.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// UIMedia.m
// UIMediaAlertController
//
// Created by R3V0 on 25/05/2018.
// Copyright © 2018 iosdec. All rights reserved.
//

#import "UIMedia.h"

@implementation UIMedia

@end
53 changes: 53 additions & 0 deletions UIMediaAlertController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// UIMediaAlertController.h
// UIMediaAlertController
//
// Created by R3V0 on 25/05/2018.
// Copyright © 2018 iosdec. All rights reserved.
//

#import "UIMedia.h"
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <MobileCoreServices/UTCoreTypes.h>
#import <ImageIO/CGImageSource.h>
#import <ImageIO/CGImageProperties.h>

#define kUIM_MediaWidth 250
#define kUIM_MediaHeight 230
#define kUIM_LineSpacing 16.5

typedef enum {
MediaTypeImage = 0,
MediaTypeVideo = 1,
}MediaType;

@interface UIMediaAlertController : NSObject <UIImagePickerControllerDelegate, UINavigationControllerDelegate>

typedef void (^mediaPicked)(void);
typedef void (^mediaRemoved)(void);

@property (strong, nonatomic) UIViewController *controller;
@property (nonatomic, assign) MediaType type;
@property (strong, nonatomic) UIMedia *media;
@property (nonatomic, copy) mediaPicked picked;
@property (nonatomic, copy) mediaRemoved removed;
@property (nonatomic, assign) BOOL autoplayDisabled;
@property (nonatomic, assign) BOOL soundDisabled;
@property (strong, nonatomic) NSString *title;
@property (strong, nonatomic) NSString *message;
@property (strong, nonatomic) UIImageView *imageView;
@property (strong, nonatomic) UIView *videoView;
@property (strong, nonatomic) AVPlayer *playerRef;

// Presentation Options:

+ (void)presentWithType:(MediaType)type picked:(void(^)(void))picked;
+ (void)presentWithType:(MediaType)type picked:(void (^)(void))picked removed:(void(^)(void))removed;
+ (void)resetMedia;
- (void)presentWithType:(MediaType)type picked:(void(^)(void))picked;
- (void)presentWithType:(MediaType)type picked:(void(^)(void))picked removed:(void(^)(void))removed;
- (void)resetMedia;

@end
Loading

0 comments on commit c539f6a

Please sign in to comment.