This project is the Swift code for the GraySky application. It is an application (developed mainly to learn and experiment with UIKit) to share their daily thoughts.
- Swift
- UIKit
- Storyboard
- Auto Layout
- Google Firebase
- Delegation Pattern
- MVVM
- Xcode 16.2+
- Swift 5.0+
First, you need to create a Firebase project. Follow the steps below:
- Go to the Firebase Console.
- Click the "Add Project" button at the top-right corner.
- Give your project a name and proceed.
- Choose any additional options Firebase offers based on your needs (for example, enable Google Analytics).
- Once the project is created, you will be redirected to the Firebase Console homepage.
After creating your Firebase project, you must set up the following structure in Firebase's Firestore database. You can do this using Firestore.
- /Entries
- {userId} (document)
- date: "dateField" (timestamp)
- likedBy: ["likedUID"] (array)
- publisherUID: "userId" (string)
- text: "EntryText" (string)
- comments: (array<(string)>)
- republishedBy: (array<(string)>)
- /UserInfo
- {userId} (document)
- username: "johnd" (string)
- name: "JohnDoe" (string)
- imageUrl: "Firestore Image URL" (string)
- bannerUrl: "Firestore Image URL" (string)
- biography: (string)
- followers: (array<(string)>)
- following: (array<(string)>)
- joinDate: (timestamp)
The /entries collection will contain individual documents for each entry (like a post).
Each entry document will contain the following fields:
- date: The date when the entry was posted (stored as a Timestamp in Firestore).
- likedBy: An array containing the user IDs of people who liked the entry.
- publisherUID: The publisher's user ID.
- text: The content of the post (a string).
- comments: Comments for this entry (comment count will be calculated from here).
- republishedBy: Republishers for this entry (republisher count will be calculated from here).
It is crucial to correctly configure Firebase Firestore security rules to protect your data. To ensure that only authenticated users can read and write to your database, configure the security rules as follows:
- Open Firestore Database in the Firebase Console.
- In the left menu, click the Rules tab.
- Paste the following security rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}
It's necessary to write values into Firestore
4. Click the Publish button to save these rules.
The IOS application is not yet available on the app store. To run the application, clone the repository and open the project in Xcode. Then, run the application on a simulator or a physical device.
git clone https://github.com/umutkonmus/GraySky.gitNote: Don't forget to add the
GoogleService-Info.plistfile provided by Firebase to your project. Click For Detailed Info
![]() |
![]() |
|---|
![]() |
![]() |
|---|
![]() |
![]() |
|---|
![]() |
![]() |
|---|
Create an issue or submit a pull request. Just so you know, all contributions are welcome.
This project is licensed under the MIT License - see the LICENSE file for details.







