ios - How to display .svg image using swift -
i have .svg image file want display in project.
i tried using uiimageview, works .png & .jpg image formats, not .svg extension. there way display .svg image using uiwebview or uiimageview ?
try code
var path: string = nsbundle.mainbundle().pathforresource("nameoffile", oftype: "svg")! var url: nsurl = nsurl.fileurlwithpath(path) //creating url points towards our path //creating page request load our url (which points our path) var request: nsurlrequest = nsurlrequest(url: url) webview.loadrequest(request) //telling our webview load our above request
Comments
Post a Comment