ios - How to let the user upload images - how can I test this feature properly? -
my code works , lets me pick image kind of default saved camera roll apple has built in on computer. if understand right - whenever person use app of course have connect personal phone.
my question is: i'm trying test app using photos computer instead of default photos apple provides (landscapes , pictures of waterfalls). there way can directly access folder on desktop when click browse files button (btnclicked
) , pull picture out of there?
here i'm using right now. how can manipulate need?
// custom image var imagepicker = uiimagepickercontroller(); @iboutlet weak var imageview: uiimageview! // button clicked image @ibaction func btnclicked(sender: anyobject) { if uiimagepickercontroller.issourcetypeavailable(uiimagepickercontrollersourcetype.savedphotosalbum){ print("button capture") imagepicker.delegate = self imagepicker.sourcetype = uiimagepickercontrollersourcetype.savedphotosalbum; imagepicker.allowsediting = false self.presentviewcontroller(imagepicker, animated: true, completion: nil) } } // view did load override func viewdidload() { super.viewdidload(); // additional setup after loading view. // set user's "hairstyle" userhairstylelab.text = hairstyle; } // did receive memory warning override func didreceivememorywarning() { super.didreceivememorywarning(); // dispose of resources can recreated. } func imagepickercontroller(picker: uiimagepickercontroller!, didfinishpickingimage image: uiimage!, editinginfo: [nsobject: anyobject]!){ self.dismissviewcontrolleranimated(true, completion: { () -> void in }) imageview.image = image }
Comments
Post a Comment