Questions tagged [swiftsvg]

7 questions
1
vote
0 answers

UIImage from HTML data using SwiftSVG

I need to load an SVG from HTML data in Swift using the SwiftSVG framework. The HTML data looks like this:
jcdr04
  • 90
  • 1
  • 8
1
vote
0 answers

Conversion from SVG-xml to UIImage in Swift

Using Swift5 and Xcode-10.2, How can I get a UIImage from data that is represented in SVG-xml ? I tried to use SwiftSVG. Here is my code: import SwiftSVG let ui = UIView(SVGData: data) ui.frame = self.imgLogo.frame ui.contentMode =…
iKK
  • 6,394
  • 10
  • 58
  • 131
0
votes
1 answer

Can't get CALayer or UIView from SwiftSVG to render to UIImage with UIGraphicsImageRenderer()

I'm trying to render a CALayer from SwiftSVG package (on github) as a UIImage. It isn't working. Source .svg file defines a viewBox 1169 x 1000. If I add CALayer to UIView and add UIView (not UIImage) to view hierarchy, the SVG graphics are perfect,…
clearlight
  • 12,255
  • 11
  • 57
  • 75
0
votes
0 answers

How to parse Text element in SVG swift?

I am using PocketSVG, SwiftSVG and SVGKit libraries to parse SVG elements and convert into CALayer. But I don't know how to parse Text element and its attributes from SVG in swift. I want to get My Text string from below SVG text element. How can I…
Ali Akbar
  • 7
  • 5
0
votes
2 answers

How to fit CAShape Layer to UIImage View?

I am parsing SVG image file and convert it paths into CAShapeLayer, after that I am adding this CAShapeLayer to UIImage View's layer. It's work fine, but the problem is that it does not fit to the UIImage View. That's output. Image 1. That's code of…
0
votes
1 answer

How to hit multiple CAShapeLayer in swift?

I have got mutliple bezier paths which are incorporated into CAShapeLayers and then add all layers to UIImageView. I have implemented hittest to all layers for selection, But it select the last CAShapeLayer. I want to select others layer as touch,…
Ali Akbar
  • 7
  • 5
0
votes
2 answers

SwiftSVG doesn't display image

I'm working on a project which uses SVG-images and I have read that handling sag images isn't that easy with iOS. What I have already tried was this answer: How to display .svg image using swift. Where I changed the deprecated UIWebKit to WKWebKit,…
Benipro98
  • 183
  • 2
  • 14