How to create imageView click event in iOS?











up vote
0
down vote

favorite













Note:
ImageView Click event is available in Android, I Want to know whether it's available or not in iOS




I am new to iOS, please consider, I have camera image, OnClick of it I have to open my device camera, but I am getting function of Action for image. Attaching screenshot



sample



My code:



import UIKit

class AttendanceViewController: UIViewController {

@IBOutlet weak var loginimagebtn: UIImageView!
@IBOutlet weak var loginstatus: UITextView!
@IBOutlet weak var displayloginimg: UIImageView!

override func viewDidLoad() {
super.viewDidLoad()
}

func openCamer() {


if UIImagePickerController.isSourceTypeAvailable(
UIImagePickerControllerSourceType.camera) {

let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.camera
imagePicker.allowsEditing = false
self.present(imagePicker,animated: true,completion : nil)
}

}

// For Toast message below code
func showToast(message : String) {
let toastLabel = UILabel(frame: CGRect(x: self.view.frame.size.width/2 - 75, y: self.view.frame.size.height-100, width: 150, height: 35))
toastLabel.backgroundColor = UIColor.black.withAlphaComponent(0.6)
toastLabel.textColor = UIColor.white
toastLabel.textAlignment = .center;
toastLabel.font = UIFont(name: "Montserrat-Light", size: 12.0)
toastLabel.text = message
toastLabel.alpha = 1.0
toastLabel.layer.cornerRadius = 10;
toastLabel.clipsToBounds = true
self.view.addSubview(toastLabel)
UIView.animate(withDuration: 4.0, delay: 0.1, options: .curveEaseOut, animations: {
toastLabel.alpha = 0.0
}, completion: {(isCompleted) in
toastLabel.removeFromSuperview()
})
}
}









share|improve this question




















  • 1




    create the UIbutton (use setImage property) instead of UIimageview
    – Anbu.karthik
    Nov 19 at 8:49












  • @Anbu.karthik Thanks for you suggestion sir..let me check
    – Gowthaman M
    Nov 19 at 8:50










  • are you want only camera or else
    – Anbu.karthik
    Nov 19 at 8:50










  • @Anbu.karthik yes sir...I have code how to open camera take photos no pbm...I need botton click for imageview
    – Gowthaman M
    Nov 19 at 8:51






  • 1




    @Denis that is not fair. He says he is new to iOS. Reputation is not the benchmark for knowledge. You would also probably do the same if you were to code in Android or any other technology you are new to.
    – Rakesha Shastri
    Nov 19 at 9:19















up vote
0
down vote

favorite













Note:
ImageView Click event is available in Android, I Want to know whether it's available or not in iOS




I am new to iOS, please consider, I have camera image, OnClick of it I have to open my device camera, but I am getting function of Action for image. Attaching screenshot



sample



My code:



import UIKit

class AttendanceViewController: UIViewController {

@IBOutlet weak var loginimagebtn: UIImageView!
@IBOutlet weak var loginstatus: UITextView!
@IBOutlet weak var displayloginimg: UIImageView!

override func viewDidLoad() {
super.viewDidLoad()
}

func openCamer() {


if UIImagePickerController.isSourceTypeAvailable(
UIImagePickerControllerSourceType.camera) {

let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.camera
imagePicker.allowsEditing = false
self.present(imagePicker,animated: true,completion : nil)
}

}

// For Toast message below code
func showToast(message : String) {
let toastLabel = UILabel(frame: CGRect(x: self.view.frame.size.width/2 - 75, y: self.view.frame.size.height-100, width: 150, height: 35))
toastLabel.backgroundColor = UIColor.black.withAlphaComponent(0.6)
toastLabel.textColor = UIColor.white
toastLabel.textAlignment = .center;
toastLabel.font = UIFont(name: "Montserrat-Light", size: 12.0)
toastLabel.text = message
toastLabel.alpha = 1.0
toastLabel.layer.cornerRadius = 10;
toastLabel.clipsToBounds = true
self.view.addSubview(toastLabel)
UIView.animate(withDuration: 4.0, delay: 0.1, options: .curveEaseOut, animations: {
toastLabel.alpha = 0.0
}, completion: {(isCompleted) in
toastLabel.removeFromSuperview()
})
}
}









share|improve this question




















  • 1




    create the UIbutton (use setImage property) instead of UIimageview
    – Anbu.karthik
    Nov 19 at 8:49












  • @Anbu.karthik Thanks for you suggestion sir..let me check
    – Gowthaman M
    Nov 19 at 8:50










  • are you want only camera or else
    – Anbu.karthik
    Nov 19 at 8:50










  • @Anbu.karthik yes sir...I have code how to open camera take photos no pbm...I need botton click for imageview
    – Gowthaman M
    Nov 19 at 8:51






  • 1




    @Denis that is not fair. He says he is new to iOS. Reputation is not the benchmark for knowledge. You would also probably do the same if you were to code in Android or any other technology you are new to.
    – Rakesha Shastri
    Nov 19 at 9:19













up vote
0
down vote

favorite









up vote
0
down vote

favorite












Note:
ImageView Click event is available in Android, I Want to know whether it's available or not in iOS




I am new to iOS, please consider, I have camera image, OnClick of it I have to open my device camera, but I am getting function of Action for image. Attaching screenshot



sample



My code:



import UIKit

class AttendanceViewController: UIViewController {

@IBOutlet weak var loginimagebtn: UIImageView!
@IBOutlet weak var loginstatus: UITextView!
@IBOutlet weak var displayloginimg: UIImageView!

override func viewDidLoad() {
super.viewDidLoad()
}

func openCamer() {


if UIImagePickerController.isSourceTypeAvailable(
UIImagePickerControllerSourceType.camera) {

let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.camera
imagePicker.allowsEditing = false
self.present(imagePicker,animated: true,completion : nil)
}

}

// For Toast message below code
func showToast(message : String) {
let toastLabel = UILabel(frame: CGRect(x: self.view.frame.size.width/2 - 75, y: self.view.frame.size.height-100, width: 150, height: 35))
toastLabel.backgroundColor = UIColor.black.withAlphaComponent(0.6)
toastLabel.textColor = UIColor.white
toastLabel.textAlignment = .center;
toastLabel.font = UIFont(name: "Montserrat-Light", size: 12.0)
toastLabel.text = message
toastLabel.alpha = 1.0
toastLabel.layer.cornerRadius = 10;
toastLabel.clipsToBounds = true
self.view.addSubview(toastLabel)
UIView.animate(withDuration: 4.0, delay: 0.1, options: .curveEaseOut, animations: {
toastLabel.alpha = 0.0
}, completion: {(isCompleted) in
toastLabel.removeFromSuperview()
})
}
}









share|improve this question
















Note:
ImageView Click event is available in Android, I Want to know whether it's available or not in iOS




I am new to iOS, please consider, I have camera image, OnClick of it I have to open my device camera, but I am getting function of Action for image. Attaching screenshot



sample



My code:



import UIKit

class AttendanceViewController: UIViewController {

@IBOutlet weak var loginimagebtn: UIImageView!
@IBOutlet weak var loginstatus: UITextView!
@IBOutlet weak var displayloginimg: UIImageView!

override func viewDidLoad() {
super.viewDidLoad()
}

func openCamer() {


if UIImagePickerController.isSourceTypeAvailable(
UIImagePickerControllerSourceType.camera) {

let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.camera
imagePicker.allowsEditing = false
self.present(imagePicker,animated: true,completion : nil)
}

}

// For Toast message below code
func showToast(message : String) {
let toastLabel = UILabel(frame: CGRect(x: self.view.frame.size.width/2 - 75, y: self.view.frame.size.height-100, width: 150, height: 35))
toastLabel.backgroundColor = UIColor.black.withAlphaComponent(0.6)
toastLabel.textColor = UIColor.white
toastLabel.textAlignment = .center;
toastLabel.font = UIFont(name: "Montserrat-Light", size: 12.0)
toastLabel.text = message
toastLabel.alpha = 1.0
toastLabel.layer.cornerRadius = 10;
toastLabel.clipsToBounds = true
self.view.addSubview(toastLabel)
UIView.animate(withDuration: 4.0, delay: 0.1, options: .curveEaseOut, animations: {
toastLabel.alpha = 0.0
}, completion: {(isCompleted) in
toastLabel.removeFromSuperview()
})
}
}






