Skip to content
New issue

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

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

Already on GitHub? # to your account

Question about improvement #3

Open
AdieOlami opened this issue Sep 26, 2018 · 6 comments
Open

Question about improvement #3

AdieOlami opened this issue Sep 26, 2018 · 6 comments
Labels
enhancement New feature or request

Comments

@AdieOlami
Copy link

Great work in all but is it possible to adapt this to a Storyboard design since you made the project without a storyboard. cheers

@eonist
Copy link
Owner

eonist commented Sep 27, 2018

@Kingolami yes. You would need to connect the storyboard views with iboutlets etc. Im going to pay attrntion to this lib in about a week, and i can Add a storyboard setup AS well. Should take aprox 30min

@AdieOlami
Copy link
Author

that is awesome. @eonist looking forward to it.

@Mitesh-Mewada
Copy link

Mitesh-Mewada commented Oct 29, 2018

@eonist i implement this code in storyboard, set UIView added class HybridCamView
when i click record button and change camera mode it's not working, Any idea how to resolve this problem.

`class Viewmains: UIViewController {

@IBOutlet weak var viewCamera: HybridCamView!
override func viewDidLoad() {
    super.viewDidLoad()
}
override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    CamUtil.assertVideoAndMicAccess(vc: self){ (success:Bool) in
        guard success else {return}
        DispatchQueue.main.async {
            self.initiate()
        }
    }
}
override var shouldAutorotate: Bool  {return false}/*Locks autorotate*/
override var preferredStatusBarStyle: UIStatusBarStyle { return .lightContent }

}
extension Viewmains{
/**
* Common init
*/
func initiate(){
let hybridCamView = HybridCamView()
// self.view = hybridCamView
//self.viewCamera.addSubview(hybridCamView)
hybridCamView.camView.onPhotoCaptureComplete = onCapture
hybridCamView.camView.onVideoCaptureComplete = {(url:URL?,error:Error?)in self.onCapture(nil,url,error)}
self.viewCamera.addSubview(hybridCamView)

}
/**
 * When camera onCapture is called
 */
private func onCapture(_ image:UIImage?,_ url:URL?,_ error:Error?) {
    let processMediaView = ProcessMediaView.init(frame: UIScreen.main.bounds)
    processMediaView.onExit = {processMediaView.deInitiate()}
    processMediaView.onShare = { (url:URL?) in if let url = url {ProcessMediaView.promptSaveFile(vc: self, url: url, onComplete: {processMediaView.deInitiate()})}}
    self.view.addSubview(processMediaView)
    if let error = error{
        ProcessMediaView.promptErrorDialog(vc: self, error: error, onComplete: {processMediaView.deInitiate()});return
    }else {
        
        processMediaView.present(image: image, url: url)
    }
}

}
`

@eonist
Copy link
Owner

eonist commented Oct 29, 2018

@Mitesh-Mewada Could be related to: #2 Im sure its a simple fix. Unfortunately I won't have time to test this bug until the weekend. I will add Carthage to the project and I can try to fix the bug. 👍

@eonist
Copy link
Owner

eonist commented Nov 18, 2018

@Mitesh-Mewada @Kingolami Added Carthage to HybridCam and separated the UI stuff so its easier to use IB or Autolayout.

@AdieOlami
Copy link
Author

Good work champ

@eonist eonist added the enhancement New feature or request label Nov 19, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants