<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Prototope</title>
    <description>Prototope is a project of &lt;a href=&quot;http://www.khanacademy.org/&quot;&gt;Khan Academy&lt;/a&gt;. &lt;br /&gt;&lt;a href=&quot;https://vine.co/v/M2UBYqeqzD6&quot;&gt;vroom vroom&lt;/a&gt;.
</description>
    <link>http://khan.github.io/Prototope/</link>
    <atom:link href="http://khan.github.io/Prototope/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 30 Mar 2015 19:06:11 +0000</pubDate>
    <lastBuildDate>Mon, 30 Mar 2015 19:06:11 +0000</lastBuildDate>
    <generator>Jekyll v2.4.0</generator>
    
      <item>
        <title>All aboard the 6.3 beta train!</title>
        <description>&lt;p&gt;That’s correct, the .dmg is barely cold and we’re already using the &lt;a href=&quot;https://developer.apple.com/membercenter/&quot;&gt;xcode 6.3 beta&lt;/a&gt;. With it, we’re happy to report vastly reduced SourceKit crashes, which makes editing scenes from within Xcode actually possible now.&lt;/p&gt;

&lt;p&gt;The second thing is some minor changes&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; to syntax.&lt;/p&gt;

&lt;p&gt;For the time being, it seems that trailing closures no longer behave the way they used to, so the syntax for adding Gestures and Animations is changing until that regression is fixed. Here is a diff of the old and new syntax (the red lines are the &lt;em&gt;old&lt;/em&gt; way):&lt;/p&gt;

&lt;h2 id=&quot;gestures&quot;&gt;Gestures&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-diff&quot; data-lang=&quot;diff&quot;&gt;&lt;span class=&quot;gd&quot;&gt;-  cloud.gestures.append(PanGesture { _, centroidSequenc in&lt;/span&gt;
&lt;span class=&quot;gi&quot;&gt;+  cloud.gestures.append(PanGesture( handler: { _, centroidSequenc in&lt;/span&gt;
           var finger: Point = centroidSequenc.currentSample.globalLocation
           self.cloudLayer.x = finger.x
           self.rainEmitter?.x = finger.x
&lt;span class=&quot;gd&quot;&gt;-  })&lt;/span&gt;
&lt;span class=&quot;gi&quot;&gt;+  })) // &amp;lt;-- notice the  trailing &amp;quot;)&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;the &lt;code&gt;handler: &lt;/code&gt; label isn’t strictly necessary, you can optionally write &lt;code&gt;PanGesture({_ in println(&quot;&quot;)})&lt;/code&gt; if that makes things easier for you.&lt;/p&gt;

&lt;h2 id=&quot;animations&quot;&gt;Animations&lt;/h2&gt;

&lt;p&gt;Dynamic animators are unaffected, but the traditional animators require passing the closure as an explicit argument to &lt;code&gt;Layer.animateWithDuration&lt;/code&gt;. Here’s an example&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-diff&quot; data-lang=&quot;diff&quot;&gt;&lt;span class=&quot;gd&quot;&gt;-     Layer.animateWithDuration(0.35, curve: .EaseInOut) {&lt;/span&gt;
&lt;span class=&quot;gi&quot;&gt;+     Layer.animateWithDuration(0.35, curve: .EaseInOut, animations: {&lt;/span&gt;
           self.spinnyLayer.rotationDegrees = 0
&lt;span class=&quot;gd&quot;&gt;-     }&lt;/span&gt;
&lt;span class=&quot;gi&quot;&gt;+     }) // &amp;lt;-- notice the  trailing &amp;quot;)&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;other-bits-we-learned&quot;&gt;Other bits we learned&lt;/h2&gt;

&lt;p&gt;One of the most befuddling changes was that members of &lt;code&gt;@objc&lt;/code&gt; private classes now need to be explicitly tagged &lt;code&gt;@objc&lt;/code&gt; individually. For example, ohaiprototope’s scene view controller’s data source was giving the useless &lt;em&gt;“Type does not conform to protocol UITableViewDataSource”&lt;/em&gt; error even though it was implementing all the required methods.&lt;/p&gt;

