Are there any macros in the project besides the network layer?
iOS
What are the consequences of using the Singleton pattern inside a class implementing the observable object protocol?
What are the types of memory leaks and how to detect them?
What is the role and main responsibilities of the UIResponder class in the event handling system?
When you joined the project, was Swift 6 already available, or did the transition happen during your time?
Why does adding a mutex only for writing not solve the data race problem? How to correctly use a mutex to protect a shared variable?
Self -> Task -> (strong) Self .... Back -> View desinit -> View model deinit?
protocol SomeProtocol { func test() } func test1_1(value: SomeProtocol) {} func test1_2(value: any SomeProtocol) {} func test2_1(value: some SomeProtocol) {} func test2_2<Value: SomeProtocol>(value: Value) {} class A { func test2_2<Value: SomeProtocol>(value: Value) { } } class B: SomeProtocol { func test() {} } class C: B {} A().test2_2(value: B())
final class ProfileViewModel1 { enum State { ... } var state: State = .idle let service: UserService init(service: UserService) { ... } func onBackPress() { // view deinit } func loadUser() { state = .loading Task { [weak self] guard let self else { return } do { let user = try await self.service.fetchUser() self.state = .loaded(user) } catch { self.state = .failed(error.localizedDescription) } } } }
Why do some requests return a price that was never there (for example, an intermediate value between the old and new price)?
What is the process of combining multiple operations into one sequence for execution called?
Tell about useful Property Wrappers you've used in a project.
At what stage of code execution do you define and apply constraints?
let parent = Task { let child = Task { print("child started, isCancelled = ", Task.isCancelled) // for index in (1...[phone]) { print(index) } print("child finished, isCancelled = ", Task.isCancelled) // } await child.value } try? await Task.sleep(nanoseconds: 1_000_000_000) // 1 second parent.cancel()
What is the complexity indicator for adding an element to the beginning of a doubly linked list?
struct ExampleView: View { var body: some View { VStack { FormView() Button("Reset") { // TODO: } } } } // READ ONLY struct FormView: View { @State private var firstname = "" @State private var lastname = "" @State private var email = "" @State private var website = "" var body: some View { Form { TextField("Enter firstname", text: self.$firstname) TextField("Enter lastname", text: self.$lastname) TextField("Enter email address", text: self.$email) TextField("Enter website address", text: self.$website) } } }
When implementing a new screen or feature, do you immediately write in SwiftUI, or are there discussions about choosing between UIKit and SwiftUI?
When is it permissible to perform user interface updates outside the main thread?
Can you give an example of implementing the dependency inversion principle in a project?
protocol SomeProtocol {} func test1_1(value: SomeProtocol) {} func test1_2(value: any SomeProtocol) {} func test2_1(value: some SomeProtocol) {} func test2_2<Value: SomeProtocol>(value: Value) {} class A { func test2_2<Value: SomeProtocol>(value: Value) { } } class B: SomeProtocol { } A().test2_2(value: B())