Easy and beautiful way for a user to pick content, files or images. Written in Objective C

Overview

##JVTImageFilePicker

Pod version

ImagePicker Icon

Description

ImageFilesPicker Is a butifuly designed UICompenent for uploading content

Preview from recent camera roll

Live Camera instant share!

Files upload via drop box, drive etc..

Checks for camera accessibility, and adops UI presentation on live permission change.

Demo

JVTImagePicker Icon JVTImagePicker Icon

Usage

ImageFilesPicker works as a normal controller, just instantiate it and present it.

 self.filePicker = [[JVTImageFilePicker alloc] init];
 self.filePicker.delegate = self;
 [self.filePicker presentFilesPickerOnController:self];

ImageFilesPicker has two delegate methods that will inform you what the users are up to:

- (void)didPickFile:(NSData *)file
           fileName: (NSString *) fileName {
    NSLog(@"Did pick file");
}

- (void)didPickImage:(UIImage *)image
       withImageName:(NSString *) imageName {
    NSLog(@"Did pick image");
}

Installation

ImagePicker is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ImageFilesPicker'

Dont forget to enable icloud at Capabilities, for file sharing.

Author

Matan made this with ❤️ .

##License

Copyright 2013-2016 Jive Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Multiple Selection and Crash

    Multiple Selection and Crash

    Hi. Really nice and well-written control. Do you plan to add support for multiple images selection ?

    Also there's a crash Tried to run on simulator.

    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** Can't add a nil AVCaptureInput'
    *** First throw call stack:
    (
        0   CoreFoundation                      0x00000001092b1e65 __exceptionPreprocess + 165
        1   libobjc.A.dylib                     0x0000000108a28deb objc_exception_throw + 48
        2   AVFoundation                        0x0000000108e987fa -[AVCaptureSession _addInputWithNoConnections:] + 794
        3   AVFoundation                        0x0000000108e981a9 -[AVCaptureSession addInput:] + 96
        4   ImagePicker                         0x00000001084f7772 -[JVTCustomCameraView startCamera] + 210
        5   ImagePicker                         0x00000001084f7079 -[JVTCustomCameraView init] + 185
        6   ImagePicker                         0x00000001084e593d -[JVTRecetImagesCollection cameraStateAccessible] + 61
        7   ImagePicker                         0x00000001084e5838 __66-[JVTRecetImagesCollection checkForCameraAccesbiliyAnsAskIfNeeded]_block_invoke + 120
        8   ImagePicker                         0x00000001084e1aee +[JVTCameraAccesebility getCameraAccessibilityAndRequestIfNeeded:] + 334
        9   ImagePicker                         0x00000001084e576f -[JVTRecetImagesCollection checkForCameraAccesbiliyAnsAskIfNeeded] + 191
        10  ImagePicker                         0x00000001084e566c -[JVTRecetImagesCollection initWithFrame:withImagesToDisplay:] + 284
        11  ImagePicker                         0x00000001084deb5c __62-[JVTFilesPicker addCollectionImagesPreviewToSheetAndPresent:]_block_invoke + 476
        12  ImagePicker                         0x00000001084f6bd4 __43+[JVTRecentImagesProvider getRecentImages:]_block_invoke_4 + 52
        13  libdispatch.dylib                   0x000000010c43ce5d _dispatch_call_block_and_release + 12
        14  libdispatch.dylib                   0x000000010c45d49b _dispatch_client_callout + 8
        15  libdispatch.dylib                   0x000000010c4452af _dispatch_main_queue_callback_4CF + 1738
        16  CoreFoundation                      0x0000000109211d09 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
        17  CoreFoundation                      0x00000001091d32c9 __CFRunLoopRun + 2073
        18  CoreFoundation                      0x00000001091d2828 CFRunLoopRunSpecific + 488
        19  GraphicsServices                    0x000000010d966ad2 GSEventRunModal + 161
        20  UIKit                               0x000000010a248610 UIApplicationMain + 171
        21  ImagePicker                         0x00000001084f6f8f main + 111
        22  libdyld.dylib                       0x000000010c49192d start + 1
    )
    
    opened by timfreeman 5
  • ios 10 crash - after authorizing camera - LLSimpleCamera.h xcode 8.1

    ios 10 crash - after authorizing camera - LLSimpleCamera.h xcode 8.1

    screen shot 2016-12-07 at 6 38 45 am

    it might be better to extend dependency on this https://github.com/omergul123/LLSimpleCamera/blob/master/LLSimpleCamera.podspec

    screen shot 2016-12-07 at 6 42 21 am

    I can confirm this is blowing up with sample project too.

    I tried the solutions here - doesn't seem to help. http://stackoverflow.com/questions/38267608/requestaccessformediatype-crashing-in-ios-10

    opened by johndpope 3
  • Enhancements and Fix

    Enhancements and Fix

    1. Send renamed to "Select"
    2. Dismiss Photo Library Picker when Select is tapped on Image Preview Screen
    3. Add a property "isFilePickerEnabled" to enable / disable the File Picker.
    opened by ispiropoulos 2
  • ios10 - crashes on JVTImageFilePicker on iPad

    ios10 - crashes on JVTImageFilePicker on iPad

    
    - (void)uploadFilePress {
        UIDocumentMenuViewController *documentMenuViewController = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[ (__bridge NSString *)kUTTypeItem ] inMode:UIDocumentPickerModeImport];
        documentMenuViewController.delegate = self;
        
        [self.presentedFromController presentViewController:documentMenuViewController animated:YES completion:nil];
    }
    

    found this related thread

    http://stackoverflow.com/questions/25759885/uiactionsheet-from-popover-with-ios8-gm

    JVTImageFilesPicker dismissed 2017-01-19 11:28:17.150 FieldStorm[48709:9131769] Presenting view controllers on detached view controllers is discouraged <SFEntityRelatedListVC: 0x7d422600>. 2017-01-19 11:28:17.152117 FieldStorm[48709:9131769] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction 2017-01-19 11:28:22.504 FieldStorm[48709:9131769] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Your application has presented a UIDocumentMenuViewController (<UIDocumentMenuViewController: 0x7e018a90>). In its current trait environment, the modalPresentationStyle of a UIDocumentMenuViewController with this style is UIModalPresentationPopover. You must provide location information for this popover through the view controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the view controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.' *** First throw call stack: ( 0 CoreFoundation 0x0803ebf2 __exceptionPreprocess + 194 1 libobjc.A.dylib 0x07070e66 objc_exception_throw + 52 2 UIKit 0x0531706d -[UIPopoverPresentationController presentationTransitionWillBegin] + 3922 3 UIKit 0x048e3abd __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 2843 4 UIKit 0x048e0a4d __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 513 5 UIKit 0x04916e06 __40+[UIViewController _scheduleTransition:]_block_invoke + 18 6 UIKit 0x0474612c _runAfterCACommitDeferredBlocks + 348 7 UIKit 0x047309a2 _cleanUpAfterCAFlushAndRunDeferredBlocks + 624 8 UIKit 0x047670df _afterCACommitHandler + 190 9 CoreFoundation 0x07fdd98e CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 30 10 CoreFoundation 0x07fdd8e7 __CFRunLoopDoObservers + 391 11 CoreFoundation 0x07fc1556 __CFRunLoopRun + 1414 12 CoreFoundation 0x07fc0d5b CFRunLoopRunSpecific + 395 13 CoreFoundation 0x07fc0bbb CFRunLoopRunInMode + 123 14 GraphicsServices 0x095f2b4c GSEventRunModal + 177 15 GraphicsServices 0x095f29c7 GSEventRun + 80 16 UIKit 0x04737ff3 UIApplicationMain + 148 17 FieldStorm 0x00063b62 main + 482 18 libdyld.dylib 0x08571799 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

    opened by johndpope 1
  • enhancement - resize image on callback

    enhancement - resize image on callback

    UIImage+Resize

    https://github.com/coryalder/UIImage_Resize/blob/Standalone/UIImage%2BResize.h

    Background - I am using a similar method in another imagepicker library. It helps me reduce file sizes when uploading image picked. Your image picker is used so much through app - it becomes a bit of a pain to wrap. Ideally - I want to specify width / height for image to be resized. I tried subclassing - but the actionsheet is private.

    @interface NewImagePickerController :JVTImageFilePicker @property(nonatomic, assign) CGFloat width; @property(nonatomic, assign) CGRect rect; @property(nonatomic, assign) BOOL resize; @property(nonatomic, assign) UIViewController *delegate; @end

    • (void) resizeImageInBackground:(UIImage *)originalImage { @autoreleasepool { NSLog(@"resizeImageInBackground"); @try { if (self.width > 0) { CGSize size = CGSizeMake(self.width, self.width * originalImage.size.height / originalImage.size.width); NSLog(@"Original: %f,%f Resized: %f,%f", originalImage.size.width, originalImage.size.height, size.width, size.height); UIImage *resizedImage = [originalImage resizedImage:size interpolationQuality:kCGInterpolationHigh]; if (resizedImage != nil) { [self dispatchSelector:@selector(imagePickerDidFinish:image:) target:self.delegate objects:self, resizedImage, nil]; } else { [self dispatchSelector:@selector(imagePickerDidFinish:image:) target:self.delegate objects:self, originalImage, nil]; } } else { [self dispatchSelector:@selector(imagePickerDidFinish:image:) target:self.delegate objects:self, originalImage, nil]; } } @catch (NSException *e) { NSLog(@"NSException: %@", e); [self dispatchSelector:@selector(imagePickerDidFinish:image:) target:self.delegate objects:self, originalImage, nil]; } } }
    opened by johndpope 1
  • Appdelegate and main.m are included in the cocoapod.

    Appdelegate and main.m are included in the cocoapod.

    Thanks for this library. Just an fyi - Appdelegate and main.m are included in the cocoapod. This is not usual behavior. These files should be excluded. In xcode 8 - these are causing naming collisions.

    opened by johndpope 1
  • Can not call - (void)didDismissFilesPicker

    Can not call - (void)didDismissFilesPicker

    Touching the "cancel" button-The (void) didDismissFilesPicker method is not called.

    And i find it


    JVTActionSheetAction *cancel = [JVTActionSheetAction actionWithTitle:cancelTxt actionType:kActionType_cancel handler:^(JVTActionSheetAction *action) { @strongify(self); [self dismissPresentedControllerAndInformDelegate:nil]; }];

    • (void)dismissPresentedControllerAndInformDelegate:(UIViewController *)presentedController { [presentedController dismissViewControllerAnimated:YES completion:^(void) { [self updateDelegateOnDissmiss]; }]; }

    I need to receive an event when the window is closed. Please fix it.

    Thank's

    opened by HongEuiChan 1
  • Unable to read the license file

    Unable to read the license file

    Constantly getting on each pod install/update

    Unable to read the license file ...Pods/ImageFilesPicker/LICENSE for the spec ImageFilesPicker (0.2.1)

    opened by dzmitry-sazanovich-epam 0
