Giphy/giphy-ios-sdk

Remove media from GHMediaView

Closed this issue · 1 comments

Hi!

I am using GHMediaView to render GIFs in a forum style app I'm building and am calling mediaView.media = media to set the selected media.

I need to support users removing their selected media in case they no longer want to include the selected GIF in their forum post. However when I try mediaView.media = nil nothing happens and the gif is not cleared even when I call setNeedsLayout. I'm also not seeing other methods to clear the current gif used in GHMediaView.

How can I clear the selected media in GHMediaView?

hi @michelleyin96, we can address this in a future release. in the meantime you can try:

mediaView.image = nil 

I also might recommend only instantiating the GPHMediaView and adding to the view hierarchy after gif selection, and removing / deallocating the media view if the user intends to remove it.