Sunday, June 3, 2012

What is the PastryKit Framework?


I'm trying to find any information I can on the PastryKit Javascript Framework. It appears to be in use on the iPhone User Guide that is displayed on the iPhone itself in Mobile Safari, but I cannot find any documentation or API. If you want to see it in action, open Safari 4, set your user agent to iPhone 3 (In the Develop menu) and check out the guide .



Overall, it seems to be a way to write an HTML/CSS/Javascript application that acts like a native iPhone app.



When it comes to Javascript, I used the JS Beautifier on (what I assume to be) the framework file and it was over 3,400 lines! Beautified, (again what I assume to be) their implementatio n of it was over 1,200 lines.



On the CSS side, I used Clean CSS on (again what I assume to be) the framework CSS , and it came out to over 700 lines. Their implementation was shy of 500.



Does anybody have, or know where to find, any information, documentation, or APIs on PastryKit? Or, can anybody figure out how to implement it?


Source: Tips4all

11 comments:

  1. John Gruber recently posted a link with some more information from his research over at Daring Fireball: http://daringfireball.net/2009/12/pastrykit

    EDIT: David Calhoun added a lot more in-depth information over at this blog: http://davidbcalhoun.com/2009/pastrykit-digging-into-an-apple-pie

    ReplyDelete
  2. To find more info, a UML, Full Decoded/Decompressed Source and Assets check out this entry:
    http://www.nxfx.com/blog/iphone-development/apples-pastry-kit-iphone-javascript-toolkit/

    ReplyDelete
  3. It would appear that PastyKit is also in use in iTunes LP files. Fascinating. Can't wait to learn more about this — sorry not to have more details!

    ReplyDelete
  4. In pursuance of PastryKit, I've discovered Sencha Touch. It's buttery smooth on the iPad. At this point in time, it is definitely more fluid than Apple's AdLib js lib (as used on the iPad User Guide site). Try their demoes on an actual iPad to have a real feel for the framework. It must be relatively new, because I find no mention of it among the other mobile JS libs.

    Testing for "smoothness" on my iPad, it beats:


    jQTouch
    PastryKit/TuneKit/AdLib
    WebApp.Net (mentioned in another post)


    IMO, WebApp.Net is the next most native-like when it come to scrolling, clicking, sliding, etc. These are the most serious competitors I've tested.

    Random sidenote: I'm a tad surprised Apple would name a mobile JS library PastryKit with Android's naming convention of desserts.

    Update 10/3/2010: The relationship between Sencha Touch and jQTouch explained by their developer, Sencha.

    ReplyDelete
  5. we just also added a bunch of Info on AdLib (The iPad version of Pastry kit)
    AdLib iPad JS Framework

    ReplyDelete
  6. this contact list sample webapp works as good as native app.
    check this out:
    the article http://cubiq.org/contact-list-on-webkit-for-iphone

    ReplyDelete
  7. A perennial problem with iPhone web development is disabling the vertical scrolling and bounce effects within a UIWebView. PastryKit can apparently disable this according to Wayne Pan. I haven't got it to work. You might be more competent.

    http://waynepan.com/2009/12/16/digging-into-pastrykit

    jqtouch also lets you disable vertical scrolling. Can't get it to work either.

    http://blog.jqtouch.com/post/285889760/turning-off-vertical-scrolling

    ReplyDelete
  8. It looks like I'm doing the same research into how the guide works and found this page.

    Apple's Dashcode product is supposed to generate web apps that looks like the iphone UI.. I don't know if that's where this code came from.

    If you're looking to duplicate the UI for a web-app, check out jqTouch.

    ReplyDelete
  9. This Post was my first followed link on a Google inquiry.

    You could simply grab the Stylesheets and JS files from the iPhone Guide and modify as needed. Everything is there - you'll just have to familiarize yourself with the code.

    I'm kind of digging how it all works together as well. But I'd want to remove the call ups that force the redirect if it's not an iPhone (or a User Agent hasn't been changed).

    Just implement some of it's functionality into a standard website - I love how it works in a desktop version of Safari.

    ReplyDelete
  10. JQTouch needs you to learn some JQuery if you do not already knows it. iUI is also a pretty nice framework which is really HTML5 / CSS3 / Javascript only. See a demo here http://iui-js.appspot.com/ (runs on Safari, Chrome, and more or less on Firefox too)

    ReplyDelete
  11. Been using http://webapp-net.com/ as a great framework for iphone web apps. Easy to use and stable...not as light as iui but easier and nicer presentation, Jq touch is heavy requiring JQuery. Did a bit of experimenting with all these frameworks before deciding to stick with webapp-net. There is also iWebkit but its not realy a webapp. More like native iPhone looking plain html.

    ReplyDelete