Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

useEditedImage = true fails #82

Open
S-Waleed opened this issue Mar 27, 2020 · 7 comments
Open

useEditedImage = true fails #82

S-Waleed opened this issue Mar 27, 2020 · 7 comments

Comments

@S-Waleed
Copy link

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())
}

  • Environment:
    ImageRow: latest, Xcode: latest and iOS version: latest stable

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
Copy link
Member

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
Copy link
Author

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

@robaac
Copy link

robaac commented Apr 2, 2020

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
Copy link
Member

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
Copy link

robaac commented Apr 2, 2020 via email

@S-Waleed
Copy link
Author

S-Waleed commented Apr 3, 2020

@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
Copy link
Contributor

joaodforce commented Oct 19, 2020

this issue is related to this #83 (comment)

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

joaodforce added a commit to joaodforce/ImageRow that referenced this issue Oct 19, 2020
mats-claassen pushed a commit that referenced this issue Oct 21, 2020
* Fixes for #83 and #82

* Chaged it so row.value is set only Once
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants