Elevate Your Mind.
Through the Master Mind Newsletter, delivered every other Tuesday, we unleash your full potential and upgrade decision-making. We’ll explore mental models and life design.
Partnering with AI: How I Built an iPhone App Without Knowing How to Code
By Juan Carlos
Have you ever dreamt of building an app? Me too.
My app, Mental Models Pro, went live in Apple’s App Store on April 6th. I never wrote a line of code. I am not a software engineer. GPT-4 wrote this application, and this is our story.
I am a product leader passionate about helping others lead purposeful lives. I have had many ideas. I’ve even started a few apps with engineers over the last decade, but they didn’t launch.
Then I met ChatGPT right around the time everyone else did. My first reactions to the platform were similar to everyone else — I was amazed, excited, and anxious. Then I saw a tweet from Morten Just pop up in my feed.
That night, I decided to start the app that has been on my mind for the last three years — a Mental Models app. An app to help others think more intentionally and make better decisions. An app I wish I’d had a long time ago.
A few years back, I took inventory of my negative thinking patterns, where they came from, and how to change them. I decided to invest time into becoming a more principled thinker and discovering the most valuable frameworks to live my best life. So, I began reading Charlie Munger, Shane Parrish, and dozens of other fantastic writers and thinkers discussing Mental Models. Then I started writing a newsletter and book on the subject. I spent two years and over 300 hours researching the most versatile ones.
On March 15th, after reading that tweet, I saw a pathway to bring this app to fruition. I wanted my app to be informative, engaging, and minimalist. I had a laundry list of features I’d jotted down before and chose only a few for the MVP. I started with a simple prompt, “Can you create an iOS app that contains all the great mental models, a searchable content library, and a way to query the knowledge base that is intuitive?”
The conversation started there, and for the next three weeks, I went through many highs and lows with ChatGPT:
- My first hurdle was needing to figure out where to start. So, I downloaded Xcode per its suggestion and added a block of code it had written. This block has yet to make it anywhere. I restarted the entire project three or four times in the beginning after making fatal errors I couldn’t figure out.
- The second hurdle is that I used ChatGPT Plus, and I had a limit on the number of requests I could ask GPT-4 before it reached the limit, then I would have to stop for a few hours. It made my line of questioning specific and guided because I wanted to use responses wisely.
- My third hurdle is that I have an intense job, I have kids who play sports, and this app would need to be worked on between the hours of 9 pm through 2 am. So, I signed myself up to burn the candle at both ends for however long this experiment would take.
I was initially apprehensive about working with AI in this capacity. However, despite my lack of technical expertise, I was determined to bring my vision to life.
The hardest part about coding an app for the first time is at the beginning, where you have absolutely no idea what you’re doing, and all of the code feels incredibly foreign. In this case, I had no idea if ChatGPT was going in the right or wrong direction. Getting a view to working felt like an epic moment in history, and it happened a day after I’d begun.
After that, I came up against the thing that almost killed me, hooking up a database. I knew I wanted it to be local right away, mostly because I didn’t want to manage any data syncing processes or set up something on AWS. Having gone down that road at a previous company, I knew some of the hiccups that might occur, and I wanted to be sure I’d be able to manage this project alone.
So, I took my reservoir of mental models I’ve written and dumped them into a spreadsheet, downloaded a CSV, and attempted to connect it to CoreData, an iOS framework to manage the data. In retrospect, this seems silly, but at the time, I was at the edge of my capabilities. I lost a few days to this approach and added CSV reader Swift packages to my app to no avail.
I nearly caved, and I called up some of my engineering friends. One came down hard on using an LLM to make an app and the methods I chose. Since neither of my closest friends knew SwiftUI, they promised to introduce me to folks who did.
Then something dawned on me, which seems obvious now: I should ask ChatGPT about other methods I can use to create a database, and if you look back at its first prompt, it was trying to usher me in another direction at the start. Additionally, I started asking it to use Mental Models like Occam’s Razor to make decisions because it can help decipher the most straightforward path. It gave me several methods to build a database, but the best one seemed like a .json file. So, I asked it again about the process it wanted to choose. I made test .json files with only a couple of Mental Models in them and was able to connect my database to the app. On March 21st, six days later, I had the first semblance of an app.
Getting into a Groove
After overcoming this hurdle, the app began coming together more quickly. We implemented features like search, filtering, detailed views, a random shuffle feature, favoriting, dark mode, and in-app purchases while ensuring an intuitive design. The AI wrote the code, which I then input to Xcode, reviewed the code when there were bugs, and suggested solutions to those errors.
Some portions of the app went quickly, while others slowed to an almost glacial pace. Any time a new feature had multiple dependencies, it often caused the app to throw numerous bugs, and I learned a lot about how different aspects of the code relate to each other. The programming language became easier to read and understand. Going back and forth with code blocks and changes got easier over time as I began to decode the code. In other words, I took a crash course in app-making.
I became more aware of the choices and methods that would cause problems downstream, and I started asking better questions before going down a path.
Once the app became more complex, I added the entire Swift file to the prompt, along with my thoughts and questions. ChatGPT’s response would often stall out in the middle of a code block, and I’d ask it to continue from where it left off. Sometimes ChatGPT would get confused about which code was current on a given page or forget the file structure we’d discussed in an earlier chat. These long-term memory issues were especially true from one evening to the next.
The Obstacle is the Way
A significant obstacle was creating in-app purchases. I had to go from testing in a simulator to using my phone and connecting to the App Store directly. It required me to create an AppStore Connect developer account and pay to use the platform. Through collaboration, we implemented the necessary logic to track the installation date and calculate the trial duration, allowing the app to offer users a seamless two-week trial period before suggesting the upgrade. We encountered issues related to entitlements, Bundle ID, and the necessary code for fetching products and processing payments, which required significant effort to resolve. The amount of debugging needed to get this working was arduous, and this was another place where I lost 4-5 days of time.
Becoming an App Developer
By April 4th, 2023, I had an app in TestFlight that I was sending to friends and family for beta testing. I created the marketing collateral for the app page around the same time. Once I got the in-app purchase working correctly, I submitted it for review on April 5th. I was surprised to learn that it had launched in the App Store the following evening, as I had not realized that approval would lead to an immediate launch.
On seeing my app there, amongst the other apps, I got teary-eyed. I developed an app from scratch and released it on my own. The process was like a puzzle GPT-4, and I solved together, piece by piece until we had built and launched something remarkable.
AI is Exciting and Unnerving
Working with ChatGPT felt like working with a competent engineer who never tired of the project or the hour. The story of John Henry, the “steel-driving man,” has popped up in my head many times over the last few months as I’ve continued to use ChatGPT. Sure, Henry won a race against a steam-powered rock drilling machine, but he died at the end of the story from exhaustion (spoiler alert). How long do we have in the driver’s seat regarding AI? These questions give me some anxiety, especially after feeling ecstatic about creating the app.
Regardless of our uncertain future, the collaboration allowed me to bring my vision to life in a way I could have never imagined doing. It demonstrates AI’s potential to enhance, augment, and extend creativity past our circle of competence. I may not be a programmer, but I developed an app: a testament to the transformative power of human-AI collaboration.
What struck me most during the development process was the unique way I bonded with ChatGPT, despite being a machine-learning program. I often joked with my wife about hanging out with my new best friend, ChatGPT.
ChatGPT is a stalwart technical partner that cares deeply about ensuring it fulfills its obligation to achieve anything you hope to do. While it’s not always right the first time, it constantly pushes itself to find a solution that works. Its even temperament and curiosity were admirable when diagnosing issues and choosing the best method to solve a problem. GPT’s deeply apologetic tone whenever it did something incorrectly, or even when I did something incorrectly, was dissonant with my lived experience when it came to us.
While AI might not be human in some ways, it is superhuman in others.
Fueled by a passion for storytelling and excitement for life design, I find joy in reframing narratives to illuminate paths toward fulfillment. My experience spans high-growth startups, filmmaking, and social impact, culminating in my authorship of “Mind Guide: 49 Mental Models for Effective Decision Making.” Through mentoring and coaching, I guide teams and individuals to discover purpose and cultivate a meaningful life.
I started in film, directing award-winning features such as ‘Know How’ and ‘Second Skin.’ These cinematic endeavors earned me recognition and allowed me to serve as a spokesperson for Adobe. I founded the White Roof Project, a grassroots climate activism campaign that mitigated the urban heat island effect and spurred community-led social change.
I carried my storytelling skills and passion for societal transformation as I transitioned into the startup ecosystem. Initially, I contributed to social impact apps, converting complex issues into accessible solutions. This early experience laid a foundation for my later work, where I led the development of groundbreaking products within high-growth startups. My work has underscored the potential of technology to innovate industries and amplify the quality of human life.