Slide 1

Slide 1 text

! CUSTOM PLAYGROUNDS " NSLONDON, JUNE 2014 BORIS BÜGLING - @NEONACHO

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

COCOAPODS - CONTENTFUL

Slide 4

Slide 4 text

SWIFT?

Slide 5

Slide 5 text

SWIFT!

Slide 6

Slide 6 text

REPL

Slide 7

Slide 7 text

$ swift Welcome to Swift! Type :help for assistance. 1> import ContentfulDeliveryAPI :1:8: error: no such module 'ContentfulDeliveryAPI' import ContentfulDeliveryAPI ^

Slide 8

Slide 8 text

Copy your framework over to /Applications/Xcode6-Beta2.app/ Contents/Developer/Platforms/MacOSX.platform/Developer/ SDKs/MacOSX10.10.sdk/System/Library/Frameworks

Slide 9

Slide 9 text

1> import ContentfulDeliveryAPI 2> var client = CDAClient() client: CDAClient = error: Couldn't lookup symbols: _OBJC_CLASS_$_CDAClient

Slide 10

Slide 10 text

LOAD THE DYNAMIC LIBRARY FROM YOUR FRAMEWORK USING dlopen()

Slide 11

Slide 11 text

3> var handle = dlopen("/Applications/.../Versions/A/ContentfulDeliveryAPI", 2) handle: COpaquePointer = Builtin.RawPointer = 0x0000000102e2b6e0 -> 0x00007fff5fc37e50 vtable for ImageLoaderMachOCompressed + 16 4> var client = CDAClient() client: CDAClient = {}

Slide 12

Slide 12 text

SUCCESS

Slide 13

Slide 13 text

// Playground - noun: a place where people can play

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

24/06/14 01:00:00,780 Xcode[84816]: IDEPlaygroundExecutionSessionThread(pid=85188) IDEPlaygroundExecution: [PlaygroundSession <0x7fff12750c70>] Received error from expr: error: error: Couldn't lookup symbols: _OBJC_CLASS_$_CDAClient

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

SAM MARSHALL

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

XCODE PLUGIN?

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

#import @interface IDELocalComputerPlaygroundExecutionDeviceService : IDEPlaygroundExecutionDeviceService + (id)capability; - (id)sessionForExecutingPlaygroundWithParameters:(id)arg1; - (id)defaultStubPathForSDK:(id)arg1; @end

Slide 23

Slide 23 text

DVTPLAYGROUNDCOMMUNICATION.FRAMEWORK @interface DVTPlaygroundCommunicationListener @interface DVTPlaygroundCommunicationSender Uses TCP/IP on the local machine to communicate between Xcode and Stub

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

DEMO

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

XCODE PLUGIN!

Slide 32

Slide 32 text

RELEVANT WWDC 2014 SESSIONS â–¸ Session 408: Swift Playgrounds â–¸ Session 409: Introduction to LLDB and the Swift REPL

Slide 33

Slide 33 text

LINKS â–¸ http://samdmarshall.com/blog/ custom_frameworks_and_swift.html â–¸ https://github.com/jas/swift-playground-builder â–¸ http://stackoverflow.com/questions/24058336/how-do-i-run- asynchronous-callbacks-in-playground

Slide 34

Slide 34 text

THANK YOU!

Slide 35

Slide 35 text

HTTP://VU0.ORG/PLAYGROUNDS