SwiftSVG
SwiftSVG copied to clipboard
Image is displayed way too big
Description of the Issue I have an SVG image which I load from a URL and position with programmatically with translatesAutoresizingMaskIntoConstraints = false and NSLayoutConstraints. If I use a usual UIImageView (with a static rendered image) then everything is fine. Using an SVGView creates the mentioned problem (see screenshot below).
Sample SVG https://www.patavinus.com/static/images/company-logos/5/logo.svg
Screenshots Using SVGView: https://pasteboard.co/ICdMugc.png Using UIImageView: https://pasteboard.co/ICdMPfA.png
@Schnodderbalken did you try setting boundingBox to your SVGView object?
eg.
let svgView = UIView(URL: url) { (svgLayer) in svgLayer.boundingBox = CGRect(x: 0, y: 0, width: 300, height: 300) }