Hey everybody this is Caleb with slopestyle.
And in this video we're going to talk about how you can get our act Swift in a playground.
OK.
Now it's actually much easier than you might be thinking to install a cocoa pod like arke swift into
a playground.
And we can think the actual Rick swift team or whoever is behind our swift.
It is a community supported project.
We can thank them for making it easy for us to get an arc swift playground.
Now it is possible to do this by yourself but there have been a ton of issues with Xcode 9 especially
X code 9 beta.
It does not like the swift for version of our swift it recognizes it as the wrong type.
There's all kinds of issues with our with X code 9 beta but thankfully our swift team has already compiled
in our ex-wifes playground that does work with X code beta.
So if you go to get hub and you search for Ark's Swift all you need to do is to either clone or download
the swift repository.
And you'll notice that right here there is something called our X playground.
OK.
I'm going to show you how to use that in just a second.
But for now I'm just going to go ahead and pull open the one that I downloaded here and I want to show
you how it's done.
So let's go ahead and let's open up our X-Com playground.
So when you open it it'll come up like this.
And it gives you some instructions.
Check it out.
It says open our ex-cult workspace k then build the ark swift Macko s scheme then find the playground
in the project navigator.
Then show the debug area so let's go ahead and let's close this.
Let's open our X workspace.
OK.
And I'm going to pull it up here and like it said we go let's see we need to find our X swift Mac OS
we need to build it.
And there we go.
And now we can open up the X playground and there's the same directions that we just saw.
So now of course it gives us all kinds of documentation information.
This is from the swift team.
But what you can do is you can right click new playground page and check this out.
Let's let's name this demo what you can do is you can go in and I'm going to select all press delete
and it gets rid of those buttons.
Now what I can do is I can import and watch this are x swift.
Now when I build it you'll notice there are no errors.
We have access to our swift.
There's something else though that we need to implement and it's going to give us the ability to basically
let our playground run indefinitely.
OK.
And using re-active we need to do that.
So go ahead and type import playground support.
OK and of course you might have to build it maybe clean it.
Now of course we can import playground support and we can type playground page dot current.
And then this right here needs indef. execution basically meaning it's just going to execute our playground
indefinitely and we'll set that to be equal to true.
So we have now imported our ex Swift.
We have now imported playground support and we have set it to indefinitely execute now we need to check
to make sure that all of our Good Stuff is in here.
So let's go ahead and let's create an observable.
Let's just say var observe a bowl of type observable and we can give it a specific type of string.
It looks like it's there all of our arcs swift stuff is here ready for us to use.
So that is how you're going to basically get a playground that works with Eric swift for just playing
around with it seeing how it works.
And we're going to dive in a little bit deeper in the next section where we talk about observables we
talk about subscriptions and disposables.
So let's head over to the next section now that we have a playground set up and ready for us to go.
So Ossie over that.