← Back to notebook index

Notebook Topic

Architecture & Design Patterns

English topic guide inspired by the original iOS Developer Notebook, expanded for both iOS and Android teams.

What this topic covers

Execution checklist

iOS implementation notes

Android implementation notes

Code examples

Swift

protocol GetProfileUseCase { func execute() async throws -> User }
final class GetProfile: GetProfileUseCase {
  private let repo: ProfileRepository
  init(repo: ProfileRepository) { self.repo = repo }
  func execute() async throws -> User { try await repo.profile() }
}

Kotlin

class GetProfileUseCase(private val repo: ProfileRepository) {
  suspend operator fun invoke(): User = repo.profile()
}
class ProfileVm(private val getProfile: GetProfileUseCase): ViewModel()

Reference links

Related topics