MVVM vs The Composable Architecture (TCA)
Classic MVVM versus Point-Free's TCA: state management, testability, complexity tradeoffs, and which architecture fits your iOS app scale.
Apple's future: declarative, reactive, cross-platform
15 years of battle-tested, powerful, mature framework
As of 2025, new projects should default to SwiftUI — it's where all of Apple's investment is going. That said, complex custom requirements, support for iOS versions below 13, or a large legacy codebase still make UIKit a necessity. The ideal approach: try SwiftUI first, and embed a UIKit component via UIViewRepresentable when you need to.
| Category | SwiftUI | UIKit |
|---|---|---|
| Performance | 8/10 | 10/10 |
| Ease of Learning | 8/10 | 5/10 |
| Ecosystem | 8/10 | 9/10 |
| Community | 8/10 | 9/10 |
| Job Market | 8/10 | 9/10 |
| Future-Proof | 10/10 | 6/10 |
// SwiftUI - User profile card
import SwiftUI
struct ProfileCard: View {
@StateObject private var viewModel = ProfileViewModel()
@State private var isFollowing = false
var body: some View {
VStack(alignment: .leading, spacing: 16) {
HStack {
AsyncImage(url: viewModel.user.avatarURL) { image in
image.resizable().scaledToFill()
} placeholder: {
ProgressView()
}
.frame(width: 64, height: 64)
.clipShape(Circle())
VStack(alignment: .leading) {
Text(viewModel.user.name)
.font(.headline)
Text(viewModel.user.title)
.font(.subheadline)
.foregroundStyle(.secondary)
}
Spacer()
Button(isFollowing ? "Unfollow" : "Follow") {
withAnimation(.spring(response: 0.3)) {
isFollowing.toggle()
}
}
.buttonStyle(.bordered)
.tint(isFollowing ? .gray : .blue)
}
}
.padding()
.background(.regularMaterial)
.clipShape(RoundedRectangle(cornerRadius: 16))
}
}// UIKit - User profile card
import UIKit
class ProfileCardViewController: UIViewController {
private let avatarImageView: UIImageView = {
let iv = UIImageView()
iv.contentMode = .scaleAspectFill
iv.clipsToBounds = true
iv.layer.cornerRadius = 32
iv.translatesAutoresizingMaskIntoConstraints = false
return iv
}()
private let nameLabel: UILabel = {
let label = UILabel()
label.font = .preferredFont(forTextStyle: .headline)
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
private lazy var followButton: UIButton = {
var config = UIButton.Configuration.bordered()
config.title = "Follow"
let btn = UIButton(configuration: config)
btn.addTarget(self, action: #selector(followTapped), for: .touchUpInside)
btn.translatesAutoresizingMaskIntoConstraints = false
return btn
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadUserData()
}
private func setupUI() {
view.addSubview(avatarImageView)
view.addSubview(nameLabel)
view.addSubview(followButton)
NSLayoutConstraint.activate([
avatarImageView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16),
avatarImageView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
avatarImageView.widthAnchor.constraint(equalToConstant: 64),
avatarImageView.heightAnchor.constraint(equalToConstant: 64)
])
}
@objc private func followTapped() {
UIView.animate(withDuration: 0.3) {
self.followButton.alpha = 0.5
} completion: { _ in
UIView.animate(withDuration: 0.3) { self.followButton.alpha = 1 }
}
}
}As of 2025, new projects should default to SwiftUI — it's where all of Apple's investment is going. That said, complex custom requirements, support for iOS versions below 13, or a large legacy codebase still make UIKit a necessity. The ideal approach: try SwiftUI first, and embed a UIKit component via UIViewRepresentable when you need to.
Get Free ConsultationYes. You can embed a SwiftUI view inside UIKit with UIHostingController, and embed a UIKit view inside SwiftUI with UIViewRepresentable. A hybrid approach is common in large projects.