How I published my first app to Apple Store #2
Tags: mobile, development, ios, learning
Published: 2024-06-23 13:11:58

Hello everyone! My laptop is still not back to life, so let's continue...

You can read the background story [here](https://dev.to/uladzmi/how-i-published-my-first-app-to-apple-store-1-491a).

### Development Process

First, I decided to go through the official tutorials and immediately came across [this paragraph](https://developer.apple.com/tutorials/app-dev-training/getting-started-with-scrumdinger):

> These tutorials are created for experienced developers who are new to SwiftUI. You’ll need to know about Swift before you begin, so start by reviewing The Basics of the Swift programming language for an overview of syntax, data types, and unique language features

I don't consider myself a highly experienced developer and had never worked with Swift before, but I really didn't want to read through the dry documentation since it would take a couple of days, and I just wanted to launch something in the simulator and my phone asap.

![debugging](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3g4zotcww80avm3pq8u.jpg)

Without much hesitation, I skipped the basics and jumped straight into the tutorials. It started off quite well, I quickly grasped the basic concepts, but then the tutorials moved on to drawing and playing audio, which didn't fit within the scope of my logger. So, deciding that the knowledge gained from the first three or four lessons should be enough, I started working on my project.

***

For the MVP (Minimum Viable Product), or in other words, to start using my own app, I needed the following features:

- The ability to add/remove exercises from a list
- The ability to add/remove sets to these exercises
- The ability to view history

I started drafting the skeleton of the app and creating the first views, and as expected, problems from my lack of Swift knowledge quickly emerged. ChatGPT came to the rescue, sometimes providing complete nonsense, but also giving good ideas on where to dig. On the other hand, if I had finished the tutorials, I wouldn't have needed its help in many instances. Maybe I'll finish them next time... but who am I kidding 😅

In addition to ChatGPT, I didn't neglect the good old Google, and my application started to take shape.

![google](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdh84zu1h7cpvm4h5lib.png)

***

One of the first questions to answer was data storage, as changing this aspect in the future would be very challenging. A full-fledged backend seemed overkill, although there are plans to try setting it up from scratch in the future. The tutorials provided an example of storing data locally in a JSON file, but that option didn't suit me either. In this case, I would either have to create many files for each type of object, for example, a file for exercises, a file for sets, a file for sessions, etc., and then somehow combine them, or store everything in one single file, which is not optimal and difficult to model properly. SQLite seemed like the ideal option, so I started looking in that direction. With the help of Google, I discovered that iOS has its own framework suitable for tasks like mine, and after fiddling for a couple of weeks with the help of a few YouTube videos and some GitHub examples, I managed to set up CoreData, which essentially uses SQLite inside, as I wanted.

Having figured out data storage, I started to think about where to get the initial list of exercises. One option was to create the exercises using the app itself, which was realistic for the first tests, but I didn't want to manually create 20-30 exercises. In the end, I decided to read the list of exercises from a CSV file and write them to CoreData at the first launch, updating what changed on subsequent app launches. I generated the exercises and their descriptions using ChatGPT, resulting in a list of 100 exercises for the main muscle groups.

***

Pleased with myself, I decided it was time to move on to testing in real conditions and began replicating workout records in my own app. Everything worked more or less stably, with many minor bugs that were easily fixed in the evenings. There was only one thing that bothered me: the app was not user-friendly at all, namely:

- I had to search for exercises in the huge list every time
- I had to set the weight and reps every time, even though I didn't increase the weights every workout and could simply use the last one
- And a few other similar little things that I initially didn't pay attention to, and it took a few more weeks to refine them.

Besides usability issues, another problem arose, which I thought was a bug, but I couldn't catch it. The issue was that about a week after installing the app on my iPhone, it stopped launching. This was very frustrating, as I deleted and reinstalled it a couple of times, losing all history. After a few such deletions, I finally realized that I could re-upload the app without deleting it, preserving the history, but even that didn't save me, as I often forgot to re-upload the app on time. It turned out to be a certificate issue, which without an Apple developer program subscription was valid for only one week, meaning it was time to create a full-fledged developer account. Nothing foretold trouble, and I was already imagining how I would publish the app next week, but my enthusiasm waned when I found out the subscription cost 100€ per year. This slightly altered my initial concept, but I'll talk about that and the preparation process for release in the next part...

***

Thanks to everyone who read till the end!

You can view screenshots or download it [here](https://apps.apple.com/de/app/yet-another-workoutlogger/id6484401597?l=en-GB&platform=iphone).

Any feedback is appreciated, thanks, and stay fit!