Owner
Matan Abravanel
Software Engineer At Melio http://stackoverflow.com/users/3238178/mcmatan
Matan Abravanel
Swift library that makes easier to serialize the user's preferences (app's settings) with system User Defaults or Property List file on disk.

PersistentStorageSerializable PersistentStorageSerializable is a protocol for automatic serialization and deserialization of Swift class, struct or NS

Ivan Rublev 163 Jun 3, 2021
A property wrapper for displaying up-to-date database content in SwiftUI views

@Query Latest release: November 25, 2021 • version 0.1.0 • CHANGELOG Requirements: iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 6.0+ • Swift 5.5+ /

Gwendal Roué 102 Dec 29, 2022
How to use the Zeit Online Content API with Swift 4

ZeitSuche_iOS Version 1.4.0 - September 12, 2018 This iOS app (iPhone) shows how to use the Zeit Online Content API with Swift 4. To test this app you

Bodo Schönfeld 3 Dec 7, 2022
Classes-and-structures-in-swift - This source files show what is the difference between class and structure

This source files show what is the difference between class and structure You ca

null 0 Jan 4, 2022
StorageManager - FileManager framework that handels Store, fetch, delete and update files in local storage

StorageManager - FileManager framework that handels Store, fetch, delete and update files in local storage. Requirements iOS 8.0+ / macOS 10.10+ / tvOS