ios swift uiimageview






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 at 11:03

























asked Nov 19 at 8:47









Gowthaman M

4,24051337




4,24051337








  • 1




    create the UIbutton (use setImage property) instead of UIimageview
    – Anbu.karthik
    Nov 19 at 8:49












  • @Anbu.karthik Thanks for you suggestion sir..let me check
    – Gowthaman M
    Nov 19 at 8:50










  • are you want only camera or else
    – Anbu.karthik
    Nov 19 at 8:50










  • @Anbu.karthik yes sir...I have code how to open camera take photos no pbm...I need botton click for imageview
    – Gowthaman M
    Nov 19 at 8:51






  • 1




    @Denis that is not fair. He says he is new to iOS. Reputation is not the benchmark for knowledge. You would also probably do the same if you were to code in Android or any other technology you are new to.
    – Rakesha Shastri
    Nov 19 at 9:19














  • 1




    create the UIbutton (use setImage property) instead of UIimageview
    – Anbu.karthik
    Nov 19 at 8:49












  • @Anbu.karthik Thanks for you suggestion sir..let me check
    – Gowthaman M
    Nov 19 at 8:50










  • are you want only camera or else
    – Anbu.karthik
    Nov 19 at 8:50










  • @Anbu.karthik yes sir...I have code how to open camera take photos no pbm...I need botton click for imageview
    – Gowthaman M
    Nov 19 at 8:51






  • 1




    @Denis that is not fair. He says he is new to iOS. Reputation is not the benchmark for knowledge. You would also probably do the same if you were to code in Android or any other technology you are new to.
    – Rakesha Shastri
    Nov 19 at 9:19








1




1




create the UIbutton (use setImage property) instead of UIimageview
– Anbu.karthik
Nov 19 at 8:49






create the UIbutton (use setImage property) instead of UIimageview
– Anbu.karthik
Nov 19 at 8:49














@Anbu.karthik Thanks for you suggestion sir..let me check
– Gowthaman M
Nov 19 at 8:50




@Anbu.karthik Thanks for you suggestion sir..let me check
– Gowthaman M
Nov 19 at 8:50












are you want only camera or else
– Anbu.karthik
Nov 19 at 8:50




are you want only camera or else
– Anbu.karthik
Nov 19 at 8:50












@Anbu.karthik yes sir...I have code how to open camera take photos no pbm...I need botton click for imageview
– Gowthaman M
Nov 19 at 8:51




@Anbu.karthik yes sir...I have code how to open camera take photos no pbm...I need botton click for imageview
– Gowthaman M
Nov 19 at 8:51




1




1




@Denis that is not fair. He says he is new to iOS. Reputation is not the benchmark for knowledge. You would also probably do the same if you were to code in Android or any other technology you are new to.
– Rakesha Shastri
Nov 19 at 9:19




@Denis that is not fair. He says he is new to iOS. Reputation is not the benchmark for knowledge. You would also probably do the same if you were to code in Android or any other technology you are new to.
– Rakesha Shastri
Nov 19 at 9:19












2 Answers
2






active

oldest

votes

















up vote
5
down vote



accepted










okay do the following step



Step -1



drag and drop UIbutton to the current viewcontroller



Step -2



delete the default title for your button



enter image description here



step-3



UIbutton has property Image --> go to image add your camera Image like follow and finally change the button frame based on your need



enter image description here



Step - 4



go to connection Inspector --> select your camera button event of Touch Up Inside and create the event for your button , for e.g



enter image description here



option - 2



