1
00:00:07,960 --> 00:00:12,670
Hey everybody this is Caleb with Debs Lopes dot com and in this video we're going to go ahead and install

2
00:00:12,670 --> 00:00:19,720
some cocoa pods Alamo fire and Alamo fire image to give us the capability to easily make network request

3
00:00:19,810 --> 00:00:21,610
as well as download images.

4
00:00:21,640 --> 00:00:24,250
So very very cool to get started.

5
00:00:24,250 --> 00:00:32,200
I actually want to show you the Alamo fire get hub page where there is tons of very very detailed and

6
00:00:32,200 --> 00:00:35,910
incredible documentation which you can read through your own time.

7
00:00:35,920 --> 00:00:41,500
We'll we'll go through a bit of it but there is a lot here guys that can do a lot of stuff which is

8
00:00:41,500 --> 00:00:44,110
really really cool Alamo fire.

9
00:00:44,170 --> 00:00:52,480
Image is a library that comes from the Alamo fireteam as you can see here but it is specifically for

10
00:00:52,510 --> 00:00:53,560
image components.

11
00:00:53,710 --> 00:01:00,250
So it helps you to to download images really easily and convert them into instances of image that you

12
00:01:00,250 --> 00:01:02,380
can use in your apps which is really cool.

13
00:01:02,380 --> 00:01:08,590
So in order to actually set up cocoa pods for our app what we're going to do is we're going to need

14
00:01:08,590 --> 00:01:12,420
to go and find our project folder which mine is right here.

15
00:01:12,640 --> 00:01:16,370
Then you're going to need to open a terminal window like I have here.

16
00:01:16,690 --> 00:01:20,440
So you're going to need to CD into your directory.

17
00:01:20,440 --> 00:01:25,870
So what I like to do is just type CD space and then drag my folder into the terminal just a little faster

18
00:01:26,560 --> 00:01:33,160
then press enter and we have now changed directories to be inside pixel city and I open it up here so

19
00:01:33,160 --> 00:01:34,070
you can see what happens.

20
00:01:34,090 --> 00:01:39,090
But in order to set up cocoa pods all you need to do is type pod in it.

21
00:01:39,130 --> 00:01:42,460
Now this assumes that you have cocoa pods installed.

22
00:01:42,460 --> 00:01:51,550
If you don't all you need to type is pseudo gem install Coke cocoa pods like that pseudo gem install

23
00:01:51,550 --> 00:01:56,110
cocoa pods run through all of that and you'll have cocoa pods on your system.

24
00:01:56,110 --> 00:02:03,340
And after that all you need to do is type pod in it to initialize an empty pod file press enter and

25
00:02:03,340 --> 00:02:07,240
you'll see that a pod file was created in my project folder.

26
00:02:07,240 --> 00:02:13,170
Now we need to set this up so that we can install both Alamo fire and Alamo fire image.

27
00:02:13,300 --> 00:02:16,980
And so go ahead and right click and I like to use ATOM.

28
00:02:16,990 --> 00:02:20,170
That's just the text editor that I like to use.

29
00:02:20,170 --> 00:02:25,540
There are plenty of them out there but I would advise against using text edit because sometimes the

30
00:02:25,540 --> 00:02:28,290
formatting can get a little screwed up so I like to use ADOM.

31
00:02:28,300 --> 00:02:33,090
It's free and you can download it on online of course.

32
00:02:33,430 --> 00:02:41,050
So pull open that file here and you'll notice there is a blank space called pods for pixel city.

33
00:02:41,050 --> 00:02:44,230
That is where we're going to declare what cocoa pods we want to install.

34
00:02:44,230 --> 00:02:50,230
So let's go ahead and head over to Safari again and we're going to see what we need to do to install

35
00:02:50,230 --> 00:02:53,070
Alamo fire should be here under installation.

36
00:02:53,380 --> 00:02:58,260
Cocoa pods and you'll see it tells you how to install Cocoa Puffs just like I showed you.

37
00:02:58,720 --> 00:03:04,210
But what we need to do is we need to add this line into our pod file.

38
00:03:04,210 --> 00:03:06,770
You notice here it says target your target name.

39
00:03:06,770 --> 00:03:08,800
Do we go to our file.

40
00:03:08,800 --> 00:03:10,970
Here we have target pixel city.

41
00:03:11,000 --> 00:03:13,420
That's the target this POD file is affecting.

42
00:03:13,510 --> 00:03:14,520
And then do.

43
00:03:14,870 --> 00:03:16,060
OK very cool.

44
00:03:16,180 --> 00:03:21,560
Use framework's is here because we're using swift and we want to use dynamic frameworks.

45
00:03:21,580 --> 00:03:22,890
Otherwise it should be commented.

46
00:03:22,900 --> 00:03:29,650
But for this app of course we want that and for the pods all we need to do is to copy Podd Alamo fire

47
00:03:29,650 --> 00:03:31,870
version 4.4.

48
00:03:31,870 --> 00:03:34,070
Copy that in and paste it.

49
00:03:34,090 --> 00:03:38,550
And I like to put a tab there so it's in the right space with everything else.

50
00:03:38,770 --> 00:03:39,580
Very cool.

51
00:03:39,760 --> 00:03:41,210
So that's Alamo fire.