Amr Salman 47 Nov 3, 2022
A library that provides the ability to import/export Realm files from a variety of data container formats.

Realm Converter Realm Converter is an open source software utility framework to make it easier to get data both in and out of Realm. It has been built

Realm 212 Dec 9, 2022
macOS WeChat.app header files version history (automatic updated)

macos-wechat-app-tracker macOS WeChat.app header files version history (automatic updated) Troubleshooting $ class-dump -H /Applications/WeChat.app 20

Wechaty 3 Feb 10, 2022
Web server serving local files

swift-web A web server serving local static files. Installation Using Mint The easiest way to install swift-web is via mint. mint install adam-fowler/

Adam Fowler 10 Dec 10, 2022
An Objective-C wrapper for RocksDB - A Persistent Key-Value Store for Flash and RAM Storage.

ObjectiveRocks ObjectiveRocks is an Objective-C wrapper of Facebook's RocksDB - A Persistent Key-Value Store for Flash and RAM Storage. Current RocksD

Iskandar Abudiab 56 Nov 5, 2022
YapDB is a collection/key/value store with a plugin architecture. It's built atop sqlite, for Swift & objective-c developers.

YapDatabase is a collection/key/value store and so much more. It's built atop sqlite, for Swift & Objective-C developers, targeting macOS, iOS, tvOS &

