Uploaded on

 

More in: Design , Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
313
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • \n
  • here to talk about the UI framework that is the foundation of the Twitter for Mac UI\n\nfirst thing: it has a new name: TwUI\n\nso why did we build a new UI framework for Mac? \nwell, when you go to build your UI, what are the options?\n\n
  • here to talk about the UI framework that is the foundation of the Twitter for Mac UI\n\nfirst thing: it has a new name: TwUI\n\nso why did we build a new UI framework for Mac? \nwell, when you go to build your UI, what are the options?\n\n
  • AppKit basically.\n\nyou know, appkit is great\npros:\n- amazing framework\n- stood the test of time\n- great patterns - the fact that it’s been around this long is a testament to this\n\ncons:\n- decades old\n- all the work happens on the cpu \n... the window compositor is hw accelerated now, but everything inside the window is draw with the cpu\n- want gpu acceleration\n\n- wouldn’t it be great if we could take AppKit and hardware accelerate it?\n
  • AppKit basically.\n\nyou know, appkit is great\npros:\n- amazing framework\n- stood the test of time\n- great patterns - the fact that it’s been around this long is a testament to this\n\ncons:\n- decades old\n- all the work happens on the cpu \n... the window compositor is hw accelerated now, but everything inside the window is draw with the cpu\n- want gpu acceleration\n\n- wouldn’t it be great if we could take AppKit and hardware accelerate it?\n
  • apple has been working on this\nit’s called layer backed NSViews\nbut there are still downsides, \nNSViews, are relatively heavy\njust compare that to a CAlayer which are so lightweight\nthey’re also flakey. animations sometimes flicker and stutter.\nwe needed something new\n\n
  • hence TwUI.\n\nit’s inspired by UIKit, uses the same fundamental model\nbut it’s really built and optimized for the Mac. It’s not UIKit for Mac, if you want that, check out Chameleon.\n\n
  • hence TwUI.\n\nit’s inspired by UIKit, uses the same fundamental model\nbut it’s really built and optimized for the Mac. It’s not UIKit for Mac, if you want that, check out Chameleon.\n\n
  • to take a step back, here’s how we build our stuff\nyou start with a core, build upon a common subset of foundation frameworks, it works on iOS and Mac\n\nOn top of this, we can build an iOS app using UIKit\nAnd separately, the Mac app, on top of this new ui library\n\nThe important thing is core code is shared, the UI is optimized for the target platform\n\nthere is some API overlap between UIKit and TwUI\nbut the goal of the project is to bring the ideas behind UIKit to the Mac\nnot the API unless it make sense\n\n
  • to take a step back, here’s how we build our stuff\nyou start with a core, build upon a common subset of foundation frameworks, it works on iOS and Mac\n\nOn top of this, we can build an iOS app using UIKit\nAnd separately, the Mac app, on top of this new ui library\n\nThe important thing is core code is shared, the UI is optimized for the target platform\n\nthere is some API overlap between UIKit and TwUI\nbut the goal of the project is to bring the ideas behind UIKit to the Mac\nnot the API unless it make sense\n\n
  • to take a step back, here’s how we build our stuff\nyou start with a core, build upon a common subset of foundation frameworks, it works on iOS and Mac\n\nOn top of this, we can build an iOS app using UIKit\nAnd separately, the Mac app, on top of this new ui library\n\nThe important thing is core code is shared, the UI is optimized for the target platform\n\nthere is some API overlap between UIKit and TwUI\nbut the goal of the project is to bring the ideas behind UIKit to the Mac\nnot the API unless it make sense\n\n
  • to take a step back, here’s how we build our stuff\nyou start with a core, build upon a common subset of foundation frameworks, it works on iOS and Mac\n\nOn top of this, we can build an iOS app using UIKit\nAnd separately, the Mac app, on top of this new ui library\n\nThe important thing is core code is shared, the UI is optimized for the target platform\n\nthere is some API overlap between UIKit and TwUI\nbut the goal of the project is to bring the ideas behind UIKit to the Mac\nnot the API unless it make sense\n\n
  • to take a step back, here’s how we build our stuff\nyou start with a core, build upon a common subset of foundation frameworks, it works on iOS and Mac\n\nOn top of this, we can build an iOS app using UIKit\nAnd separately, the Mac app, on top of this new ui library\n\nThe important thing is core code is shared, the UI is optimized for the target platform\n\nthere is some API overlap between UIKit and TwUI\nbut the goal of the project is to bring the ideas behind UIKit to the Mac\nnot the API unless it make sense\n\n
  • to take a step back, here’s how we build our stuff\nyou start with a core, build upon a common subset of foundation frameworks, it works on iOS and Mac\n\nOn top of this, we can build an iOS app using UIKit\nAnd separately, the Mac app, on top of this new ui library\n\nThe important thing is core code is shared, the UI is optimized for the target platform\n\nthere is some API overlap between UIKit and TwUI\nbut the goal of the project is to bring the ideas behind UIKit to the Mac\nnot the API unless it make sense\n\n
  • to take a step back, here’s how we build our stuff\nyou start with a core, build upon a common subset of foundation frameworks, it works on iOS and Mac\n\nOn top of this, we can build an iOS app using UIKit\nAnd separately, the Mac app, on top of this new ui library\n\nThe important thing is core code is shared, the UI is optimized for the target platform\n\nthere is some API overlap between UIKit and TwUI\nbut the goal of the project is to bring the ideas behind UIKit to the Mac\nnot the API unless it make sense\n\n
  • to take a step back, here’s how we build our stuff\nyou start with a core, build upon a common subset of foundation frameworks, it works on iOS and Mac\n\nOn top of this, we can build an iOS app using UIKit\nAnd separately, the Mac app, on top of this new ui library\n\nThe important thing is core code is shared, the UI is optimized for the target platform\n\nthere is some API overlap between UIKit and TwUI\nbut the goal of the project is to bring the ideas behind UIKit to the Mac\nnot the API unless it make sense\n\n
  • so how is it similar to UIKit\n\nEvery view is a lightweight shell around a layer - which may have its .contents property set if the view implements drawRect:, or optimized out if it doesn’t.\n\nof course layers are rendered by core animation, so everything is hardware accelerated for free\n\nand anything you can do with pure CALayers you can do with the backing layer of a view\n\nand some obvious stuff from UIKit is the same, e.g. we build our scroll view with the same mechanism\n
  • so how is it similar to UIKit\n\nEvery view is a lightweight shell around a layer - which may have its .contents property set if the view implements drawRect:, or optimized out if it doesn’t.\n\nof course layers are rendered by core animation, so everything is hardware accelerated for free\n\nand anything you can do with pure CALayers you can do with the backing layer of a view\n\nand some obvious stuff from UIKit is the same, e.g. we build our scroll view with the same mechanism\n
  • so how is it similar to UIKit\n\nEvery view is a lightweight shell around a layer - which may have its .contents property set if the view implements drawRect:, or optimized out if it doesn’t.\n\nof course layers are rendered by core animation, so everything is hardware accelerated for free\n\nand anything you can do with pure CALayers you can do with the backing layer of a view\n\nand some obvious stuff from UIKit is the same, e.g. we build our scroll view with the same mechanism\n
  • so how is it similar to UIKit\n\nEvery view is a lightweight shell around a layer - which may have its .contents property set if the view implements drawRect:, or optimized out if it doesn’t.\n\nof course layers are rendered by core animation, so everything is hardware accelerated for free\n\nand anything you can do with pure CALayers you can do with the backing layer of a view\n\nand some obvious stuff from UIKit is the same, e.g. we build our scroll view with the same mechanism\n
  • in addition to the base view, you get a bunch of views for free, \nscroll view,\nblazing fast table view\nbuttons,\netc\n\n
  • but you don’t get a ton of widgets - it’s a framework, not a widget library\n\nlet me explain\n-----\nthis is twitter for mac\nwe built it around TwUI\n\nwell, that’s not what we’re open sourcing\n\n-----\nthis is what we’re open sourcing.\n-----\nbecause this is what the full TwUI project looks like, there are some places where Twitter for Mac bleeds into the framework.\n\nso you don’t get the mess\nyou get the clean heart of it, the base.\n\nthe idea is to give you a platform that makes it super EASY to build all the widgets you want, not give you some generic ones.\n\nand if you are in the position where you’re pushing appkit to the limit, this is probably what you want anyway\n
  • but you don’t get a ton of widgets - it’s a framework, not a widget library\n\nlet me explain\n-----\nthis is twitter for mac\nwe built it around TwUI\n\nwell, that’s not what we’re open sourcing\n\n-----\nthis is what we’re open sourcing.\n-----\nbecause this is what the full TwUI project looks like, there are some places where Twitter for Mac bleeds into the framework.\n\nso you don’t get the mess\nyou get the clean heart of it, the base.\n\nthe idea is to give you a platform that makes it super EASY to build all the widgets you want, not give you some generic ones.\n\nand if you are in the position where you’re pushing appkit to the limit, this is probably what you want anyway\n
  • but you don’t get a ton of widgets - it’s a framework, not a widget library\n\nlet me explain\n-----\nthis is twitter for mac\nwe built it around TwUI\n\nwell, that’s not what we’re open sourcing\n\n-----\nthis is what we’re open sourcing.\n-----\nbecause this is what the full TwUI project looks like, there are some places where Twitter for Mac bleeds into the framework.\n\nso you don’t get the mess\nyou get the clean heart of it, the base.\n\nthe idea is to give you a platform that makes it super EASY to build all the widgets you want, not give you some generic ones.\n\nand if you are in the position where you’re pushing appkit to the limit, this is probably what you want anyway\n
  • but you don’t get a ton of widgets - it’s a framework, not a widget library\n\nlet me explain\n-----\nthis is twitter for mac\nwe built it around TwUI\n\nwell, that’s not what we’re open sourcing\n\n-----\nthis is what we’re open sourcing.\n-----\nbecause this is what the full TwUI project looks like, there are some places where Twitter for Mac bleeds into the framework.\n\nso you don’t get the mess\nyou get the clean heart of it, the base.\n\nthe idea is to give you a platform that makes it super EASY to build all the widgets you want, not give you some generic ones.\n\nand if you are in the position where you’re pushing appkit to the limit, this is probably what you want anyway\n
  • but you don’t get a ton of widgets - it’s a framework, not a widget library\n\nlet me explain\n-----\nthis is twitter for mac\nwe built it around TwUI\n\nwell, that’s not what we’re open sourcing\n\n-----\nthis is what we’re open sourcing.\n-----\nbecause this is what the full TwUI project looks like, there are some places where Twitter for Mac bleeds into the framework.\n\nso you don’t get the mess\nyou get the clean heart of it, the base.\n\nthe idea is to give you a platform that makes it super EASY to build all the widgets you want, not give you some generic ones.\n\nand if you are in the position where you’re pushing appkit to the limit, this is probably what you want anyway\n
  • but you don’t get a ton of widgets - it’s a framework, not a widget library\n\nlet me explain\n-----\nthis is twitter for mac\nwe built it around TwUI\n\nwell, that’s not what we’re open sourcing\n\n-----\nthis is what we’re open sourcing.\n-----\nbecause this is what the full TwUI project looks like, there are some places where Twitter for Mac bleeds into the framework.\n\nso you don’t get the mess\nyou get the clean heart of it, the base.\n\nthe idea is to give you a platform that makes it super EASY to build all the widgets you want, not give you some generic ones.\n\nand if you are in the position where you’re pushing appkit to the limit, this is probably what you want anyway\n
  • but you don’t get a ton of widgets - it’s a framework, not a widget library\n\nlet me explain\n-----\nthis is twitter for mac\nwe built it around TwUI\n\nwell, that’s not what we’re open sourcing\n\n-----\nthis is what we’re open sourcing.\n-----\nbecause this is what the full TwUI project looks like, there are some places where Twitter for Mac bleeds into the framework.\n\nso you don’t get the mess\nyou get the clean heart of it, the base.\n\nthe idea is to give you a platform that makes it super EASY to build all the widgets you want, not give you some generic ones.\n\nand if you are in the position where you’re pushing appkit to the limit, this is probably what you want anyway\n
  • but you don’t get a ton of widgets - it’s a framework, not a widget library\n\nlet me explain\n-----\nthis is twitter for mac\nwe built it around TwUI\n\nwell, that’s not what we’re open sourcing\n\n-----\nthis is what we’re open sourcing.\n-----\nbecause this is what the full TwUI project looks like, there are some places where Twitter for Mac bleeds into the framework.\n\nso you don’t get the mess\nyou get the clean heart of it, the base.\n\nthe idea is to give you a platform that makes it super EASY to build all the widgets you want, not give you some generic ones.\n\nand if you are in the position where you’re pushing appkit to the limit, this is probably what you want anyway\n
  • but you don’t get a ton of widgets - it’s a framework, not a widget library\n\nlet me explain\n-----\nthis is twitter for mac\nwe built it around TwUI\n\nwell, that’s not what we’re open sourcing\n\n-----\nthis is what we’re open sourcing.\n-----\nbecause this is what the full TwUI project looks like, there are some places where Twitter for Mac bleeds into the framework.\n\nso you don’t get the mess\nyou get the clean heart of it, the base.\n\nthe idea is to give you a platform that makes it super EASY to build all the widgets you want, not give you some generic ones.\n\nand if you are in the position where you’re pushing appkit to the limit, this is probably what you want anyway\n
  • so how is it NOT like UIKit\n\nfirst, desktop affordances:\n- things like drag and drop\n- mouse enter/exit events, hover states\n- tooltips\n- some stuff built into the framework for responder chain stitching (keep view controllers in the loop without the song and dance that appkit sometimes requires)\n\n- not bringing over some other baggage, for example table cells are flat by default\n- a simple drawRect override is all you need to customize \n- no need to make the view hierarchy deeper than it needs to be\n\nbecause it wouldn’t make sense to mimic api, you don’t interact with cells the same way with a mouse as you do with a finger\n\nand the other big thing is text rendering - let me explain\n
  • here’s a tweet\n\nthere’s a subtle gradient, and we’re drawing some text over it in three parts\n------\nthis is the mac, subpixel aa is expected. \nnow on iOS, you could do it naively with a couple UILabels with transparent backgrounds so the gradient showed through, and there is no subpixel aa there so whatever. \n\nor\n\nif you care about performance you’ll draw this view flat - bake the text on top of the gradient in a single bitmap, \nsave a bunch of overdraw, \ndon’t need to blend, gpu is happy\n\nbut that just gives you dumb text, all it does is sit there. \nhow would you select it, interact with \ndrag and drop?\n-----\nso in TwUI there’s this new thing called a Text Renderer. It’s not a view, but it can draw itself in a view. \n\nencapsulates a frame, \nsome attributed string,\nand if you feed it events it also encapsulates all the standard interaction you’re used to on the mac\n
  • here’s a tweet\n\nthere’s a subtle gradient, and we’re drawing some text over it in three parts\n------\nthis is the mac, subpixel aa is expected. \nnow on iOS, you could do it naively with a couple UILabels with transparent backgrounds so the gradient showed through, and there is no subpixel aa there so whatever. \n\nor\n\nif you care about performance you’ll draw this view flat - bake the text on top of the gradient in a single bitmap, \nsave a bunch of overdraw, \ndon’t need to blend, gpu is happy\n\nbut that just gives you dumb text, all it does is sit there. \nhow would you select it, interact with \ndrag and drop?\n-----\nso in TwUI there’s this new thing called a Text Renderer. It’s not a view, but it can draw itself in a view. \n\nencapsulates a frame, \nsome attributed string,\nand if you feed it events it also encapsulates all the standard interaction you’re used to on the mac\n
  • here’s a tweet\n\nthere’s a subtle gradient, and we’re drawing some text over it in three parts\n------\nthis is the mac, subpixel aa is expected. \nnow on iOS, you could do it naively with a couple UILabels with transparent backgrounds so the gradient showed through, and there is no subpixel aa there so whatever. \n\nor\n\nif you care about performance you’ll draw this view flat - bake the text on top of the gradient in a single bitmap, \nsave a bunch of overdraw, \ndon’t need to blend, gpu is happy\n\nbut that just gives you dumb text, all it does is sit there. \nhow would you select it, interact with \ndrag and drop?\n-----\nso in TwUI there’s this new thing called a Text Renderer. It’s not a view, but it can draw itself in a view. \n\nencapsulates a frame, \nsome attributed string,\nand if you feed it events it also encapsulates all the standard interaction you’re used to on the mac\n
  • here’s a tweet\n\nthere’s a subtle gradient, and we’re drawing some text over it in three parts\n------\nthis is the mac, subpixel aa is expected. \nnow on iOS, you could do it naively with a couple UILabels with transparent backgrounds so the gradient showed through, and there is no subpixel aa there so whatever. \n\nor\n\nif you care about performance you’ll draw this view flat - bake the text on top of the gradient in a single bitmap, \nsave a bunch of overdraw, \ndon’t need to blend, gpu is happy\n\nbut that just gives you dumb text, all it does is sit there. \nhow would you select it, interact with \ndrag and drop?\n-----\nso in TwUI there’s this new thing called a Text Renderer. It’s not a view, but it can draw itself in a view. \n\nencapsulates a frame, \nsome attributed string,\nand if you feed it events it also encapsulates all the standard interaction you’re used to on the mac\n
  • things like \n\ntext selection, including click-drag, double-click-drag, triple-click-drag.\n-----\ndictionary overlay.\n-----\nclick-wait-drag drag-and-drop text.\n\nso you can add these text renderers to views, and they shoulder a lot of this stuff for you. \nand when you draw, your text gets baked into the containing view. \nand because you’re drawing it flat, your text is over opaque pixels, so core text can do subpixel aa.\n\nbasically win-win\n
  • things like \n\ntext selection, including click-drag, double-click-drag, triple-click-drag.\n-----\ndictionary overlay.\n-----\nclick-wait-drag drag-and-drop text.\n\nso you can add these text renderers to views, and they shoulder a lot of this stuff for you. \nand when you draw, your text gets baked into the containing view. \nand because you’re drawing it flat, your text is over opaque pixels, so core text can do subpixel aa.\n\nbasically win-win\n
  • things like \n\ntext selection, including click-drag, double-click-drag, triple-click-drag.\n-----\ndictionary overlay.\n-----\nclick-wait-drag drag-and-drop text.\n\nso you can add these text renderers to views, and they shoulder a lot of this stuff for you. \nand when you draw, your text gets baked into the containing view. \nand because you’re drawing it flat, your text is over opaque pixels, so core text can do subpixel aa.\n\nbasically win-win\n
  • the coordinate system is also different\nwhat do i mean\n\nwell coregraphics does it right, lower left origin\ncore animation does too\n\nso it would make sense for the UI framework that bridged coregraphics and coreanimation was kind of like that\n\nbut instead we have this\n
  • the coordinate system is also different\nwhat do i mean\n\nwell coregraphics does it right, lower left origin\ncore animation does too\n\nso it would make sense for the UI framework that bridged coregraphics and coreanimation was kind of like that\n\nbut instead we have this\n
  • the coordinate system is also different\nwhat do i mean\n\nwell coregraphics does it right, lower left origin\ncore animation does too\n\nso it would make sense for the UI framework that bridged coregraphics and coreanimation was kind of like that\n\nbut instead we have this\n
  • well, we’re going old school\n\n
  • well, we’re going old school\n\n
  • scroll physics are different too. if you’ve tried Twitter for Mac on [REDACTED] you’ll see some custom bouncing\n\nlong story short\n- velocity is never discontinuous\n- you know trackpad isn’t a touchscreen - user doesn’t perceive a 1:1 mapping between trackpad motion and screen motion.\n- and worst: rubber-band shouldn’t fight you both ways\n- talk to me later if you care\n\n
  • anyway, we talked about how it’s familiar if you use UIKit, and a bit about how it’s different.\nbut there are perks to controlling the framework, \n- not bound by any existing API \n- what are some cool things that we can do?\n\nwell, stuff like \n- block based draw rect\n- block based layout\n- and little things like .contents property animations\n
  • block based draw rect - you probably guessed \n- gives you a fast drawRect override so you don’t have to subclass. \n\nhuge win if you have a few views that you just want to tweak\n\n
  • block based layout has turned out to be pretty useful\n\nteach a view how to position itself functionally.\n\nno springs-and-struts rounding error drift.\n\nno subclassing.\n\nthe new cocoa auto-layout system looks really cool, but there’s something to be said for good old fashioned code\n\nthe great thing about code is that it can be reused\n
  • you can make a function that dynamically creates and returns a block to do layout\nclean\nreusable\n\ntry that in interface builder\n\n
  • also, we can do .contents property cross fades really easily, just by letting the coreanimation machinery do its thing\n\nlittle things like this that are just a pain if you don’t have code for the framework\n\nalso note a new -redraw method, in addition to -setNeedsDisplay. Valid to call in an animation block, forces an update of the backing layer .contents property by calling your drawRect:\n\nuse this when keyboarding through tweets, highlight - then fade back slightly.\n
  • just to give an example of how easy this is, the current implementation \n\n- two additional lines of code\n\n- you have a lot of wiggle room to do things differently by being able to hack on the UI framework itself\n
  • so that’s TwUI - but how do you build it into your app\n\nwell you have options\n\nTUINSView is the host. It’s based on NSView, layer backed, you plop it into your NSView hierarchy and it hosts the TUIKit hierarchy and does some handy event routing.\n\nTwitter for Mac has two root bridge views, one for the main UI, another that draws the navigation UI over the titlebar.\n\nIn your app you can have one big one, or lots of little ones. Just use TwUI where you need to. if appkit is the right tool for the job, use it.\n
  • so that’s TwUI - but how do you build it into your app\n\nwell you have options\n\nTUINSView is the host. It’s based on NSView, layer backed, you plop it into your NSView hierarchy and it hosts the TUIKit hierarchy and does some handy event routing.\n\nTwitter for Mac has two root bridge views, one for the main UI, another that draws the navigation UI over the titlebar.\n\nIn your app you can have one big one, or lots of little ones. Just use TwUI where you need to. if appkit is the right tool for the job, use it.\n
  • api is changing, some stuff doesn’t quite make sense\nwant to get this out there\nplay with it!\n\nwe’ll be posting it on github soon\n\n
  • api is changing, some stuff doesn’t quite make sense\nwant to get this out there\nplay with it!\n\nwe’ll be posting it on github soon\n\n

