-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
412 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.