Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #261, Access to UIImagePickerController Object #262

Open
wants to merge 117 commits into
base: develop
Choose a base branch
from

Conversation

brt-manishp
Copy link

In "showCamera()" there is a local variable called "picker" which I need it access to configure image picker for various use case. So I made a public optional variable of UIImagePickerController in "TLPhotosPickerConfigure" and used it in "showCamera()" with null check

Changes made are as follows in file named TLPhotosPickerViewController.swift

public struct TLPhotosPickerConfigure {
    .........
    public var uiimagePickerController: UIImagePickerController?  //line 99
    .........
}

// MARK: - Camera Picker  
extension TLPhotosPickerViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
..
..
..
..
private func showCamera() {  //line 595
    guard !maxCheck() else { return }
    if let picker = self.configure.uiimagePickerController {
        self.present(picker, animated: true, completion: nil)
    }else {
        let picker = UIImagePickerController()
        picker.sourceType = .camera
        picker.mediaTypes = [kUTTypeImage as String]
        if self.configure.allowedVideoRecording {
            picker.mediaTypes.append(kUTTypeMovie as String)
            picker.videoQuality = self.configure.recordingVideoQuality
            if let duration = self.configure.maxVideoDuration {
                picker.videoMaximumDuration = duration
            }
        }
        picker.allowsEditing = false
        picker.delegate = self
        self.present(picker, animated: true, completion: nil)
    }
}
..
..
..
..
}

tilltue and others added 30 commits August 28, 2018 07:34
Support for detection if TLPHAsset is created from camera using picker.
Creating Thread-Safe Dictionary
Issue #171 , #169 PR: #168
# Conflicts:
#	Example/TLPhotoPicker.xcodeproj/project.pbxproj
#	Example/TLPhotoPicker/Base.lproj/Main.storyboard
#	TLPhotoPicker/Classes/TLCollectionTableViewCell.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.