For beginners learning Swift, it can be a challenge to find the right Mac for developers. As with many things, I strongly believe you shouldn't spend too much money until you know you will be making a real commitment to a project. Rightfully, this includes Swift and iOS development.
Therefore, depending on your experience and your budget, here are some guidelines:
Just starting off - under $600 - iPad
You can accomplish a lot with Swift Playground. Rightfully, it’s a great way to start learning Swift specifically. You want be able to deploy onto an iPhone or post to the App Store but it's great way to lightly dabble without commiting.
Under $1300 - MacBook Air, MacBook, Mac Mini
If you want to deploy and test on an actual device or you wish to post to the App Store, you need macOS and Xcode. If you don’t mind losing portability a Mac mini is worth it. Otherwise, what you sacrifice in portability you loose in speed that is building in Xcode will take longer. However now you can actually build, deploy, post an actual app to the App Store.
Under $2200 - MacBook Pro… However
With the recent spate of keyboard issues as well as the rumored transition to ARM, I’d highly recommend waiting on purchasing a brand new MacBook Pro.
Above $2200
Surprisingly, you can upgrade your MacBook Pro all the way to $6600 if you really want to but I wouldn’t recommend it. However, I've purchased an iMac which is what I use and love. Consequently, I would never recommend a developer get a iMac Pro (unless you plan to do game development or multimedia productions) and certainly not a Mac Pro.
Mac for Developers - Other Things to Note
Additionally, buying used is certainly worthwhile. However, make sure that it is recent enough to support the latest as well as upcoming version of macOS.
Finding the right Mac for developers is important, so hopefully you find this helpful in your journey towards becoming an accomplished Swift and iOS developer.