EurekaCommunity / ImageRow

Eureka row that allows us to take or select a picture.
MIT License
101 stars 62 forks source link

useEditedImage = true fails #82

Open S-Waleed opened 4 years ago

S-Waleed commented 4 years ago

When using the following attributes <<< ImageRow() { row in row.title = "Profile Photo" row.sourceTypes = [.PhotoLibrary, .Camera, .SavedPhotosAlbum] row.allowEditor = true row.useEditedImage = true row.tag = "profilePhoto" row.cell.height = ({ return 200 }) row.add(rule: RuleRequired()) }

After selecting a photo it does not load the photo editor and the photo does not load in the row. When I set useEditedImage = false then photo loads as expected.

mats-claassen commented 4 years ago

Hi @masterwali could you please state the exact versions of ImageRow, Xcode and iOS? If somebody looks at this issue in the future, "latest" might not be very helpful.

Also, your code seems to work in the examples project on Xcode 11.4

S-Waleed commented 4 years ago

@mats-claassen Xcode: 11.3.1 Eureka: 5.2.0 ImageRow: 4.0.0 Swift: 5.0

robaac commented 4 years ago

I'm have this same problem. The editor does not appear after a photo is selected from the library.

The editor does appear after a photo is taken with the camera.

Xcode Version 11.4 (11E146) Eureka: 5.2.1 ImageRow 4.0.0

mats-claassen commented 4 years ago

I have no iPhone to test it at the moment but it works fine for me in the Example project on a simulator. Does the console tell you something about it?

robaac commented 4 years ago

Mathias,

No it doesn’t say anything or give any errors. It just returns me to the form. It was working once before without problem. I’m not sure with what update it stopped working (I don’t use that form very often).

I tried removing the imageRow pod and reinstalling it, I have not removed and reinstalled Eureka pod.

-Rob

On Apr 2, 2020, at 3:25 PM, Mathias Claassen notifications@github.com wrote:

I have no iPhone to test it at the moment but it works fine for me in the Example project on a simulator. Does the console tell you something about it?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EurekaCommunity/ImageRow/issues/82#issuecomment-608057890, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHOQ3F2R2SRHMZCCITIYAXDRKTRELANCNFSM4LUVSPUQ.

S-Waleed commented 4 years ago

@robaac I tried all that. I asked the same question and to no avail. So I redesigned my solution to use the ViewRow pod from Eureka which allows me to insert anything. Here's my working solution, plus the code from here to use a regular image picker https://theswiftdev.com/picking-images-with-uiimagepickercontroller-in-swift-5/

` <<< ViewRow() { row in row.title = "Photo" } .cellSetup { (cell, row) in // Construct the view for the cell cell.view = UIView(frame: CGRect(x: 0, y: 0, width: cell.frame.width, height: 130)) // Size of the picture self.photoImageView.frame = CGRect(x: (cell.frame.width - 100), y: cell.center.y, width: 130, height: 130) // default image self.profileImageView.image = UIImage(named: "defaultProfileImage") // my custom utilities class that holds loading picture function Utilities.loadUsersProfilePhoto(userId: Utilities.getCurrentUserId(), matchingUserId: Utilities.getCurrentUserId(), imageView: self.profileImageView)

            Utilities.makeImageRound(imageView: self.profileImageView)
            // Added tap functionality to the entire cell. 
            let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.selectProfileImage(tapGestureRecognizer:)))

            cell.isUserInteractionEnabled = true
            cell.addGestureRecognizer(tapGestureRecognizer)
            cell.addSubview(self.profileImageView)
        }`
joaodforce commented 4 years ago

this issue is related to this https://github.com/EurekaCommunity/ImageRow/issues/83#issuecomment-663328829

However it seems that compiling using the iOS 14 SDK fixes the issue.