So up till now, we've got an app that is able to use a pre-trained flower image recognition model to 1
recognize the flower in our pictures. 2
Now, wouldn't it be cool if we could look up the name of that flower in Wikipedia and give the user a 3
little bit of information about that flower? 4
If you're like me, you know, a complete gardening noob, then I would love to know a little bit about the 5
flowers that I see around me, 6
so I think that would make a pretty neat feature in addition to what our app already does. 7
So in order to do that-- 8
So it's actually not that hard to do it because we've really learned about REST APIs and how to make 9
HTTP requests using Alamofire in Clima and in FlashChat. 10
So part of this lesson is going to be reviewing what we did back there, 11
and you can do it as a challenge. 12
So, first, let me show you what we're looking for. So I'm on Wikipedia at the moment. 13
And in the last lesson, I found out that the flower that I have on my desk is a Barberton Daisy. 14
So let's have a look on Wikipedia and see what that looks like. 15
So as you can see Barberton Daisy redirected to Gerbera jamesonii. 16
I'm probably murdering how that's pronounced. 17
But, anyways, Wikipedia gives us a little bit of background information on this particular flower, 18
and also it shows us all of these images Barberton Daisies in the wild. 19
And I think to my human eye, they look pretty similar to the one that I've got, 20
so I think my image classification seemed to work. 21
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
to then also pull up this information from Wikipedia and show it to me in the app. 23
Well, it's actually pretty easy to do it because Wikipedia has open APIs. So we can tap into it and 24
grab this little extract and put it into our app. 25
So as you did before in Clima and also in FlashChat, we're going to be using the trusty CocoaPods here 26
and Alamofire, and SwiftyJSON. 27
So at the moment, as I'm recording this video, 28
Alamofire is updating its code, so that it's fully compatible with Swift 4. Now, in order to get the 29
branch of Alamofire that is compatible with Swift4, you need to specify a version. 30
And I'm just going to quickly show you how you can specify a particular version of a pod. 31
So the one that we want is pod Alamofire. 32
And then, we want to use a comma, and we're going to specify using a tilde and a right-angle bracket, 33
and the version that we want is 4.4. 34
But for SwiftyJSON, you can just do it the normal way. 35
So just specify SwiftyJSON. 36
So you've done this plenty of times before. 37
If you haven't, please go back and check out Clima and FlashChat tutorials first before you embark 38
on this journey because it's going to require quite a lot of knowledge about making HTTP requests and 39
using rest API. 40
But if you have done those modules, then you should be familiar with CocoaPods and you should know how 41
to incorporate these two pods into a WhatFlower project and you should be able to use Terminal to install 42
them. 43
So pause the video and go ahead and do that.