Objective-C Vitamins

0ebf471a3ae8df42a84f93a7efbbdbd0?s=47 Ash Furrow
January 22, 2013

Objective-C Vitamins

This is a talk that I gave at Tech Talks TO about the three things that the Objective-C community needs to embrace to grow into a mature, stable platform: Accessibility, Unit Testing, and Open Source.

0ebf471a3ae8df42a84f93a7efbbdbd0?s=128

Ash Furrow

January 22, 2013
Tweet

Transcript

  1. Objective-C Vitamins Ash Furrow, iOS Developer & Author

  2. Accessibility

  3. Matters Accessibility

  4. Ontario Citizens 1 in 7

  5. Ontario Citizens Broader 1 in 7 Appeal Market

  6. Legislation Ontario Citizens Broader AODA 1 in 7 Appeal Market

  7. Legislation Ontario Citizens Broader Low Cost in iOS AODA Relatively

    1 in 7 Appeal Market
  8. iOS is and visual aural

  9. You wouldn’t ship a bad visual interface Why would you

    ship a bad aural one?
  10. Accessibility is HARD

  11. WHY?

  12. TURN VoiceOver ON (seriously)

  13. Accessibility is EASY

  14. UIAccessibility

  15. Part of UIKit Built in UIAccessibility

  16. Part of UIKit Built in UIAccessibility Conformed to by UIView

    Built in
  17. Part of UIKit Built in UIAccessibility Conformed to by UIView

    Built in You can roll your own Built in
  18. UIAccessibilityTraits Causes Page Turn Starts Media Session None Button Link

    Search Field Image Plays Sound Keyboard Key Static Text Summary Element Not Enabled Updates Frequently Adjustable Allow Direct Interaction Header Selected
  19. invisible THE BUTTON

  20. Using as button labels

  21. drawRect: UITableViewCell

  22. Localization ຊ౔Խ ϩʔΧϥΠθʔγϣϯ !"#$%&ا локализация lokalisasyon lokalisatie εντοπισµός localisation localización

    lokalisering localização
  23. Honour Building quality software is a measure of Quality Building

    accessible software is a measure of
  24. Testing Unit

  25. WHAT IS UNIT TESTING?

  26. WHY UNIT TEST?

  27. MODEL CONTROLLER VIEW KVO OWNS OWNS USER INTERACTION

  28. MODEL CONTROLLER VIEW KVO OWNS OWNS USER INTERACTION EXTENSION EXTENSION

  29. “Common things are easy and uncommon things are possible.”

  30. Uncommon “Common things are easy and uncommon things are possible.”

    Unit Testing is
  31. Uh oh.

  32. Yes! In Objective-C?

  33. None
  34. - (void)testExample { STFail(@"Unit tests are not implemented yet in

    My Sweet New AppTests"); }
  35. And that’s it.

  36. OCMock Introducing

  37. Objects Mock

  38. NSURLRequest *dummyURLRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http:// example.com"]]; PXRequest *requestUnderTest =

    [[PXRequest alloc] initWithURLRequest:dummyURLRequest completion:nil]; id mockConnection = [OCMockObject niceMockForClass:[NSURLConnection class]]; [[mockConnection expect] start]; id partialRequestMock = (PXRequest *)[OCMockObject partialMockForObject:requestUnderTest]; [[[partialRequestMock stub] andReturn:mockConnection] urlConnectionForURLRequest:OCMOCK_ANY]; [partialRequestMock start]; [mockConnection verify]; A Simple Test A lot of Code
  39. Why?

  40. Because OCMock is OLD and BUSTED

  41. New Hotness Kiwi

  42. Integrates Xcode with

  43. None
  44. describe(@"ClassName", ^{ context(@"a state the component is in", ^{ __block

    id variable = nil; it(@"should do something", ^{ [[variable should] meetSomeExpectation]; }); specify(^{ [variable shouldNotBeNil] }); }); });
  45. describe(@"ClassName", ^{ context(@"a state the component is in", ^{ __block

    id variable = nil; beforeAll(^{ // Occurs once }); afterAll(^{ // Occurs once }); beforeEach(^{ // Occurs before each enclosed "it" variable = [MyClass instance]; }); afterEach(^{ // Occurs after each enclosed "it" }); }); });
  46. VIOUR DRIVEN DEVELOPMENT BEHAVIOUR DRIVEN DEVELOPMENT R DRIVEN DEVELOPMENTBEHAVIOUR D

    BEHAVIOU BEHAVIOUR DRIVEN DEVEL BEHAVIOUR DRIVEN DEVELOPMENT VELOPMENT NT DEVELOPMENT NT BEHAVIOUR DRIVEN DEV UR DRIVEN DEVELOPMENTBEHAVIOUR BEHAVIOUR DRIVEN DEVELOPMENTBEH
  47. GTFO. UAT?

  48. SOURCE OPEN

  49. INSULAR Objective-C Developers Tend to be (probably historical)

  50. WITHOUT IMAGINE A WORLD RubyGems

  51. Copy Files Ugh. OPTIONS

  52. Copy Files Ugh. OPTIONS Git Submodules Complicated.

  53. Copy Files Ugh. OPTIONS Git Submodules Complicated. CocoaPods DAZZLINGLY AMAZING.

  54. Dependency Management CocoaPods Versioning GitHub

  55. DEVELOPERS STUBBORN are

  56. DEVELOPERS DON’T KNOW

  57. THE TOOLS SUCK

  58. Let’s LEARN

  59. Let’s TEACH

  60. Let’s BLOG

  61. http://ashfurrow.com/book

  62. @ashfurrow ashfurrow.com