Learn how to build iOS apps is challenging, no doubt about it! How can you increase your chances of success? Today, I'll show you my no. 1 strategies to create better, more profitable apps faster. You don't have to do this alone… The days of the nerdy programmer, sitting in the attic, hacking away at some new algorithm, are over. No more pale faces illuminated by the glow of a green computer terminal! Meetups about iOS development are happening all over the world. Everybody is an entrepreneur, and everyone has a new idea for an app. But are you just talking about your app idea? The difference between having an idea and having an actual app is sitting down and doing the work. That's the advice I'm giving you today. JFDI! Here's how: - Start with a simple, basic app idea
- Design and map out your app's features
- Work out your app's data structure
- Investigate frameworks and libraries
- Set up your app project and build the first feature
- Build the next feature when you're ready
- Refactor, keep going and don't stop
This has a few advantages: - You're building an app that can potentially make money
- You're gaining real-world experience by solving real-world problems
- You learn much more, much faster because you're continually testing your knowledge and skills
Building an app project is a great way to gain real-world experience, and that's important to get hired by a client or an employer. They want to see what you've built, and what insights you've gained, and how your skills are an advantage for their projects. So, start your app project! Here's how. Start With a Simple, Basic Idea Start with a simple, basic idea. Don't try to create a Facebook or Instagram straight after you've written "Hello world!" for the first time. Think about it: when you set your expectations too high, and get stuck on a programming problem that you can't solve easily, you might be tempted to give up... And that's not what you want. What are good app project ideas? - A to-do app. A to-do list app is the perfect app project to learn working with table views, app navigation, and app data storage.
- A simple game. Build something like an arcade game, a top-down shooter like Asteroids, or a hyper-casual game. Avoid games that involve complex logic, like multiplayer games or strategy-intensive games like chess.
- A chat app, chat bot, or iMessage app. Create a chat app with Firebase, a chat bot for Messenger, or an iMessage integration. You'll also need to integrate 3rd-party tools, like Facebook Apps.
Don't worry if an app is already invented, or exists already in the App Store. The goal of your app project is learning, not creating something unique. Design Your App Project's Features The next step is designing your app project's features. This can be as simple as scribbling down a few notes on a piece of paper, or creating a full-blown app mockup and graphic design. It's easiest to just answer the following questions: - If you could only pick one thing the app should do, what would that be?
- What does this feature look like? What goes "in" and what comes "out"?
- Can you simplify this feature, to make it easier to build?
Let's say you are going to build that to-do list app from the previous step. What features should the app have? - Create and edit to-do's
- Show all to-do's in a list on screen
- Check to-do's as completed
That's it! Don't overcomplicate your app by adding more features – this is enough. Based on the list of features you can define the User Interface (UI) screens that should go into your app. Work Out Your App Project's Data Structure Almost every app stores data of some kind, either offline locally or online in the cloud. - A game app might need to save and share highscores
- A to-do list app needs to store to-do items locally
- A chat app needs to cache the most recent messages
The data storage tool you need depends on your app project. A few examples: - Saving Swift objects to disk with
NSKeyedArchiver - Storing configuration values with
NSUserDefaults - Creating an offline database with Realm or Core Data
- Storing objects in the cloud with Parse Server or Firebase
It's easiest to work with NSKeyedArchiver , which essentially "dumps" your Swift objects into a file that's stored on the iPhone disk. You can hardly call this a database, because it's just a flat file that you can only read from and write to. You can't select or "query" any data from it. With Parse Server and Firebase you can query a database in the cloud. When you save data in your app, it gets sent to the online database. This is ideal for multi-user apps and syncing between apps. Once you've decided which tools you want to use, figure out the data models of your app. Which kinds of structured data do you need to save, and what are the properties of those objects? For example, a Todo object has the following properties: - The
text of the to-do item - A
createdAt date-time that specifies when the object was created - A
completionDate date-time that specifies when the to-do was completed - Optionally, a
user field that specifies which user this to-do belongs to What kind of query do you need to get the right to-do items? - Select all
Todo objects - Where
user is equal to the currently logged in user - Order by
createdAt , in descending order, so the most recently created to-do shows on top of the list Once you start "thinking in data", it's easy to figure out what the data models, properties and tools should look like. Investigate Frameworks, Tools and Libraries Every time you start a new app project, ask yourself a simple question: what third-party tools and libraries can I use? A few examples: - Alamofire for easy HTTP requests
- SwiftyJSON to easily work with JSON objects
- PromiseKit to manage asynchronous code
- LGSideMenuController to make one of those hamburger menus
- XLPagerTabStrip to make tabbed view controllers you can swipe
Some tools aren't even third-party, but are provided by Apple: - Auto Layout to make designing your responsive app easier
- NSCache to cache objects in memory, better than just an
Array - SiriKit or any of the other Cocoa Touch frameworks
There's so much code out there! Chances are a library already has what you're trying to build. You can implement the library, change some of its properties, and even copy its code and change it yourself. It's also a good idea to think about what you want to achieve with your project. - Do you just want to build a simple app? Then don't use any of the specific libraries, but focus on building the app with the basic tools first.
- Do you want to learn how to use a cloud-based back-end? Then focus on that first.
- Do you want to play with a library you found? Then focus on that.
Don't focus on everything at once, and don't load up your app project with too many libraries. Perfection often lies in taking away, not adding more. Set Up Your App Project & Build The First Feature Now that you've prepared your project, you can finally set up your app project and start working on the first feature. A few things to keep in mind... First, make sure you keep your workspace tidy. A clear workspace is a clear mind, and and a clear mind learns and performs better than a chaotic one. This means your physical workspace as well as your digital one. Think about: - Make sure to save libraries, project assets in consistently named folders.
- Keep your code clean: remove code you're not using, and use indentation to make your code more readable
- Cleanly remove libraries or code you're not using, to avoid saving "remnants". If you for instance want to remove a library from CocoaPods, don't just delete it, but remove it from the Podfile and build it again
Second, build every feature one by one. Don't build everything at once! Make a list of sub-projects to complete: - Configure the project
- Create the data model classes
- Make the first view controller
- Load up all the to-do items
- Customize the query that loads the to-do's
- Create the edit UI
Do not continue with a next project until you've finished the first. If you get into the habit of not finishing what you've built, for instance because you've ran into a challenging code problem, you'll reinforce that behavior in your mind. How you do anything is how you do everything. Third, try to base what you do on what you know. This is perhaps the hardest thing about learning: how do you know if you're doing it the right way? When it comes to programming, there are so many right ways to do something, and so many wrong ways. Learning how to code is as much about knowing which way is right, as it is about having the skill to know how to do that. Knowing what's the right way often comes down to repeating something you know. When you're starting to think you're doing it the wrong way, take a step back and find a resource that explains you how to do it the right way. This can be a coding guide, a tutorial, or a friend who shows you how. How To Ask For Help At least 60% of coding an app project is solving problems. This is part of learning, and even the most adept coders still learn every day. It's inevitable that you get stuck with a coding problem or a bug at some point. If that happens, how do you ask for help? First, you have to understand that the best developers know how to solve problems on their own. You cannot rely on outside help forever. Your coding skill grows as you learn how to solve bugs on your own. Here's how you can get over almost any bug: - First, make sure you have a clear understanding of the problem. Make it as small and as simple as possible, so "I don't know how to connect to the database" isn't a problem, it's a feature, and it's too big. This is better: "I tried to connect to the database, but it says
Error Message ". - Second, simply Google the error message, optionally add "ios swift" or "ios xcode" in your search query to help Google. Often, the solution is within the first few results on the page. Read the solutions you've found, and try them out. Does it solve your problem?
- Finally, if you can't find it, ask a question on StackOverflow, Quora or Reddit. Clearly define the problems, the steps to reproduce it, the relevant code (not all of it!) and what you tried to solve it.
Be mindful of that last point. You won't get help with a coding problem that's vague, that you haven't tried to solve yourself, and that's hard to reproduce. Quick tip: Don't be lazy. When you're writing your question on StackOverflow, you're stuck, frustrated, and you're low on creative problem-solving energy. Take a step back, get a coffee, go for a walk, and either face your coding problem fresh, or ask for help when you've freshened up. Refactor, Keep Going and Don't Stop Don't leave every app project uncompleted. Leaving a project or feature incomplete will reinforce the habit of not finishing what you've started. Abandon a project if it's completely lost, but don't do that for every project. See if you can finish your app project as close to 100% completion as you can, and ideally, more than 100%: - Bad: 50% is a half finished project
- Better: 70% is a half finished project of which you've refactored 20%
- Good: 100% is a fully completed project
- Best: 130% is a fully completed project of which you've refactored 30%
Why redo a project? Once you've finished a project, during the project you often run into aspects you'd do differently next time. Make sure there's a next time! Say you're working on your data model for the to-do list app. You create a boolean property that determines whether a to-do is completed or not. You complete the project, but while you do that, you figure that it's more effective to save the completed / uncompleted state and the completion date-time in one step, instead of two. You've finished the app project now, but then you "backtrack": instead of using two properties for completion status and date-time, you go refactor your code and change it into just one property. This is called refactoring, and it'll greatly improve your skill as a programmer. It's often much smarter to choose the best of two options, instead of choosing the only option you know. As a beginner programmer you want to increase the number of options you have for solving a problem, and one way to do that is to literally solve a problem twice, in different ways! Want to level up your iOS development skills? Check out my flagship iOS development course. You'll learn how to build iOS apps from scratch, get helpful support, and free updates for new iOS, Swift and Xcode versions. » Learn more Start Your Project Are you ready to get started on your iOS app project? Awesome! You know what the real difference is, that your app makes? Getting your app in the hands of people is really cool. Doing your work for them, getting your ideas out into the world, that's what motivates you to keep going. I can't wait to see what you're going to build. Keep me posted, would ya? —Reinder PS. This is already the last lesson in this course. Oh no! Don't worry – I'm back in a few days with a few downloadable goodies. Stay tuned! |
0 Komentar untuk "[Lesson 7] You don't have to do this alone"