Mac Code Developing Apps
Swift is a fast and efficient language that provides real-time feedback and can be seamlessly incorporated into existing Objective-C code. So developers are able to write safer, more reliable code, save time, and create even richer app experiences. A beautiful app using Swift. After launching Visual Studio for Mac you’ll see the dialog below, click New to begin creating the project. If you already have Visual Studio open, you could also use the ⇧⌘N shortcut to open the new project dialog. From here we will create a.NET Core Console project by selecting Web and Console App Blazor WebAssembly App. From a single code base, a developer can produce an app that will run on virtually every tablet and phone in the market. Also Read: 10 Best IDE for Programming; 5 ways to Improve Programming Skills; Top 8 Highest paid Programming Jobs. So these were some ways to develop iOS and macOS apps for Windows.
In this tutorial, we’ll discuss how you can best learn iOS app development. We’re going to look at how you can learn to code iOS apps, instead of focusing on how to build an app.
Just as with learning anything new, learning iOS development is challenging. It’s also fun, exciting and rewarding! Can you take an approach that takes the frustration out of learning how to build iOS apps, while getting you faster to the finish line? Yes!
Here’s what we’ll get into:
- What iOS development topics you need to learn and skills to master
- The general focus areas of learning iOS development, such as Xcode
- Common pitfalls for beginner iOS developers
- Why it’s worth it to get through “the dip”
- How to keep momentum by coding 1 hour every day
- A step-by-step plan for starting your own app project
When you’ve finished reading this tutorial, you will have a step-by-step plan for learning how to code. You know exactly what to do, what steps to take, and how to take them. Oh, and you don’t need any coding experience to get started.
Ready? Let’s go.
Getting Started With iOS Development
Let’s first talk about what skills you need to build your own apps.
- Master Xcode: Xcode is the Mac app you use to create apps. It has a code editor, project organizer, compiler, debugger, and many more important tools to build great apps.
- Swift Programming: Swift is the powerful programming language that you use to code iOS, macOS, tvOS and watchOS apps. It’s easier to learn than Objective-C, and Swift packs a ton of features that help you code productively. It’s also a lot of fun!
- Build UIs: Every app needs a User Interface (UI). UIs are made up of buttons, views, navigation, labels, images, controls, etcetera. It’s important that you know how to build UIs and design them. You can use view controllers or SwiftUI.
- Coding Logic: Your Swift code governs what happens in your app, and when. If this then that. This is called logic, and it’s crucial to any app. Most of learning iOS app development is focused on understanding code and logic, and being able to code from scratch.
- App Architecture: Writing clear, extensible and maintainable code is as important as writing code that works. App architecture is like the foundation you build a house on. It’s a challenging topic, and it takes time to learn what solution works best in different scenarios.
Can anyone learn how to code? Absolutely! You only need some time, and a little bit of perseverance to get started. It helps to pick an iOS app project you want to build, because that’ll motivate you to learn more.
Xcode, the Mac app you use to create iOS apps, only runs on macOS. And to use macOS, you need a Mac computer. Xcode doesn’t run on iPad, unfortunately. If you want to learn iOS development, you will need a Mac! There are other options too, as I’ve explained in this tutorial.
Learn how to build iOS apps
Get started with iOS 14 and Swift 5
Sign up for my iOS development course, and learn how to build great iOS 14 apps with Swift 5 and Xcode 12.
Practice One Hour Per Day
One hour a day…
This is my no. 1 rule for learning anything. If you can set aside one hour a day to focus exclusively on learning iOS app development, you’re guaranteed to make progress. It’s that simple.
Here’s how it works:
- Learn iOS app development for one hour a day, every day, for one year
- Focus exclusively on iOS development in this hour, without distractions
- Set a timer for an hour, and stop when the timer goes off
- Get back to learning iOS app development for one hour the next day
- When you miss a day, don’t worry, and pick it up again the next day
Research shows that our brains learn new information when we repeatedly expose ourselves to the learning material, in different ways. You could say that practice makes permanent, so by consistently spending time to learn iOS development you will master it.
In the years that I’ve run LearnAppMaking.com, I’ve seen many people learn to code iOS apps. A pattern that stood out among successful learners is that they learned habitually, and kept their momentum between learning sessions. So, when you learn consistently, and get back to it regularly, you’ll learn app development more successfully.
Learning is of course a complex topic. If you’re interested to learn more about how we learn, I recommend you check out Barbara Oakley’s excellent Coursera course, Learning How To Learn.
Do excuses bog you down, when you want to learn iOS development? Commit to 1 hour of learning a day. Keep a run streak count on your calendar to keep yourself accountable. Mark every day you learned for 1 hour with a big red X, and don’t break your day-to-day streak. No zero days!
Recommended iOS App Development Topics
Let’s take a look at the topics you’ll need to learn to master iOS app development. And get my open source Swift cheatsheet while you’re at it!
Begin with these Swift topics:
Then move on to topics about the iOS SDK:
- Working with view controllers and SwiftUI
- Working with UI elements such as
UILabel
,UIButton
andUIImage
- Working with table views and tab bars
- Working with navigation and UINavigationController
- Sending and receiving notifications with NotificationCenter
- Learn how to find and fix bugs effectively and efficiently (with zero frustrations!)
- Get to know Xcode, Interface Builder and iPhone Simulator
Looking for a great app project to build? Try these:
Then learn about app architecture:
- Get started with Model-View-Controller
- Learn why app architecture matters
- How to pass data between view controllers
- Learn about SOLID, DRY and the Single Responsibility Principle
- Focus on testable code and Dependency Injection
And focus on some intermediate topics:
Finally, get some diversity into your learning with:
- Learn about algorithms
- How do you keep up with Swift changes?
- Learn to find what you need in Apple’s documentation
- How to transition from tutorials to writing code from scratch
Looking for comprehensive, in-depth iOS app development training? Check out my flagship iOS development course, here at LearnAppMaking. The above topics, and many more, are introduced gradually as you build 6 different iOS apps in the course. And you get 1-on-1 help in our developer community! » Learn more
Get Through “The Dip”
I’ve learned plenty of new things in my life. Every time I learned a new skill, I would encounter something known as “the dip”. The concept of this “dip” was originally introduced to me by Seth Godin.
You want to get through the dip as soon as possible, because everything gets easier after the dip. The idea of the dip is quitting before you start something, and powering through the dip no matter what, if you decided to pursue your goal.
Here’s how you recognize the dip when learning iOS development:
- You can write more code, with fewer errors, without running your app in between, to check your results
- When you encounter bugs or errors, you have an intuitive workflow that you follow automatically
- You get better at reading someone else’s code, and understand what they’re doing
- You understand what tools and components you need to build an app feature, and you can create a break-down of steps you need to take to build it
When you feel a certain fluency when you’re coding apps, you know you’re through the dip. It’s a great feeling of ease, clarity and comfort. And it’s awesome!
Beginner iOS developers make two common mistakes when dealing with the dip:
- They don’t give up before the dip, and lose valuable time
- They slack off, and stay in the dip forever
When you set your expectations of learning iOS app development too high, you’re likely to give up when the going gets tough. You get frustrated, lose motivation and give up. If you reflect on this before starting, you might be compelled to give it a try and decide that it’s not for you.
When there’s too much time between learning sessions, you don’t build up momentum. Your brain doesn’t get enough exposure to the materials you’re trying to learn. So, you forget what you learn and you won’t get over the hump.
It’s surprisingly simple to overcome these mistakes. Here’s how:
- Give up before you start, and if you start, don’t give up
- Commit, build momentum, and keep the pressure on
If you give up before you start, you will never have to get through the dip. It sounds defeatist, and that’s the point: quitting before you start is exceptionally effective! You can try lots of things, decide that it’s not for you, and move on. You increase your chances of succeeding at a greater number of goals, having tried many of them. And think about the time you’ve saved!
If you commit to learning app development, then follow through. Don’t give up! Commit yourself, build momentum, and keep the pressure on. Power through the dip, and everything gets easier after.
The essence of the dip is your ability to assess future failures, and choosing what to commit to. You save time, money and energy because you didn’t waste it on something you were going to give up anyway. Instead, you spend these resources on something you’re 100% committed to. And that’s what you’ll succeed at.
This is an excellent video that explains how The Dip works, in more detail.
How To Start Your Own App Project
The best way to learn iOS app development is to start your own app project. You can try out newly learned things in your own app, and gradually build towards a complete app.
The single biggest struggle for beginner app developers is transitioning from doing tutorials to coding your own iOS apps from scratch. Everything makes sense when you’re following a tutorial, but you’re stumped when starting a project from scratch.
Sounds familiar?
When you start your own project as early as possible in the learning process, you get used to coding from scratch. And that’s exactly what you want to practice. Don’t stay stuck with iOS tutorials!
Here’s the approach I recommend:
- Learning Phase: Start with tutorials, and let them teach you individual topics and skills
- Practice Phase: Apply what you learn in tutorials in mini “sketch” projects to practice
- Experience Phase: Focus on incorporating newly learned topics and skills in your big project
Divide your time equally between the three phases. You can move between the phases however you see fit, but you’ll see that it’s easiest to go from Learning to Practice to Experience.
The last step is called the Experience Phase because real-world experience is important. If you stay in the learning and practicing phases, you never incorporate what you learn in real-world projects.
It’s exactly this real-world experience that matters to employers, freelance clients, indie apps and startups. Building iOS apps is different in the real world, compared to the classroom. You might learn “fake” swimming on land first, but you don’t want to stay there forever. Jump in!
The Practice Phase is crucial, too. I see iOS developers learn something new and then immediately apply it in a real-world project. This leads to errors and frustrations, because your new skill hasn’t developed enough to be ready for an actual project. Practice it from different perspectives first and avoid copying-and-pasting code.
How do you start your app project?
- 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 1st feature
- Build the next feature when you’re ready
- Backtrack, keep going, and don’t stop
I’ve written extensively about creating your app project from start to finish, so here are a few quick tips:
- Don’t try to build the next Facebook, and don’t make your app idea too complex
- Keep a notebook of best practices, summaries and tips and tricks
- Gradually upgrade your goals when you feel you can handle more challenging projects
- Learn to approach a problem from several angles, and learn different solutions for one problem – this one skill has kept me in business for 10+ years
- When you use a framework or library, find out how it works internally
- Go back to code you’ve written before, and features you’ve build, and improve them with what you know now
Building your own app project is incredibly fun and rewarding. It’s not just the end result that counts – the gradual progress of improving, learning and refining is what makes it worth it. And you’ll cultivate a valuable, employable skill in the process: iOS development!
Learn how to build iOS apps
Get started with iOS 14 and Swift 5
Sign up for my iOS development course, and learn how to build great iOS 14 apps with Swift 5 and Xcode 12.
Further Reading
Are you ready to take on your app project, and learn iOS app development? So far, we’ve looked at:
- What topics you need to learn and skills you need to master
- The general focus areas of learning iOS app development
- Two common pitfalls for beginner iOS development
- Why it’s worth it to get through “the dip”
- How to keep momentum with coding 1 hour every day
- A step-by-step plan for starting your own app project
Want to learn more?
- Check out my free iOS basics course, which guides you through the basics of iOS development in 7 days
- Sign up for my flagship iOS development course to master iOS development and much, much more
How can you run Xcode on Windows and develop iOS apps with a Windows PC? The short answer is: you can’t! You’ve got a few alternatives to get around that, however. In this tutorial, we’ll discuss how you can install Xcode on Windows to build iOS apps.
Here’s what we’ll get into:
- Rent a Mac in the cloud (starting at $20/mo)
- Run and compile Swift directly on Windows/Linux
- Learning to code with a Swift Sandbox
- Build your own “Hackintosh” by installing macOS on a PC
- Run Xcode on Windows by installing macOS on a virtual machine
- Develop iOS apps on Windows with cross-platform tools
- Get your hands on a second-hand Mac (starting at $300)
Let’s get to it!
Xcode for Windows: What & Why
Xcode is the macOS-only software program, called an IDE, that you use to design, develop and publish iOS apps. The Xcode IDE includes Swift, a code editor, Interface Builder, a debugger, documentation, version control, tools to publish your app in the App Store, and much more.
Xcode contains everything you need to build iOS apps, and it only runs on macOS!
That’s when the problems start. You want to make an iOS app with your Windows PC, but you can’t buy a PC or laptop with macOS pre-installed on it. Unlike Windows, Apple doesn’t license its operating system to other computer manufacturers. You can only use macOS on a Mac.
In fact, when you obtain a license to use macOS, which happens when you purchase a Mac computer, you have to agree to only run the operating system on Apple hardware. This effectively limits you to only develop apps on a Mac.
“It’s more fun to be a pirate than to join the navy.”
— Steve Jobs (1983)
But… it’s more fun to be a pirate, than to join the navy, right? Let’s discuss a few alternatives that’ll let you run Xcode on Windows and develop iOS apps on a Windows PC!
Rent a Mac in the Cloud
An even easier way to get your hands on macOS, albeit more expensive, is to rent a Mac “in the Cloud”. You can work with Xcode on Windows with this approach, because you’re essentially connected to a Mac that’s elsewhere.
Here’s how that works:
- Someone connects a bunch of Mac’s to the internet
- You sign in on one of those Macs via a Remote Desktop Connection (RDP)
- Done! You can use this Mac from Windows/Linux and build iOS apps
Services like MacinCloud and MacStadium offer affordable rent-a-Mac products, usually paid on a monthly basis. Prices typically start at $20/month and you can choose from several hardware options, including Mac Mini and Mac Pro.
Starting at | Type | |
---|---|---|
MacinCloud | $20/month | Dedicated, Virtual, Server |
MacStadium | $79/month | Dedicated, Enterprise |
virtualmacosx.com | $9.75/month | Shared (timesharing) |
Mac Cloud | $49/month | Virtual |
Flow | Premium | Dedicated, Enterprise |
HostMyApple | $25/month | Virtual, Dedicated |
You connect to those cloud-based Macs via a Remote Desktop Connection (RDP). Windows includes a stock Remote Desktop Client you can use, and so do most Linux operating systems. Once you’re logged on, you can launch Xcode, and start building your iOS app. That way you’re effectively running Xcode on your Windows PC!
Cloud-based Macs usually come in 3 flavours:
- A dedicated Mac, which means you get access to a physical Mac located in a data center, as if you bought a Mac in the Apple Store and put it on your desk.
- A virtual Mac, which means you get access to a virtual Mac in a data center, much like the VirtualBox solution mentioned earlier. Your Mac won’t run on Apple hardware, but it will run macOS.
- A Mac Build Server, which is a specialized kind of Mac that can be used to compile iOS apps. You’ll create those apps on your Mac, and then instruct the Build Server to compile the app for you.
A dedicated Mac is the most convenient, and the most powerful option. A virtual Mac is OK too, but it typically does not perform as well as a physical Mac computer.
Running Xcode via a Mac in the cloud has a drawback: you can’t easily connect your iPhone to Xcode via USB! With Xcode on your local Mac you can run and debug your app on your own iPhone, via the USB/Lightning cable. This obviously won’t work when your Mac is in the cloud…
Don’t worry! There are plenty of solutions for that:
- A simple approach is to run your app on iPhone Simulator, right from within Xcode. You can launch iPhone Simulator in Xcode, and debug your app with it. This is perfect for the development phase of your project.
- An alternative solution are tools like Flexihub, NoMachine and USB Network Gate. They only work with dedicated Mac hardware, and you need to have a dedicated IP address.
- Install your iOS app on your iPhone via TestFlight, and debug it with a tool like Bugsnag. You can monitor and debug live crashes in your app.
An interesting use case for renting a Mac in the cloud comes from the latest developments in Apple’s hardware. Many designers, developers and desktop-publishers have voiced their concerns over Apple hardware lagging behind, offering low-spec computers for a fairly high price.
If you don’t want to take your $3.000 MacBook Pro with you in a coffee shop, or on your next trip to Thailand, why not purchase a low-end Windows or Linux laptop, and connect to your Mac in the cloud? You can either host it at home yourself, co-locate it in a data center, or rent a dedicated cloud-based Mac.
Do you want to learn how to code iOS apps, but don’t want to invest money in a Mac? Rent a Mac in the cloud for the duration of the iOS development course you’re taking! It’s a great way to bootstrap learning iOS development, and you can always buy your own Mac later.
Learn how to code iOS apps
Get started with Xcode and Swift
Ready to get started with iOS development? Learn how to code iOS apps with Xcode and Swift with our immersive iOS development course. Works both on Mac and PC!
Install macOS on Your Windows PC via VirtualBox
The easiest way to run Xcode on Windows is by using a virtual machine (VM).
A virtual machine will create an environment an operating system can run in, as if it’s running on the hardware itself, except it’s running “on top” of your actual hardware and operating system. You can then run Xcode normally, because it essentially runs on macOS on Windows!
This is called virtualization, and it allows you to run Windows on Linux, macOS on Windows, and even Windows on macOS. One of the benefits of virtualization is to run multiple OS side-by-side, which is useful for cross-platform development.
You need 2 things to run macOS on Windows in a VM:
- A copy of macOS, as an installer or virtual disk image file
- A virtual machine tool, like VirtualBox (free) or VMware (paid)
You can obtain a copy of macOS by downloading it from the App Store or by borrowing it from a friend. A great approach is to search for virtual disk images that have macOS pre-installed. You can also find installers from various sources on the internet, or upgrade a pre-existing image to a newer (beta) version of macOS.
Here’s what you do next:
- Install VirtualBox or VMware
- Mount the macOS installer or disk image
- Start the VM to launch macOS
- Launch Xcode!
You can read exactly how to in this tutorial. The recommended system specs are: 4-8 GB of RAM, an Intel i5/i7 compatible CPU, and at least 10 GB of free disk space.
Note: Using macOS on non-Apple hardware is against Apple’s End User License Agreement (EULA). (Fun fact: the same EULA prohibits the use of macOS to manufacture missiles or nuclear weapons…)
Build Your Own “Hackintosh” to Run Xcode
The most obvious choice to run Xcode on a Windows PC is perhaps to literally install macOS on a Windows PC…
“One platform to rule them all” has always been Apple’s take on the world. The Mac, App Store, iOS and Apple Music are all closed systems. Apple enthusiasts have always enjoyed the integrated Apple experience.
On the other hand, the rest of the world builds computers using an “open systems architecture”, in which you can effectively mix-and-match computer components and architectures to create your preferred computing machine.
Building $10.000 gaming PCs, mid-level desktops, blazing-fast ultrabooks, and $250 laptops is only possible because of open hardware. Because of Apple’s closed systems, you’re always bound by the hardware options they give you.
But… what if you want to run macOS on your custom built PC? Apple won’t let you, and your computer manufacturer can’t install macOS for you, even if they wanted to. Because macOS shall only run on Apple hardware!
Enter the “Hackintosh”.
A Hackintosh is a PC that runs macOS. Just like you can install macOS in a virtual machine, or in the cloud, you can install macOS as the bootable operating system on your PC. Switch it on, and macOS loads.
You can also create a dual-boot, i.e. a system that both hosts Windows and macOS. When you boot your PC, you can select the operating system that starts.
Building a Hackintosh can be a tricky exercise, especially if you’re not familiar with PC hardware and creating custom installations. Not all hardware is compatible with macOS. Moreover, Apple has of course created safe-guards against booting macOS on unsupported hardware.
Nevertheless, it’s a good option for running macOS on your custom hardware, and booting macOS on your Windows PC. Check out hackintosh.com for more information, and step-by-step guides.
The name “Hackintosh” comes from the old brand-name of Apple computers: Macintosh, combined with “hack”. Again, it’s against Apple’s EULA – but you wanted to be a pirate, right?
The days of the Hackintosh are almost over, depending on who you ask. Apple’s newer hardware includes a T2 chip now. Hardware-specific chips are notoriously hard to mimic in non-Apple hardware, which essentially means that, in the future, you may not be able to install or update macOS on a computer that doesn’t have that T2 chip.
Swift for Windows & Linux
Developers who want to learn Swift have 2 alternative approaches to code Swift, next to working with Xcode on Windows. Swift is open source, which means you can essentially run it on any system.
Currently, you can use:
- Swift 5 on Ubuntu Linux 16.04 and 18.04 via the official images
- Swift 4.1 on Windows 10 via the unofficial swiftforwindows.github.io
Here’s how you can run Swift code on Linux:
- Download the latest release from swift.org/download
- Unzip the
.zip
in a convenient location - Locate the
swift
executable in theusr/bin
directory - Compile and run a Swift file with
swift [filename.swift]
You can also copy the Swift executables to your $PATH
, or add Swift’s folder to $PATH
, to use the swift
command anywhere on your system.
Here’s how you can run Swift code on Windows:
- Download the latest release of Swift for Windows from this page
- Start the program and point it to your
.swift
file - Click Run in the program
It appears the Swift for Windows project hasn’t been updated in a while. It’s latest supported version is Swift 4.1., which doesn’t differ that much from Swift 5 in terms of beginner syntax and functionality. Your mileage may vary, though!
You can even run and compile Swift on the $35 Raspberry Pi single-board computer! You can download Swift 5, which has been ported to the ARM CPU architecture, right here. Installing is as easy as pointing your RPi to the swift-arm repo, then do sudo apt-get install swift5
, and then run the Swift CLI with swift [filename.swift]
. Neat!
Develop iOS Apps on Windows With Cross-Platform Tools
Cross-platform tools are awesome: you code your app once, and export it to iOS and Android. That could potentially cut your app development time and cost in half. Several cross-platform tools allow you to develop iOS apps on a Windows PC, or allow you to compile the app if there’s a Mac in your local network.
Well, not so fast…
The cross-platform tool ecosystem is very large. On the one side you have complete Integrated Development Environments (IDEs) like Xamarin, that allow you to build cross-platform apps with C#.
The middle ground is covered by tools like PhoneGap, Cordova, Ionic and Appcelerator, that let you build native apps with HTML5 components. The far end includes smaller platforms like React Native that allow you to write native apps with a JavaScript wrapper.
The one thing that stands out for all cross-platform tools is this: they’re not beginner friendly! It’s much easier to get access to a Mac, learn Swift, and build a simple app, than it is to get started with Xamarin.
Most of the cross-platform tools require you to have a basic understanding of programming, compilation options, and the iOS and Android ecosystems. That’s something you don’t really have as a beginner developer!
Having said that, let’s look at a couple of options:
- If you’re familiar with Windows-based development tools and IDEs, and if you already know how to code, it’s worthwhile to check out Xamarin. With Xamarin you code apps in C#, for multiple platforms, using the Mono and MonoTouch frameworks.
- If you’re familiar with web-based development, check out PhoneGap or Ionic. You’ll feel right at home with HTML 5, CSS and JavaScript. Don’t forget: a native app works different than a website…
- If you’re familiar with JavaScript, or if you’d rather learn to code JavaScript than Swift, check out React Native. With React Native you can code native apps for iOS and Android using a “wrapper”.
Choose deliberately for a cross-platform tool because it fits your project, not because you think a native platform language is bad. The fact that one option isn’t right, doesn’t immediately make another option better!
If you don’t want to join the proprietary closed Apple universe, don’t forget that many cross-platform tools are operated by equally monopolistic companies like Google, Facebook, Microsoft, Adobe and Amazon.
Mac Code Developing Apps Download
An often heard argument against cross-platform tools is that they offer limited access to and support for smartphone hardware, and are less “snappy” than their native counterparts. Also, any cross-platform tool will require you to write platform-specific code at one point, especially if you want to code custom features.
Note: You’ll still need to compile your app with Xcode, even if you use cross-platform tools. Most cross-platform tools rely on the command-line tools that are shipped with Xcode, as part of macOS. You’ll also need Xcode to publish your app in the App Store.
Apps For Mac
Get a Second-Hand Mac
You gotta ask yourself: Why not get a Mac? Perhaps the simplest option to build iOS apps with Xcode, in this tutorial, is purchasing a Mac for iOS development.
If you don’t want to tinker with cross-platform tools, or rent-a-Mac in the cloud, and just want to get started with iOS development: get a Mac.
A simple search on Ebay shows you 1-3 year old second-hand Mac Mini’s for as little as $250. Any newer, decent second-hand Mac Mini will set you back around $450. Don’t forget that you can get a brand new Mac Mini for around $800.
A better question is perhaps: is a Mac Mini from 2015 fast enough to build apps with? I’ve built 50+ apps for iOS, Android and the web since 2009, and a fair share of those were built on a 1.2 Ghz 8GB MacBook Air from 2013. I started LearnAppMaking.com with that same trusty ol’ MacBook, and I’ve coded several successful production apps with it until 2018.
It’s traveled with me all over the world, from the beaches of Thailand, to airline lounges, to coffee shops, to coding apps with my knees behind my ears, cramped in economy class at 20.000 feet up in the air.
I don’t want to go all nostalgic on you, but I learned to code on a 100 Mhz i486 PC, when lines still started with a number. That’s a lot faster PC than the one that put man on the moon, at 46 Khz.
So, to say that a Mac Mini, or your new 2015 MacBook Pro, is fast enough, is an understatement…
If you buy a second hand Mac, make sure that it supports the latest version of macOS. Xcode and iOS versions are connected to macOS versions, so you want to buy a Mac that supports at least the current ones. You can find the max. latest version of Xcode that your Mac can run, by cross-referencing the min macOS to run in this wiki with Hardware compatibility in this wiki.
Code Swift with a Swift Sandbox
Do you really need Xcode to code apps? Ultimately, yes. But you can definitely learn Swift and code Swift without a Mac or Xcode!
Here, check this out:
if i <= 2 {
return 1
} else {
return fibonacci(i - 1) + fibonacci(i - 2)
}
}
let numbers = Array(1...10).map { fibonacci($0) }
print(numbers)
The above code runs in a Swift sandbox. The sandbox sends the Swift code to a webserver, which compiles it and returns the result. It’s the perfect tool to quickly play with some Swift code in your browser!
Swift is an open-source language, and that means you can effectively run it on any hardware.
Need more space for your Swift code? Check out the bigger Swift Sandbox right here!
Learn how to code iOS apps
Get started with Xcode and Swift
Ready to get started with iOS development? Learn how to code iOS apps with Xcode and Swift with our immersive iOS development course. Works both on Mac and PC!
Further Reading
You can’t build iOS apps without Xcode, and you need macOS to run Xcode, and a Mac to use macOS. There’s no getting around it, except for these alternatives to run Xcode on Windows:
- Rent a Mac in the cloud (starting at $20/mo)
- Run Xcode on Windows by installing macOS on a virtual machine
- Build your own “Hackintosh” by installing macOS on a PC
- Develop iOS apps on Windows with cross-platform tools
- Get your hands on a second-hand Mac (starting at $300)
- Learning to code with a Swift Sandbox
- Run and compile Swift directly on Windows/Linux
Mac App Development
Awesome. I want to wish you best of luck with building your iOS app on Windows! Here are a few projects and tutorials to consider: