Sobes.tech

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) } } } }

Senior
176

Array { value1 value2 if condition { value3 } }

Senior
175

What is the minimum target iOS version currently in the project?

Senior
174

When you joined the project, was Swift 6 already available, or did the transition happen during your time?

Senior
174

Tell about interesting resources for development — YouTube channels, Telegram channels, communities, tools.

Senior
173

Do you use Viper architecture for UIKit? Does this apply to all applications?

Senior
172

@MainActor final class ViewModel: ObservableObject { @Published var image: UIImage? func onDownloadPhoto(url: URL) { do { let data = try Data(contentsOf: url) image = UIImage.init(data: data) } catch { log.error("Failed to download image: \(error)") } } } Button("Download") { onDownloadPhoto(url) }

Senior
170

Are there issues, hacks, or limitations related to SwiftUI with iOS 16 target compared to iOS 15?

Senior
169

```swift struct ContentView: View { var body: some View { ScrollView { content .padding(20) } .background(Color(.systemGroupedBackground)) .overlay(alignment: .bottom) { continueButton } } } ``` ```swift struct ContentView: View { var body: some View { ScrollView { content .padding(20) } .background(Color(.systemGroupedBackground)) .safeAreaInset(edge: .bottom) { continueButton } } } ```

Senior
167

Tell us about using SwiftUI in a project — what is the policy, how many screens are written in SwiftUI?

Senior
167

When implementing a new screen or feature, do you immediately write in SwiftUI, or are there discussions about choosing between UIKit and SwiftUI?

Senior
166

Self -> Task -> (strong) Self .... Back -> View desinit -> View model deinit?

Senior
166

If you were designing a reusable button component for a design system in SwiftUI with different styles (primary/secondary), how would you implement it?

Senior
165

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())

Senior
160

What is used for presentation modules in UIKit and SwiftUI — what architecture?

Senior
160

Are you currently using GCD or Modern Concurrency (async/await) for new thread-related tasks?

Senior
160

How do you understand the term 'structured concurrency' in Swift? Does Task.detached fit this concept?

Senior
155

If you use DispatchQueue with WorkItem and call cancel() — when and how does the cancellation occur?

Senior
151
/2