The course is part of this learning path
In this course, we're going to create a Snapchat clone using structs and various advanced techniques of Firestore.
Learning Objectives
- Learn how to make a Snapchat clone
- Understand all the features of Snapchat and how to set them up
Intended Audience
This course is intended for anyone who wants to learn how to develop apps on iOS.
Prerequisites
To get the most out of this course, some basic knowledge of iOS development would be beneficial. We recommend that you take this course as part of the Developing Mobile Apps for iOS learning path.
Hi, within this lecture, we're going to create our Xcode project and we're going to bring in the Firebase SD case and we're going to set our Firebase dashboard up so that we would be ready to start writing our SnapchatClone and you know how to do all of these things. So, I'm going to be fast.
So, create a new project, and choose 'Single View App' from here. And I'm going to call this SnapchatClone. And, of course, we're going to use Swift, and we don't need anything else. So, let me click on 'Next' and 'Create' this under my iOS complete folder. So, once we do that, in fact, we're not going to do anything more over here, we're just going to create our Firebase project so that we can bring in the Firebase SD case.
Later on, of course, we're going to work on our user interface. But right now, I just want to create my Firebase project. So, let me go to my console in Firebase and just add a new project. And once again, if you haven't watched the Instagram section, please go back and watch it because it's going to be fast. So, I'm going to say this is a SnapchatClone, and I don't need any Google Analytics right now, and let me create my project. So, this will create my project. And, of course, I'm going to come over this Xcode project and bring in the SD case. So, I believe we have to close this down because we're going to initialize the pod file and then we're going to install the pods. So, let me add iOS project over here. And we need the bundle ID. So, let me open it one more time because I'm going to copy the bundle ID from the general settings of our projects. That's the one. So, let me copy this and go back to my iOS bundle ID, and let's call the Snapchat Clone, and let me register this app.
Later on, it will create a configuration file for me, which I will download and just place it on my Xcode project. And previously, I have some in my downloads folder, so I'm going to delete this and I'm going to download it. And I'm going to bring this into my Xcode project. So, let me do that, and this is the third time I'm opening this project. So, I wish I hadn't closed it down in the beginning. So, let me bring this in, and let me make sure that copy items if needed and this SnapchatClone is chosen. Once I do that, now I'm finally ready to close this down because we're going to bring in the SD case. So, let me open the guide, but we're not going to use the guide anymore because we already know how to import everything. So, step one: create project; step two: create this Firebase dashboard and everything. We did all of that. It is time to initialize our pod file and bring in the necessary pods. So, let me do that. In fact, let me close this down for right now because we don't need our simulator at this point. So, let me open my terminal. And in the terminal, I'm going to go into my project folder by running change directory commands and then initialize the pod file and then edit the pod file to bring in the Firebase SD case.
So, I'm going to go into downloads and iOS complete, so you have to go wherever you saved it as before. So, I'm going to go into SnapchatClone. And as you can see, if I say ls, I will see the files and folder, and then I'm gonna create my pod file. Then let me go to SnapchatClone to pod file and open this with text editor. Once we do that, we can come over here and say 'Zoom In' to see it better. And under this use_frameworks, I'm going to have to bring in the Firebase SDK, Firebase pods. So, that's what we need. Let me copy all of this from here and, in fact, we're going to need more. So, let me bring them in and in real-life examples, of course, you're going to have to check the latest names for the pods as well. But right now, I know this is analytics of Firestore and on top of that, I'm going to need Core and Storage as well. So, this is Core, and this is Storage.
So, again, you may want to check to see the real names, but they haven't been changing it for like two or three years I believe. So, I don't think they will change it in real future. So, I believe we're good to go with these names. So, let me save this, and let me close this down. And now we have to run pod install to install every pod on our project. So, here you go. It's already installing and as you can see, they are all shown in green, which means that they are newly installed, and they are all in this latest version I believe. So, now we are ready to use our workspace project. So, make sure you choose the workspace rather than Xcode project. Once you do that, it will take some time to index all these project files because we now have a lot of Firebase files. A lot of pods that we have brought into our project, and we have to wait until it's indexed. So, let me come over here and as you can see, we have to say FirebaseApp.Configure() in the appDelegate.
So, let me go back to my projects, and it's still indexing. But let me see if I can import the Firebase. And let's say, import Firebase; it works. So, under didFinishLaunchingWithOptions, we're going to call FirebaseApp. This FirebaseApp.Configure(), and this will configure my app so that I can use Firebase. So, while we wait to be completed, let me go back to my Firebase dashboard so that we can initialize every module that we need in this section. So, let me go back to here. So, let's start with authentication. Even though we're going to get user names and work with user names, I have to enable this email and password thing because we're going to create our users with email and password anyway. So, let me say this is enabled, and let's go to our database. I'm going to initialize our Firestore. So, let me say create database, and I'm going to start in test mode. And this will ask me to choose a data center and as I explained before, you cannot change this afterwards.
So, if you're building for release, make sure you select a good one. Like if you're targeting only US, you can select US. If you're targeting only Europe, you can just select Europe because you cannot change it later on. So, once you do that, you will create your Firestore, and you will be ready to work with Firestore modules. So, here you go. It's still indexing. Let me go back. And once it finishes, I'm going to go to storage and initialize storage as well. So, let me go here and say 'Get Started'. So, it asks us for default security rules. If authentication is not null, it's good to go. So, I'm going to say, 'Next', and it will ask me the data place one more time even though we cannot change it now. So, I'm going to say 'Done'. And it will create my storage as well. Now, we have initialized everything in the Firebase that we're going to work with, and we have brought in the SD case. Once it finishes indexing, we are good to go. Let's do that in the next lecture.
Atil is an instructor at Bogazici University, where he graduated back in 2010. He is also co-founder of Academy Club, which provides training, and Pera Games, which operates in the mobile gaming industry.