SwiftyFORM icon indicating copy to clipboard operation
SwiftyFORM copied to clipboard

Avatar Row

Open justdan0227 opened this issue 3 years ago • 8 comments

is it possible to have an AVATAR or USER IMAGE row for settings where you would let the user click on the image to go to an image picker? I can handle the picker but not sure how to get a button of size X:Y as a row?

justdan0227 avatar Jul 04 '21 21:07 justdan0227

How would you prefer the api to be like? Example of code that would work best for you.

neoneye avatar Jul 05 '21 08:07 neoneye

Could be as easy as an extension to .botton where you could specify row height, pass image to be displayed and cropping / rounded corners and then I could handle image selection with something like YPImagePicker and then you would have a full user settings panel available

justdan0227 avatar Jul 06 '21 23:07 justdan0227

I'm confused.

  • Can you send a screenshot or a drawing of what it should look like?
  • Can you suggest a code snippet for what it ideally should be?

neoneye avatar Jul 07 '21 07:07 neoneye

So I implemented it with a custom cell and a callback!!! I'll package up and submit

CleanShot 2021-07-08 at 15 56 55@2x

justdan0227 avatar Jul 08 '21 20:07 justdan0227

Looks good.

Avatar row, this seems like a recurring ui pattern. However I don't think this should be a core control in SwiftyFORM, since it's subject to fashion changes. Perhaps some designers wants text side by side with the avatar. Perhaps different border styles.

Your avatar row will be a great addition to the example app. If it's ok with you, I may add your code to the example app. Maybe I make a few tweaks.

neoneye avatar Jul 09 '21 06:07 neoneye

@neoneye sounds good! If you want to add it to the example app, do you want me to push a branch? or just send you a snippit

justdan0227 avatar Jul 14 '21 13:07 justdan0227

You can mail me a snippet. Preferable a zip with something that compiles out of the box. I will extract the avatar code and insert it. My mail is [email protected]

neoneye avatar Jul 14 '21 13:07 neoneye

Hi @justdan0227 do you have an example that I could use?

allistoncarlos avatar Oct 19 '21 14:10 allistoncarlos