How to get image file size in Swift?

Please check the google for 1 kb to bytes it will be 1000. https://www.google.com/search?q=1+kb+%3D+how+many+bytes&oq=1+kb+%3D+how+many+bytes&aqs=chrome..69i57.8999j0j1&sourceid=chrome&ie=UTF-8 So while getting the proper size I’ve added multiple scenario by adding image in App Bundle and in photos in simulator. Well the image which I took from my Mac was of 299.0 KB. Scenario 1: Adding image to Application Bundle … Read more

How to make UIImagePickerController for camera and photo library at the same time in swift

Import UIImagePickerControllerDelegate and create a variable to assign UIImagePickerController var imagePicker = UIImagePickerController() and set imagePicker.delegate = self. Create an action sheet to display options for ‘Camera’ and ‘Photo library’. On your button click action: @IBAction func buttonOnClick(_ sender: UIButton) { self.btnEdit.setTitleColor(UIColor.white, for: .normal) self.btnEdit.isUserInteractionEnabled = true let alert = UIAlertController(title: “Choose Image”, message: nil, … Read more

UIImagePickerController and extracting EXIF data from existing photos

Have you took a look at this exif iPhone library? http://code.google.com/p/iphone-exif/ Gonna try it on my side. I’d like to get the GPS (geotags) coordinates from the picture that has been taken with the UIImagePickerController :/ After a deeper look, this library seems to take NSData info as an input and the UIImagePickerController returns a … Read more

UIImagePickerController not presenting in iOS 8

I think this is because in iOS 8, alert views and action sheets are actually presented view controllers (UIAlertController). So, if you’re presenting a new view controller in response to an action from the UIAlertView, it’s being presented while the UIAlertController is being dismissed. I worked around this by delaying the presentation of the UIImagePickerController … Read more

Cannot subscript a value of type ‘[String : Any]’ with an index of type ‘UIImagePickerController.InfoKey’

The signature of the method has changed in Swift 4.2 func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) and you have to write guard let selectedImage = info[.originalImage] as? UIImage else { fatalError(“Expected a dictionary containing an image, but was provided the following: \(info)”) } You can figure out such terminology changes yourself by … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)