Yap Studios 3.3k Dec 29, 2022
A Cocoa / Objective-C wrapper around SQLite

FMDB v2.7 This is an Objective-C wrapper around SQLite. The FMDB Mailing List: https://groups.google.com/group/fmdb Read the SQLite FAQ: https://www.s

August 13.7k Dec 28, 2022
macOS Sqlite tableView 샘플 - objective c

목적 Objective C언어를 이용하여 macOS를 개발해본다. Sqlite를 이용하여 데이터를 저장하고, 불러와본다. FMDB를 이용한다. 데이터를 NSTableView를 이용하여 불러와본다. 추가적으로 NSOutlineView 구현해본다. 추가적으로 KVOCont

HyunSu Park 0 Jan 10, 2022
A Generic CoreData Manager to accept any type of objects. Fastest way for adding a Database to your project.

QuickDB FileManager + CoreData ❗️ Save and Retrieve any thing in JUST ONE line of code ❗️ Fast usage dataBase to avoid struggling with dataBase comple

Behrad Kazemi 17 Sep 24, 2022
The hassle-free way to add Segment analytics to your Swift app (iOS/tvOS/watchOS/macOS/Linux).

Analytics-Swift The hassle-free way to add Segment analytics to your Swift app (iOS/tvOS/watchOS/macOS/Linux/iPadOS). Analytics helps you measure your

Segment 53 Dec 16, 2022
Safe and easy wrappers for common Firebase Realtime Database functions.

FirebaseHelper FirebaseHelper is a small wrapper over Firebase's realtime database, providing streamlined methods for get, set, delete, and increment

Quan Vo 15 Apr 9, 2022
Safe and easy wrappers for RealmSwift

RealmWrapper RealmWrapper is wrapper library for RealmSwift in realm-cocoa If you use RealmWrapper, you can easily use UI update through Notification

DongHee Kang 72 Nov 1, 2022
Realm GeoQueries made easy

RealmGeoQueries simplifies spatial queries with Realm Cocoa. In the absence of and official functions, this library provide the possibility to do prox

Marc Hervera 142 Jul 21, 2022
Easy direct access to your database 🎯

OHMySQL ★★ Every star is appreciated! ★★ The library supports Objective-C and Swift, iOS and macOS. You can connect to your remote MySQL database usin

Oleg 210 Dec 28, 2022
CRRateLimitTester - Simple Clash Royale Rate Limit Tester Written Using HummingBird and Swift

CRRateLimitTester Simple Clash Royale Rate Limit Tester Written Using HummingBir

Mahdi Bahrami 0 Jan 16, 2022