Transcript

  • 1. ABUIKit
  • 2. TwUI
  • 3. AppKit
  • 4. AppKit• Time-tested• Great patterns
  • 5. AppKit• Time-tested • CPU bound• Great patterns
  • 6. Layer-backed NSView
  • 7. TwUI
  • 8. TwUI• Inspired by UIKit• Built for Mac
  • 9. What is TwUI?
  • 10. What is TwUI? App Core Foundation
  • 11. What is TwUI? iOS UI UIKit App Core Foundation
  • 12. What is TwUI? iOS UI Mac UI UIKit TwUI App Core Foundation
  • 13. Like UIKit
  • 14. Like UIKit• TUIView *v = [[TUIView alloc] initWithFrame:CGRectMake(...)];
  • 15. Like UIKit• TUIView *v = [[TUIView alloc] initWithFrame:CGRectMake(...)];• v.layer ==> CALayer
  • 16. Like UIKit• TUIView *v = [[TUIView alloc] initWithFrame:CGRectMake(...)];• v.layer ==> CALayer• [v.layer addAnimation:...];
  • 17. Like UIKit• TUIView *v = [[TUIView alloc] initWithFrame:CGRectMake(...)];• v.layer ==> CALayer• [v.layer addAnimation:...];• + (Class)layerClass { return [CAScrollLayer class]; }
  • 18. Like UIKit• TUIScrollView• TUITableView• TUIButton• etc...
  • 19. Batteries not included
  • 20. Batteries not included• Blank canvas• BYO design
  • 21. Batteries not included Twitter for Mac
  • 22. Batteries not included Twitter for Mac TwUI
  • 23. Batteries not included Twitter for Mac TwUI
  • 24. Batteries not included Twitter for Mac TwUI
  • 25. Not like UIKit• Desktop affordances• Text rendering• Subpixel AA• Coordinate system• Scroll physics
  • 26. TUITextRenderer
  • 27. TUITextRenderer
  • 28. TUITextRenderer
  • 29. TUITextRenderer
  • 30. TUITextRenderer
  • 31. Coordinates
  • 32. CoordinatesCoreGraphics+Y +X
  • 33. CoordinatesCoreGraphics CoreAnimation+Y +Y +X +X
  • 34. CoordinatesCoreGraphics CoreAnimation UIKit+Y +Y +X +X +X +Y
  • 35. Coordinates
  • 36. Coordinates TUIKit +Y +Xnice.
  • 37. Scroll Physics don’t get me started
  • 38. Beyond UIKit• ^drawRect• ^layout• .contents animations
  • 39. Beyond UIKitmyView.drawRect = ^(TUIView *v, CGRect r) { CGContextRef ctx = TUIGraphicsGetCurrentContext(); // draw something cool};
  • 40. Beyond UIKitmyView.layout = ^(ABUIView *v) { CGRect b = v.superview.bounds; return CGRectMake( 0.f, 0.f, round(b.size.width/3.f), b.size.height);};
  • 41. Beyond UIKitmyView.layout = insetSuperviewBy(5);
  • 42. Beyond UIKit[TUIView animateWithDuration:0.3 animations:^{ [TUIView setAnimatesContents:YES]; [myView redraw]; // update .contents now}];
  • 43. Beyond UIKit
  • 44. TUINSView
  • 45. TUINSView
  • 46. Open Source
  • 47. Open Source• API flux
  • 48. Open Source• API flux• Contribute