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
348

Կա՞ն խնդիրներ մրցակցայինության հետ (Sendable, unchecked Sendable, անցումներ դերակատարների միջև) այն մոդուլներում, որոնց հետ դուք ուղղակի աշխատել եք։

Senior
253

SomeProtocol պրոտոկոլ {} ֆունկցիա test1_1 արժեքը: SomeProtocol {} ֆունկցիա test2_1 արժեքը: some SomeProtocol {} ֆունկցիա test1_2 արժեքը: any SomeProtocol {}

Senior
213

Ինչպես է աշխատում դիզայնի համակարգը UIKit և SwiftUI միջև՝ կա՞ կրկնօրինակում կոմպոնենտների կամ պատյանների։

Senior
206

Ավելացրեք ավելի մանրամասն ձեր վերջին նախագծի մասին — լուսանկարների գալերեայի մոդուլը Ավիտոյում, որի պատասխանատուն եք (կարճաժամկետ վարձակալություն, ամրագրման ձևանմուշ և այլն)

Senior
194

Ինչպես իրականացվեց շոշափումների և զույգի փոխազդեցությունը լուսանկարների գալերեայում — UIKit կամ SwiftUI?

Senior
191

պրոտոկոլ SomeProtocol {} func test1_1արժեքը: SomeProtocol) {} func test1_2(արժեքը: any SomeProtocol) {}

Senior
190

պրոտոկոլ 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-ով, և ահազանգերը/շիտերը դուրս եք բերում 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

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
180

Կա՞ն այլ մակրոներ նախագծում բացի ցանցային շերտից։

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

Ի՞նչ տարբերակ է օգտագործվում Swift լեզվում՝ ավելի բարձր 6-ից կամ ցածր?

Senior
175

Array { value1 value2 if condition { value3 } }

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

Ի՞նչ է ներկայումս նվազագույն iOS նպատակն նախագծում։

Senior
171
/2