9

I am using JSQMessageViewController and I am facing the issue (only in ios14) that i cant see media items like Images, Video and Audio in device though these views are generating debug view hierarchy. See below attached image:-

debug view hierarchy screenshot:

enter image description here

here is the description of UIImage inside collection view cell: <UIImageView: 0x7fe7d6d95b30; frame = (20 8; 177 131); clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x600001ce4ec0>>

here is the screenshot attached of screen:

enter image description here

You can see the view has generated space for image, but its not showing up!

Is anyone facing this issue? how can i solve this problem. This issue is occurring in iOS 14, it works perfectly in iOS 13.

koen
  • 5,383
  • 7
  • 50
  • 89
Ali Mehdi
  • 255
  • 5
  • 9
  • `JSQMessageViewController ` hasn't been updated for more than 4 years and is no longer supported. Maybe you can try `MessageKit` instead: https://github.com/MessageKit/MessageKit – koen Sep 21 '20 at 12:52

2 Answers2

23

You need to overwrite in JSQMessagesMediaViewBubbleImageMasker.m
method - (void)jsq_maskView:(UIView *)view withImage:(UIImage *)image and change line:

view.layer.mask = imageViewMask.layer;

to be

view.maskView = imageViewMask;

I suggest you to use category for that. For me that was solution.

Vladimir
  • 276
  • 3
  • 4
  • Thanks, @Vladimir This solution worked for me but I want to confirm that do we need to add a check for ```#available(iOS 14.0, *)``` before adding this line? – Dhaval Kansara Oct 15 '20 at 10:19
4

I would like to suggest to change like as follows along with the Vladimir answer for backward compatibility:

if (@available(iOS 14.0, *)) {
    view.maskView = imageViewMask;
} else {
    view.layer.mask = imageViewMask.layer;
}