exyte / fan-menu

Menu with a circular layout based on Macaw
MIT License
728 stars 58 forks source link

Use remote image (from url) in the menu? #15

Closed siyao1030 closed 6 years ago

siyao1030 commented 6 years ago

Thanks for the awesome framework!

I looked through the FanMenu code and it seems like it is using the image's name to load an local UIImage for the animation.

Is this a hard requirement by Macaw? Is it possible to use an UIImageView as a buttonItem where I handle the loading of the image from url?

Thank you!

zapletnev commented 6 years ago

Thanks for using FanMenu! Unfortunately, you can't use UIImageView as buttonItem because of UI based on the Macaw model.

I think the best option now is to put all images inside imagesMap:

https://github.com/exyte/Macaw/blob/ff7c3e2df7f41ff5f55af717925395e5be07f19b/Source/utils/UIImage2Image.swift#L15

And after init items with src using memory://imageId scheme. Please check https://github.com/exyte/Macaw/blob/ff7c3e2df7f41ff5f55af717925395e5be07f19b/Source/model/scene/Image.swift#L142

zapletnev commented 6 years ago

I hope this solution helped you. Closing this issue for now. Please let me know if any questions remain.