if you want to proceed with your imageview I mean you dont want to proceed with UIButton then follow this code



 let cameraTap = UITapGestureRecognizer(target: self, action: #selector(cameraTapped))
displayloginimg.isUserInteractionEnabled = true
displayloginimg.addGestureRecognizer(cameraTap)


and handle the event for your imageview



 @objc func cameraTapped() {
// open your camera controller here
}





share|improve this answer






























    up vote
    6
    down vote













    You can achieve this functionality on UIImageView using UITapGestureRecognizer.
    Use below code in your viewDidLoad() method.



       override func viewDidLoad() {
    super.viewDidLoad()
    let tapGetsure = UITapGestureRecognizer(target: self,
    action: #selector(self.openCamer))
    tapGetsure.numberOfTapsRequired = 1
    loginimagebtn.gestureRecognizers = tapGetsure
    loginimagebtn.isUserInteractionEnabled = true
    }





    share|improve this answer





















    • Hi sir...can you tell me how to open front camera by default and please check my openCamer() function
      – Gowthaman M
      Nov 19 at 11:05










    • @GowthamanM Use imagePicker.cameraDevice = .front Thats all!!!
      – HPM
      Nov 19 at 11:10












    • thank you sir let me check once
      – Gowthaman M
      Nov 19 at 11:12










    • sry sir....where to keep this line,,,I kept wrong place I think so for it's NSInvalidArgumentException error please hel
      – Gowthaman M
      Nov 19 at 11:16










    • @GowthamanM Keep this after imagePicker.sourceType = UIImagePickerControllerSourceType.camera. Make sure you have added camera permission key in info.plist NSCameraUsageDescription
      – HPM
      Nov 19 at 11:18













    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371058%2fhow-to-create-imageview-click-event-in-ios%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote



    accepted










    okay do the following step



    Step -1



    drag and drop UIbutton to the current viewcontroller



    Step -2



    delete the default title for your button



    enter image description here



    step-3



    UIbutton has property Image --> go to image add your camera Image like follow and finally change the button frame based on your need



    enter image description here



    Step - 4



    go to connection Inspector --> select your camera button event of Touch Up Inside and create the event for your button , for e.g



    enter image description here



    option - 2



    if you want to proceed with your imageview I mean you dont want to proceed with UIButton then follow this code



     let cameraTap = UITapGestureRecognizer(target: self, action: #selector(cameraTapped))
    displayloginimg.isUserInteractionEnabled = true
    displayloginimg.addGestureRecognizer(cameraTap)


    and handle the event for your imageview



     @objc func cameraTapped() {
    // open your camera controller here
    }





    share|improve this answer



























      up vote
      5
      down vote



      accepted










      okay do the following step



      Step -1



      drag and drop UIbutton to the current viewcontroller



      Step -2



      delete the default title for your button



      enter image description here



      step-3



      UIbutton has property Image --> go to image add your camera Image like follow and finally change the button frame based on your need



      enter image description here



      Step - 4



      go to connection Inspector --> select your camera button event of Touch Up Inside and create the event for your button , for e.g



      enter image description here



      option - 2



      if you want to proceed with your imageview I mean you dont want to proceed with UIButton then follow this code



       let cameraTap = UITapGestureRecognizer(target: self, action: #selector(cameraTapped))
      displayloginimg.isUserInteractionEnabled = true
      displayloginimg.addGestureRecognizer(cameraTap)


      and handle the event for your imageview



       @objc func cameraTapped() {
      // open your camera controller here
      }





      share|improve this answer

























        up vote
        5
        down vote



        accepted







        up vote
        5
        down vote



        accepted






        okay do the following step



        Step -1



        drag and drop UIbutton to the current viewcontroller



        Step -2



        delete the default title for your button



        enter image description here



        step-3



        UIbutton has property Image --> go to image add your camera Image like follow and finally change the button frame based on your need



        enter image description here



        Step - 4



        go to connection Inspector --> select your camera button event of Touch Up Inside and create the event for your button , for e.g



        enter image description here



        option - 2



        if you want to proceed with your imageview I mean you dont want to proceed with UIButton then follow this code



         let cameraTap = UITapGestureRecognizer(target: self, action: #selector(cameraTapped))
        displayloginimg.isUserInteractionEnabled = true
        displayloginimg.addGestureRecognizer(cameraTap)


        and handle the event for your imageview



         @objc func cameraTapped() {
        // open your camera controller here
        }





        share|improve this answer














        okay do the following step



        Step -1



        drag and drop UIbutton to the current viewcontroller



        Step -2



        delete the default title for your button



        enter image description here



        step-3



        UIbutton has property Image --> go to image add your camera Image like follow and finally change the button frame based on your need



        enter image description here



        Step - 4



        go to connection Inspector --> select your camera button event of Touch Up Inside and create the event for your button , for e.g



        enter image description here



        option - 2



        if you want to proceed with your imageview I mean you dont want to proceed with UIButton then follow this code



         let cameraTap = UITapGestureRecognizer(target: self, action: #selector(cameraTapped))
        displayloginimg.isUserInteractionEnabled = true
        displayloginimg.addGestureRecognizer(cameraTap)


        and handle the event for your imageview



         @objc func cameraTapped() {
        // open your camera controller here
        }






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 19 at 9:25

























        answered Nov 19 at 9:01









        Anbu.karthik

        59.5k15121111




        59.5k15121111
























            up vote
            6
            down vote













            You can achieve this functionality on UIImageView using UITapGestureRecognizer.
            Use below code in your viewDidLoad() method.



               override func viewDidLoad() {
            super.viewDidLoad()
            let tapGetsure = UITapGestureRecognizer(target: self,
            action: #selector(self.openCamer))
            tapGetsure.numberOfTapsRequired = 1
            loginimagebtn.gestureRecognizers = tapGetsure
            loginimagebtn.isUserInteractionEnabled = true
            }





            share|improve this answer





















            • Hi sir...can you tell me how to open front camera by default and please check my openCamer() function
              – Gowthaman M
              Nov 19 at 11:05










            • @GowthamanM Use imagePicker.cameraDevice = .front Thats all!!!
              – HPM
              Nov 19 at 11:10












            • thank you sir let me check once
              – Gowthaman M
              Nov 19 at 11:12










            • sry sir....where to keep this line,,,I kept wrong place I think so for it's NSInvalidArgumentException error please hel
              – Gowthaman M
              Nov 19 at 11:16










            • @GowthamanM Keep this after imagePicker.sourceType = UIImagePickerControllerSourceType.camera. Make sure you have added camera permission key in info.plist NSCameraUsageDescription
              – HPM
              Nov 19 at 11:18

















            up vote
            6
            down vote













            You can achieve this functionality on UIImageView using UITapGestureRecognizer.
            Use below code in your viewDidLoad() method.



               override func viewDidLoad() {
            super.viewDidLoad()
            let tapGetsure = UITapGestureRecognizer(target: self,
            action: #selector(self.openCamer))
            tapGetsure.numberOfTapsRequired = 1
            loginimagebtn.gestureRecognizers = tapGetsure
            loginimagebtn.isUserInteractionEnabled = true
            }





            share|improve this answer





















            • Hi sir...can you tell me how to open front camera by default and please check my openCamer() function
              – Gowthaman M
              Nov 19 at 11:05










            • @GowthamanM Use imagePicker.cameraDevice = .front Thats all!!!
              – HPM
              Nov 19 at 11:10












            • thank you sir let me check once
              – Gowthaman M
              Nov 19 at 11:12










            • sry sir....where to keep this line,,,I kept wrong place I think so for it's NSInvalidArgumentException error please hel
              – Gowthaman M
              Nov 19 at 11:16










            • @GowthamanM Keep this after imagePicker.sourceType = UIImagePickerControllerSourceType.camera. Make sure you have added camera permission key in info.plist NSCameraUsageDescription
              – HPM
              Nov 19 at 11:18















            up vote
            6
            down vote










            up vote
            6
            down vote









            You can achieve this functionality on UIImageView using UITapGestureRecognizer.
            Use below code in your viewDidLoad() method.



               override func viewDidLoad() {
            super.viewDidLoad()
            let tapGetsure = UITapGestureRecognizer(target: self,
            action: #selector(self.openCamer))
            tapGetsure.numberOfTapsRequired = 1
            loginimagebtn.gestureRecognizers = tapGetsure
            loginimagebtn.isUserInteractionEnabled = true
            }





            share|improve this answer












            You can achieve this functionality on UIImageView using UITapGestureRecognizer.
            Use below code in your viewDidLoad() method.



               override func viewDidLoad() {
            super.viewDidLoad()
            let tapGetsure = UITapGestureRecognizer(target: self,
            action: #selector(self.openCamer))
            tapGetsure.numberOfTapsRequired = 1
            loginimagebtn.gestureRecognizers = tapGetsure
            loginimagebtn.isUserInteractionEnabled = true
            }






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 19 at 9:02









            HPM

            3069




            3069












            • Hi sir...can you tell me how to open front camera by default and please check my openCamer() function
              – Gowthaman M
              Nov 19 at 11:05










            • @GowthamanM Use imagePicker.cameraDevice = .front Thats all!!!
              – HPM
              Nov 19 at 11:10












            • thank you sir let me check once
              – Gowthaman M
              Nov 19 at 11:12










            • sry sir....where to keep this line,,,I kept wrong place I think so for it's NSInvalidArgumentException error please hel
              – Gowthaman M
              Nov 19 at 11:16










            • @GowthamanM Keep this after imagePicker.sourceType = UIImagePickerControllerSourceType.camera. Make sure you have added camera permission key in info.plist NSCameraUsageDescription
              – HPM
              Nov 19 at 11:18




















            • Hi sir...can you tell me how to open front camera by default and please check my openCamer() function
              – Gowthaman M
              Nov 19 at 11:05










            • @GowthamanM Use imagePicker.cameraDevice = .front Thats all!!!
              – HPM
              Nov 19 at 11:10












            • thank you sir let me check once
              – Gowthaman M
              Nov 19 at 11:12










            • sry sir....where to keep this line,,,I kept wrong place I think so for it's NSInvalidArgumentException error please hel
              – Gowthaman M
              Nov 19 at 11:16










            • @GowthamanM Keep this after imagePicker.sourceType = UIImagePickerControllerSourceType.camera. Make sure you have added camera permission key in info.plist NSCameraUsageDescription
              – HPM
              Nov 19 at 11:18


















            Hi sir...can you tell me how to open front camera by default and please check my openCamer() function
            – Gowthaman M
            Nov 19 at 11:05




            Hi sir...can you tell me how to open front camera by default and please check my openCamer() function
            – Gowthaman M
            Nov 19 at 11:05












            @GowthamanM Use imagePicker.cameraDevice = .front Thats all!!!
            – HPM
            Nov 19 at 11:10






            @GowthamanM Use imagePicker.cameraDevice = .front Thats all!!!
            – HPM
            Nov 19 at 11:10














            thank you sir let me check once
            – Gowthaman M
            Nov 19 at 11:12




            thank you sir let me check once
            – Gowthaman M
            Nov 19 at 11:12












            sry sir....where to keep this line,,,I kept wrong place I think so for it's NSInvalidArgumentException error please hel
            – Gowthaman M
            Nov 19 at 11:16




            sry sir....where to keep this line,,,I kept wrong place I think so for it's NSInvalidArgumentException error please hel
            – Gowthaman M
            Nov 19 at 11:16












            @GowthamanM Keep this after imagePicker.sourceType = UIImagePickerControllerSourceType.camera. Make sure you have added camera permission key in info.plist NSCameraUsageDescription
            – HPM
            Nov 19 at 11:18






            @GowthamanM Keep this after imagePicker.sourceType = UIImagePickerControllerSourceType.camera. Make sure you have added camera permission key in info.plist NSCameraUsageDescription
            – HPM
            Nov 19 at 11:18




















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371058%2fhow-to-create-imageview-click-event-in-ios%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Paul Cézanne

            UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

            Angular material date-picker (MatDatepicker) auto completes the date on focus out