52
00:03:41,230 --> 00:03:42,320
That's good to go.

53
00:03:42,520 --> 00:03:44,010
Now for Alamo fire image.

54
00:03:44,020 --> 00:03:48,940
It's basically the same thing pod alum of fire image version 3.1.

55
00:03:48,940 --> 00:03:54,180
So I'm going to copy that and I'm going to press return then paste it into my pod file.

56
00:03:54,430 --> 00:04:01,240
And at this point I can go ahead and press command s to save my pod file quit Adam and then go back

57
00:04:01,300 --> 00:04:04,480
into your terminal window.

58
00:04:04,480 --> 00:04:09,280
Now we're going to install those two cocoa pods we have just added so to do that all you need to do

59
00:04:09,280 --> 00:04:17,470
is type pod pod install and press enter and you'll notice that it says Downloading dependencies installing

60
00:04:17,470 --> 00:04:22,390
Alamo fire installing Alamo fire image and everything now is good to go.

61
00:04:22,390 --> 00:04:24,600
Although your project photo looks a bit different.

62
00:04:24,800 --> 00:04:29,340
There's a pod file lock file as well as an X C workspace.

63
00:04:29,620 --> 00:04:35,170
When you're using cocoa pods that is what happens is your project gets converted into an extra workspace

64
00:04:35,170 --> 00:04:36,250
and you have to open that.

65
00:04:36,270 --> 00:04:39,270
In order for your project to work with the cocoa pots.

66
00:04:39,280 --> 00:04:39,490
All right.

67
00:04:39,490 --> 00:04:44,790
So go ahead and click pixel city Doxey workspace and I'm going to make mine full screen.

68
00:04:45,160 --> 00:04:50,020
And you'll notice there are two projects in here now one called pods and one called pixel city.

69
00:04:50,020 --> 00:04:54,070
Don't worry about pods for now but go ahead and take a look.

70
00:04:54,070 --> 00:04:57,040
Everything else is the same as it was.

71
00:04:57,280 --> 00:05:01,020
But when you install pods you need to go ahead and do a clean and build.

72
00:05:01,030 --> 00:05:04,880
So go ahead and hold shift command k that will clean your project.

73
00:05:05,020 --> 00:05:11,920
Shift command B and it'll build your project and right now it's analyzing those new libraries but you'll

74
00:05:11,920 --> 00:05:14,200
see it's going to give us some errors.

75
00:05:14,290 --> 00:05:18,350
That is because we're dealing with swift for an ex code Bayda.

76
00:05:18,540 --> 00:05:21,550
But Alamo fire requires swift 3.2.

77
00:05:21,730 --> 00:05:23,230
So let's change that.

78
00:05:23,230 --> 00:05:27,350
Go to your project here click on POD's.

79
00:05:27,550 --> 00:05:30,600
And then what we're going to do is we're going to go to build settings.

80
00:05:30,610 --> 00:05:31,130
OK.

81
00:05:31,300 --> 00:05:33,540
Now these are the build settings for Alamo and fire.

82
00:05:33,550 --> 00:05:35,710
These are the build settings for Alamo fire image.

83
00:05:35,700 --> 00:05:42,910
Now what we need to do is to search for swift language version and if you search for it you'll notice

84
00:05:43,000 --> 00:05:49,190
it's asking for swift for but Alamo fire is not yet updated to swift for so Clix with 3.2.

85
00:05:49,540 --> 00:05:54,250
Then for Alamo fire image do the same thing change it to swift 3.2.

86
00:05:54,250 --> 00:05:59,130
Now when we build the app you'll notice we will have no problems.

87
00:05:59,140 --> 00:06:06,070
Those errors will go away because it's basically kind of like you know on the Nintendo Wii if you wanted

88
00:06:06,070 --> 00:06:11,080
to play Game Cube games you could put a game cube game in even though it was the previous system or

89
00:06:11,080 --> 00:06:16,510
like on the PlayStation 2 if you wanted to play banjo Kazumi you could put in the piece X game into

90
00:06:16,510 --> 00:06:17,530
the tray and it would work.

91
00:06:17,530 --> 00:06:22,360
It's called Backwards compatibility and that's basically what we're doing is we're giving our app the

92
00:06:22,360 --> 00:06:25,660
ability to be backwards compatible with swift 3.2.

93
00:06:25,660 --> 00:06:28,120
So you'll notice all those errors went away.

94
00:06:28,660 --> 00:06:35,150
And if we go into Matt Visi if we tried to import Alamo fire let's give it a shot.

95
00:06:35,260 --> 00:06:41,070
You'll notice that this Alamo fire and Alamo fire image are both in their rightful place.

96
00:06:41,080 --> 00:06:47,890
So that is all we need to do to get Alamo fire and Alamo fire image properly installed and compatible

97
00:06:47,890 --> 00:06:51,470
with X code beta X code 9 beta.

98
00:06:51,580 --> 00:06:51,900
Awesome.

99
00:06:51,900 --> 00:06:56,500
So in the next video we're going to start building out the user interface for Matt Visi and I'm really

100
00:06:56,500 --> 00:06:57,580
excited to get started.

101
00:06:57,580 --> 00:07:00,470
So let's go ahead and zip on over to the next video.

102
00:07:00,490 --> 00:07:01,510
I'll see you there.
