Sobes.tech

нека родителят да бъде Task { нека детето да бъде Task { print("child started, isCancelled = ", Task.isCancelled) // НЕ false 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 секунда parent.cancel() /////// нека родителят да бъде Task { async let child: Void = { print("child started, isCancelled =", Task.isCancelled) for index in (1...[phone]) { print(index) } print("child finished, isCancelled =", Task.isCancelled) }() await child } try? await Task.sleep(nanoseconds: 1_000_000_000) // 1 секунда parent.cancel()

Senior
346

Има ли проблеми с конкуренцията (Sendable, unchecked Sendable, преход между актьорите) в модулите, с които работихте директно?

Senior
253

протокол SomeProtocol {} func test1_1(стойност: SomeProtocol) {} func test2_1(стойност: some SomeProtocol) {} func test1_2(стойност: any SomeProtocol) {}

Senior
211

Как работи системата за дизайн между UIKit и SwiftUI — има ли дублиране на компоненти или обвивки?

Senior
206

Разкажи повече за последния си проект — модула за фотогалерия в Авито, за който отговаряше (краткосрочен наем, форма за резервация и т.н.)

Senior
193

протокол SomeProtocol {} func test1_1(стойност: SomeProtocol) {} func test1_2(стойност: any SomeProtocol) {}

Senior
190

Навигацията е написана на UIKit, а известията/шитове извеждате в UIKit или използвате нативните средства на SwiftUI?

Senior
189

протокол SomeProtocol {} функция test1_1(стойност: SomeProtocol) {} функция test1_2(стойност: всякакъв SomeProtocol) {} функция test2_1(стойност: some SomeProtocol) {} функция test2_2<Стойност: SomeProtocol>(стойност: Стойност) {} клас A { функция test2_2<Стойност: SomeProtocol>(стойност: Стойност) { } } клас B: SomeProtocol { } A().test2_2(стойност: B())

Senior
189

Как беше реализирано взаимодействието с жестове и увеличение във фотогалерията — на UIKit или SwiftUI?

Senior
189

нека родителят бъде Task { let child = Task { print("дете започна, isCancelled = ", Task.isCancelled) // for index in (1...[phone]) { print(index) } print("дете приключи, isCancelled = ", Task.isCancelled) // } await child.value } try? await Task.sleep(nanoseconds: 1_000_000_000) // 1 секунда parent.cancel()

Senior
186

Разкажи за полезните Property Wrapper, които си използвал в проекта

Senior
183

Има ли още макроси в проекта освен мрежовия слой?

Senior
179

Колко ти помагат инструментите за ИИ (Cursor, Proxyman и т.н.) да бъдеш по-продуктивен на работното място?

Senior
179

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

Senior
176

struct ExampleView: View { var body: some View { VStack { FormView() Button("Reset") { // TODO: } } } } // ТЕСТИРАНЕ САМО ЗА ЧЕТЕНЕ 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) } } }

Senior
176

Array { value1 value2 if condition { value3 } }

Senior
175

Коя версия на езика Swift се използва в проекта — по-горе или по-ниско от 6?

Senior
175

Имаше ли интересни сесии/рамки на последната WWDC, които бихте искали да опитате да приложите в работата си?

Senior
173

```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)) } } ``` Výzva se zdá být o přizpůsobení stylu tlačítka SwiftUI, experimentování s různými modifikátory, jako je odsazení, barva popředí, šířka rámečku, barva pozadí a tvar oříznutí. Otázka pravděpodobně zahrnuje opravu nebo vylepšení stylu tlačítka tak, aby dosáhla požadovaného vzhledu nebo chování, například aby tlačítko vyplnilo dostupnou šířku nebo upravit jeho vizuální styl.

Senior
173

Разкажи за интересни ресурси за развитие — YouTube канали, Telegram канали, общности, инструменти

Senior
171
/2