Get image file type programmatically in swift
问题 I am downloading images from parse with file totes PNG and JPEG. When image is downloaded to the app I need to determine what the file type is so I can handle image accordingly. Had a look at API for uiimageview and did a search but can't find any solution in swift. Any input appreciated Trying to get url from PFFIle §: let imageURLFromParse = NSURL(string : caseImageFile2.url); // Error here: 'NSURL?' does not have a member named 'pathExtension' if(imageURLFromParse.pathExtension!