How to check a file is video or image?
问题 I am developing a chat app using parse. I want to play the vodeo when users click on the video message and Display expandable image when the user click on the picture message. for that I need to differentiate image and video. Kindly guide me to do that... 回答1: Surely the easiest way will be of course to look at the file extension...? 回答2: For future googlers ... on didTapMessageBubbleAtIndexPath delegate you should check for item class let message = yourMessageArray[indexPath.item] if message