0
1
00:00:01,700 --> 00:00:08,000
So up till now, we've got an app that is able to use a pre-trained flower image recognition model to
1

2
00:00:08,000 --> 00:00:10,230
recognize the flower in our pictures.
2

3
00:00:10,320 --> 00:00:16,670
Now, wouldn't it be cool if we could look up the name of that flower in Wikipedia and give the user a
3

4
00:00:16,670 --> 00:00:18,700
little bit of information about that flower?
4

5
00:00:18,770 --> 00:00:23,900
If you're like me, you know, a complete gardening noob, then I would love to know a little bit about the
5

6
00:00:23,900 --> 00:00:25,810
flowers that I see around me,
6

7
00:00:25,820 --> 00:00:30,420
so I think that would make a pretty neat feature in addition to what our app already does.
7

8
00:00:30,680 --> 00:00:32,360
So in order to do that--
8

9
00:00:32,360 --> 00:00:37,250
So it's actually not that hard to do it because we've really learned about REST APIs and how to make
9

10
00:00:37,330 --> 00:00:42,100
HTTP requests using Alamofire in Clima and in FlashChat.
10

11
00:00:42,140 --> 00:00:45,540
So part of this lesson is going to be reviewing what we did back there,
11

12
00:00:45,650 --> 00:00:46,970
and you can do it as a challenge.
12

13
00:00:46,970 --> 00:00:51,040
So, first, let me show you what we're looking for. So I'm on Wikipedia at the moment.
13

14
00:00:51,110 --> 00:00:56,790
And in the last lesson, I found out that the flower that I have on my desk is a Barberton Daisy.
14

15
00:00:56,870 --> 00:01:02,040
So let's have a look on Wikipedia and see what that looks like.
15

16
00:01:03,270 --> 00:01:07,770
So as you can see Barberton Daisy redirected to Gerbera jamesonii.
16

17
00:01:07,790 --> 00:01:12,450
I'm probably murdering how that's pronounced.
17

18
00:01:12,450 --> 00:01:16,850
But, anyways, Wikipedia gives us a little bit of background information on this particular flower,
18

19
00:01:16,950 --> 00:01:21,310
and also it shows us all of these images Barberton Daisies in the wild.
19

20
00:01:21,450 --> 00:01:25,480
And I think to my human eye, they look pretty similar to the one that I've got,
20

21
00:01:25,560 --> 00:01:28,470
so I think my image classification seemed to work.
21

22
00:01:28,470 --> 00:01:33,570
Wouldn't it be nice if in the app after it's recognized that the photo that I took is of a Barberton Daisy,
22

23
00:01:33,570 --> 00:01:38,690
to then also pull up this information from Wikipedia and show it to me in the app.
23

24
00:01:38,700 --> 00:01:44,580
Well, it's actually pretty easy to do it because Wikipedia has open APIs. So we can tap into it and
24

25
00:01:44,580 --> 00:01:47,650
grab this little extract and put it into our app.
25

26
00:01:47,670 --> 00:01:53,060
So as you did before in Clima and also in FlashChat, we're going to be using the trusty CocoaPods here 
26

27
00:01:53,340 --> 00:01:55,940
and Alamofire, and SwiftyJSON.
27

28
00:01:56,010 --> 00:01:58,660
So at the moment, as I'm recording this video,
28

29
00:01:58,800 --> 00:02:05,130
Alamofire is updating its code, so that it's fully compatible with Swift 4. Now, in order to get the
29

30
00:02:05,130 --> 00:02:10,360
branch of Alamofire that is compatible with Swift4, you need to specify a version.
30

31
00:02:10,410 --> 00:02:15,720
And I'm just going to quickly show you how you can specify a particular version of a pod.
31

32
00:02:15,810 --> 00:02:19,450
So the one that we want is pod Alamofire.
32

33
00:02:19,770 --> 00:02:28,560
And then, we want to use a comma, and we're going to specify using a tilde and a right-angle bracket,
33

34
00:02:28,770 --> 00:02:31,330
and the version that we want is 4.4.
34

35
00:02:31,440 --> 00:02:34,590
But for SwiftyJSON, you can just do it the normal way.
35

36
00:02:35,160 --> 00:02:37,820
So just specify SwiftyJSON.
36

37
00:02:37,830 --> 00:02:39,880
So you've done this plenty of times before.
37

38
00:02:39,990 --> 00:02:45,120
If you haven't, please go back and check out Clima and FlashChat tutorials first before you embark
38

39
00:02:45,120 --> 00:02:50,610
on this journey because it's going to require quite a lot of knowledge about making HTTP requests and
39

40
00:02:50,610 --> 00:02:51,930
using rest API.
40

41
00:02:52,140 --> 00:02:56,820
But if you have done those modules, then you should be familiar with CocoaPods and you should know how
41

42
00:02:56,820 --> 00:03:02,610
to incorporate these two pods into a WhatFlower project and you should be able to use Terminal to install
42

43
00:03:02,610 --> 00:03:03,060
them.
43

44
00:03:03,060 --> 00:03:05,340
So pause the video and go ahead and do that.