&lt;p&gt;There’s an &lt;strong&gt;even more insidious error&lt;/strong&gt; which &lt;a href=&quot;https://twitter.com/andy_matuschak&quot;&gt;Andy&lt;/a&gt; points out: if the methods are &lt;em&gt;optional&lt;/em&gt; then this will casually break silently leaving you scratching your head. If you’re updating any objc classes from swift, take a look to see if you’ve done the requisite lambada.&lt;/p&gt;

&lt;p&gt;For the required UITableViewDataSource file, The fix was to make this change:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-diff&quot; data-lang=&quot;diff&quot;&gt;&lt;span class=&quot;gd&quot;&gt;-@objc private class SceneListingDataSource: NSObject, UITableViewDataSource {&lt;/span&gt;
&lt;span class=&quot;gi&quot;&gt;+private class SceneListingDataSource: NSObject, UITableViewDataSource {&lt;/span&gt;
        var scenes: [Scene]
        init(scenes: [Scene]) {
                self.scenes = scenes
                super.init()
        }

&lt;span class=&quot;gd&quot;&gt;-       private func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&amp;gt; Int {&lt;/span&gt;
&lt;span class=&quot;gi&quot;&gt;+       @objc private func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&amp;gt; Int {&lt;/span&gt;
                return scenes.count
        }

&lt;span class=&quot;gd&quot;&gt;-       private func numberOfSectionsInTableView(tableView: UITableView) -&amp;gt; Int {&lt;/span&gt;
&lt;span class=&quot;gi&quot;&gt;+       @objc private func numberOfSectionsInTableView(tableView: UITableView) -&amp;gt; Int {&lt;/span&gt;
                return 1
        }
...
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;also-new-video-and-videolayer&quot;&gt;Also new: Video and VideoLayer&lt;/h2&gt;

&lt;p&gt;If you’ve made it this far… There’s been some recent work to add videos to prototope. This works in two ways, the first is a Video object and a VideoLayer which contains and displays the video. Here’s &lt;a href=&quot;https://github.com/Khan/OhaiPrototope/blob/master/OhaiPrototope/VideoScene.swift&quot;&gt;an example from ohaiprototope&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-swift&quot; data-lang=&quot;swift&quot;&gt;&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;video&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Video&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;videoLayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VideoLayer&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;video&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Video&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;jeff.mp4&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;videoLayer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VideoLayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Layer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;video&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;video&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;videoLayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;size&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;videoLayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;position&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;videoLayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;play&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can look forward to updated docs for that and more in the coming days.&lt;/p&gt;

&lt;h3 id=&quot;in-closing&quot;&gt;In closing&lt;/h3&gt;

&lt;p&gt;Beyond that, we have some upcoming changes in the next week or so that should make sketching much faster, but for now enjoy the increased stability! Thanks for riding along the prototrain!&lt;/p&gt;

&lt;p style=&quot;text-align: center;&quot;&gt;
    &lt;img src=&quot;/Prototope/assets/I_Choo_Choo_Choose_You_Simpsons.jpg&quot; alt=&quot;a valentine with a smiling saying &#39;i choo-choo-choose you.&#39;&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;https://twitter.com/dmnd_&quot;&gt;desmond&lt;/a&gt;, &lt;a href=&quot;https://twitter.com/andy_matuschak&quot;&gt;andy&lt;/a&gt;, and &lt;a href=&quot;https://twitter.com/nachosoto&quot;&gt;nacho&lt;/a&gt; for looking this post over.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot;&gt;

      &lt;p&gt;if you’re curious about the trailing closure issue, take a look at &lt;a href=&quot;https://twitter.com/AirspeedSwift/status/565209315813126144&quot;&gt;this tweet&lt;/a&gt; (whose conversation indicates that this is &lt;a href=&quot;https://twitter.com/jckarter/status/565210722435485696&quot;&gt;probably an unexpected regression&lt;/a&gt;).&lt;/p&gt;

      &lt;blockquote class=&quot;twitter-tweet&quot; lang=&quot;en&quot;&gt;&lt;p&gt;&lt;a href=&quot;https://twitter.com/jckarter&quot;&gt;@jckarter&lt;/a&gt; looks like trailing closures now disabled if there are default params after the fun arg e.g. split(s) { $0 == &amp;quot;,&amp;quot; }. Intentional?&lt;/p&gt;&amp;mdash; AirspeedVelocity (@AirspeedSwift) &lt;a href=&quot;https://twitter.com/AirspeedSwift/status/565209315813126144&quot;&gt;February 10, 2015&lt;/a&gt;&lt;/blockquote&gt;
      &lt;script async=&quot;&quot; src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

      &lt;p&gt;&lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
        <pubDate>Tue, 10 Feb 2015 00:00:00 +0000</pubDate>
        <link>http://khan.github.io/Prototope/2015/02/10/all-aboard-the-63-train.html</link>
        <guid isPermaLink="true">http://khan.github.io/Prototope/2015/02/10/all-aboard-the-63-train.html</guid>
        
        <category>updates</category>
        
        
      </item>
    
      <item>
        <title>Oh, hi there! Nice to see you</title>
        <description>&lt;p&gt;It looks like you’ve found prototope somehow! I made a video where i sorta bumble my way through talking about it. Although the overview is super high level, it’s as good spot as any to introduce prototope and the sorts of things that are relatively easy to accomplish.&lt;/p&gt;

&lt;div class=&quot;responsive video screen-13-in&quot;&gt;
  &lt;div&gt;
    &lt;iframe src=&quot;//player.vimeo.com/video/118975455&quot; width=&quot;100%&quot; height=&quot;100%&quot; frameborder=&quot;0&quot; webkitallowfullscreen=&quot;&quot; mozallowfullscreen=&quot;&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Links or things mentioned in the video:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/khan/prototope/&quot;&gt;Prototope/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/khan/ohaiprototope/&quot;&gt;OHAIPrototope/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/kongtomorrow/TunableSpec&quot;&gt;TunableSpec&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/facebook/pop&quot;&gt;Pop&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/lhartikk/ArnoldC&quot;&gt;ArnoldC&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Beyond that, be sure to check the &lt;code&gt;OHaiPrototope&lt;/code&gt; folder of the repo to see all the scenes available. There’s a nice mechanism for hopping between scenes which involves tapping escape if you’re running on the simulator. If you’re running on device, a three finger swipe will get you back to the list.&lt;/p&gt;

&lt;p&gt;If this is something that interests you, we’d love feedback on the api or comments about what feels heavyweight and what’s feeling lightweight. There’s a javascript bridge too, and when that lands, it’ll be way easier to share sketches around. For now, please poke around and if you spot an error in the docs or if a class or struct is missing, please open an issue :)&lt;/p&gt;

&lt;p&gt;Some other notes here: i intentionally avoided looking at code here for two reasons: the first is that that really feels like its own video, but the second (and arguably more disturbing reason) is that opening any swift file seems to trigger a host of SourceKit crashes in xcode which is just really unpleasant especially if you’re trying to demo anything or if you’re trying to type in xcode.&lt;/p&gt;

&lt;p&gt;thanks for your time,&lt;/p&gt;

&lt;p&gt;–marcos&lt;/p&gt;
</description>
        <pubDate>Thu, 05 Feb 2015 00:00:00 +0000</pubDate>
        <link>http://khan.github.io/Prototope/2015/02/05/oh-hi.html</link>
        <guid isPermaLink="true">http://khan.github.io/Prototope/2015/02/05/oh-hi.html</guid>
        
        
      </item>
    
  </channel>
</rss>
