views:

3456

answers:

1

Hi all,

I'm looking for a small tutorial that can help me use svg images in iphone application. I'm trying to learn about svg format, and would love to know if there is relevant material from apple out there? particularly, w.r.t. iPhone.

Are there any open source libraries, or frameworks in iPhone SDK 3.0+ for SVG?

Any help is appreciated. Thanks. Mustafa

+3  A: 

The UIWebView class will render SVG files.

To demonstrate this, put your SVG file on the web somewhere and view it with Mobile Safari.

If you need a tutorial on how to use UIWebView, search Google on "UIWebView tutorial".

Alex Reynolds
I'm familiar with UIWebView, and a have gained a little knowledge of SVG as well. What i'm interested in is manipulating the image like zoom-in, zoom-out, rotate etc and capture which part of the image was clicked, double clicked, dragged. How can i do that? I was wondering if there are any libraries or Cocoa functions to facilitate these operations? Thank your for replying.
Mustafa
UIWebView supports stretch and pinch motions. As for other SVG geometric transformations, you might be able to call JavaScript to accomplish this.
Alex Reynolds
@Alex, can i return events like click from JS to my application (somehow)?
Mustafa
Maybe you can fire a link selection after a click event, which contains a custom scheme and is heard by the UIWebView delegate. See http://discussions.apple.com/thread.jspa?messageID=7731057 for a suggestion on how you might proceed. That's the only idea I have.
Alex Reynolds
"Getting Started With iPhone Web Applications" iPhone Tech Talk World Tour video also suggests a way. Around 54 minute, "Executing Native Code From Javascript". Thanks for your help.
Mustafa