Will live preview in SwiftUI and the Xcode 11 works on MacBook Pro Retina 2012 perfectly well? The MacBook Pro 2012 still great in 2019? I'm thinking about buying me one. I have a low budget and I need a MacBook Pro that will work for 3-5 years from now, being me a ”Pro” user.
I am typing this from a mid-2012 retina MBP which is running Catalina and Xcode 11 just fine. SwiftUI previews take a few seconds to come up, but work great.
My one concern is that you mention wanting it to work 3–5 years from now. While it might still be suitable for general use then (my mom, for example, gets by running the latest version of MS Office on High Sierra on a mid-2010 MBP), it may not support the latest versions of the operating system or Xcode at that time. As you may be aware, mid-2012 is the oldest MacBook Pro that can officially run macOS Catalina, so I would expect support to be dropped in some subsequent release.
But do you think that in the future it will run macOS 10.16 or .17? The Mac I had before was gone, and I really need a Mac now, but I'm on a low budget, I had made a good investment in it. Luckily, a few days later, my iPhone is gone too, life difficult. Now my studies "spend" a a lot of money.
Here's the entire compatability list:
2015 and later MacBook
2013 and later MacBook Air
2013 and later MacBook Pro
2014 and later Mac mini
2014 and later iMac
2017 and later iMac Pro
2013 and later Mac Pro
Big Sur jumps a year to two years ahead for hardware compatibility (depending on the Mac) compared to macOS Catalina.
The mid-2012 is an early third-generation MacBook Pro with Ivy Bridge & Intel HD 4000. As Rac Shade pointed out, it is good for Catalina. The next time Apple drops models from macOS compatibility, it will likely affect that entire generation. When you go to replace your current Mac, I would suggest getting into the middle of the fourth generation with Kaby Lake & Intel Iris Plus Graphics 650 to assure longevity. With the advent of new 2019 MBP models, something like this from two releases ago should be coming down in price, say, under $1,500. If you cannot afford that, the MacBook Air mid-2013 is still dramatically good (if maxed out with 1.7 GHz Core i7 & 8GB, like mine) and might survive another 1-2 macOS versions with its Haswell & Intel HD Graphics 5000. These are available in the $400-700 range at used Mac retailers.
I did recently upgrade my iMac to 27" with Quad Core i7 and 32GB of memory. That was mainly for additional screen space.