Sobes.tech

```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
Salmon
55

Houve problemas com concorrência (Sendable, Sendable não verificado, transição entre atores) nos módulos com os quais trabalhou diretamente?

Senior
Salmon
55

Como foi implementada a interação com gestos e zoom na galeria de fotos — no UIKit ou SwiftUI?

Senior
Salmon
54

Existem problemas, soluções temporárias ou limitações relacionadas ao SwiftUI com o objetivo iOS 16 em comparação com o iOS 15?

Senior
Salmon
54

O que acontece quando nil é passado para set?

Middle+
RevolutRevolut
53

Existem mais macros no projeto além da camada de rede?

Senior
Salmon
51

struct ExampleView: View { @State var isVariant1 = true var body: some View { VStack { Toggle("Usar Variante 1", isOn: $isVariant1.animation(.linear)) Text(isVariant1 ? "Variante 1" : "Variante 2") } .padding() } } Variante1 -> escala -> 1 -> 0 Variante2 -> escala -> 0

Senior
Salmon
49

Por que o código atual com um ciclo infinito for no main não funciona? Como corrigir?

Principal
Позитив Технолоджис
49

Qual é o alvo mínimo de iOS no projeto atualmente?

Senior
Salmon
48

classe final NetworkService { func request<Response: Decodable, Body: Encodable>(urlString: String, method: HTTPMethod, body: Body? = nil, headers: [String: String] = [:], query: [String: String] = [:]) async throws -> Response { guard var components = URLComponents(string: urlString) else { throw Errors.invalidUrl } if !query.isEmpty { components.queryItems = query.map { URLQueryItem(name: $0.key, value: $0.value) } } guard let url = components.url else { throw Errors.invalidQuery } var request = URLRequest(url: url) request.httpMethod = method.rawValue headers.forEach { request.setValue($0.value, forHTTPHeaderField: $0.key) } if let body, method == .post { request.httpBody = try encoder.encode(body) // ? } let (data, response) = try await session.data(for: request) guard let httpResponse = response as? HTTPURLResponse else { throw Errors.invalidResponse } guard (200...299).contains(httpResponse.statusCode) else { throw Errors.httpStatus(httpResponse.statusCode) } return try decoder.decode(Response.self, from: data) } }

Middle+
СБЕРСБЕР
46

Por que escolheu um dicionário como armazenamento de cache?

Middle+
RevolutRevolut
46

Que utilidade têm as ferramentas de IA (Cursor, Proxyman, etc.) para te ajudar a ser mais produtivo no trabalho?

Senior
Salmon
44

Utiliza a arquitetura Viper para UIKit? Aplica-se a todas as aplicações?

Senior
Salmon
44

Auto -> Tarefa -> (forte) Auto .... Voltar -> Ver desinit -> Ver modelo deinit?

Senior
Salmon
43

protocolo SomeProtocol { func test() } func test1_1(valor: SomeProtocol) {} func test1_2(valor: any SomeProtocol) {} func test2_1(valor: some SomeProtocol) {} func test2_2<Valor: SomeProtocol>(valor: Valor) {} class A { func test2_2<Valor: SomeProtocol>(valor: Valor) { } } class B: SomeProtocol { func test() {} } class C: B {} A().test2_2(valor: B())

Senior
Salmon
42

Está atualmente a usar GCD ou Concorrência Moderna (async/await) para novas tarefas relacionadas com threads?

Senior
Salmon
40

Fala-me mais sobre o teu último projeto — o módulo de galeria de fotos no Avito, pelo qual eras responsável (arrendamento de curto prazo, formulário de reserva, etc.)

Senior
Salmon
40

Houve sessões ou frameworks interessantes na última WWDC que gostaria de experimentar aplicar no seu trabalho?

Senior
Salmon
40

```swift struct CustomButtonStyleView: View { var body: some View { VStack { Button("Button") { print("Tapped") } .buttonStyle(CustomButtonStyle()) } } } private struct CustomButtonStyle: ButtonStyle { func makeBody(configuration: Configuration) -> some View { configuration.label .padding() .foregroundColor(.white) .background(Color.red) .clipShape(RoundedRectangle(cornerRadius: 8)) } } ``` ```swift struct CustomButtonStyleView: View { var body: some View { VStack { Button("Button") { print("Tapped") } .buttonStyle(CustomButtonStyle()) } } } private struct CustomButtonStyle: ButtonStyle { func makeBody(configuration: Configuration) -> some View { configuration.label .padding() .foregroundColor(.white) .frame(maxWidth?) .background(Color.red) .clipShape(RoundedRectangle(cornerRadius: 8)) } } ``` ```swift struct CustomButtonStyleView: View { var body: some View { VStack { Button("Button") { print("Tapped") } .buttonStyle(CustomButtonStyle()) } } } private struct CustomButtonStyle: ButtonStyle { func makeBody(configuration: Configuration) -> some View { configuration.label //.padding() //.foregroundColor(.white) .frame(maxWidth: .infinity) .background(Color.red) //.clipShape(RoundedRectangle(cornerRadius: 8)) } } ``` ```swift struct CustomButtonStyleView: View { var body: some View { VStack { Button("Button") { print("Tapped") } .buttonStyle(CustomButtonStyle()) .frame(width: 200) } } } private struct CustomButtonStyle: ButtonStyle { func makeBody(configuration: Configuration) -> some View { configuration.label //.padding() //.foregroundColor(.white) .frame(maxWidth: .infinity) .background(Color.red) //.clipShape(RoundedRectangle(cornerRadius: 8)) } } ``` O objetivo parece ser personalizar um estilo de botão em SwiftUI, experimentando com diferentes modificadores como padding, cor de primeiro plano, largura do quadro, cor de fundo e forma de recorte. A questão provavelmente envolve corrigir ou melhorar o estilo do botão para alcançar uma aparência ou comportamento desejado, como fazer o botão preencher toda a largura disponível ou ajustar seu estilo visual.

Senior
Salmon
40

Se implementar uma nova tela ou uma nova funcionalidade, escreve imediatamente em SwiftUI, ou há discussões sobre a escolha entre UIKit e SwiftUI?

Senior
Salmon
39
/206