Sobes.tech

lai vecāks būtu uzdevums { ļauj, lai bērns būtu uzdevums { print("child started, isCancelled = ", Task.isCancelled) // NĒ 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 sekunde parent.cancel() /////// lai vecāks būtu uzdevums { 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 sekunde parent.cancel()

Senior
348

Vai bija problēmas ar konkurētspēju (Sendable, unchecked Sendable, pārejas starp aktieriem) moduļos, ar kuriem tieši strādājāt?

Senior
253

protokols SomeProtocol {} funkcija test1_1 vērtība: SomeProtocol {} funkcija test2_1 vērtība: some SomeProtocol {} funkcija test1_2 vērtība: any SomeProtocol {}

Senior
213

Kā darbojas dizaina sistēma starp UIKit un SwiftUI — vai ir komponentu vai ietvaru dublēšanās?

Senior
206

Pastāsti vairāk par savu pēdējo projektu — foto galerijas moduli Avito, par kuru tu atbildēji (īslaicīga īre, rezervācijas veidlapa utt.)

Senior
194

Kā tika īstenota žestu un tālummaiņas mijiedarbība foto galerijā — UIKit vai SwiftUI?

Senior
191

protokols SomeProtocol {} func test1_1(vērtība: SomeProtocol) {} func test1_2(vērtība: any SomeProtocol) {}

Senior
190

protokols SomeProtocol {} func test1_1(atskaits: SomeProtocol) {} func test1_2( jebkā: SomeProtocol) {} func test2_1(atskaits: some SomeProtocol) {} func test2_2<Atskaits: SomeProtocol>(atskaits: Atskaits) {} klase A { func test2_2<Atskaits: SomeProtocol>(atskaits: Atskaits) { } } klase B: SomeProtocol { } A().test2_2(atskaits: B())

Senior
189

Navigācija ir uzrakstīta UIKit, un brīdinājumi/lapas tiek izvilktas uz UIKit vai izmantojat SwiftUI dabiskos līdzekļus?

Senior
189

atļaujiet vecākam būt Task { let child = Task { print("bērns sāka, isCancelled = ", Task.isCancelled) // for index in (1...[phone]) { print(index) } print("bērns beidzās, isCancelled = ", Task.isCancelled) // } await child.value } try? await Task.sleep(nanoseconds: 1_000_000_000) // 1 sekunde parent.cancel()

Senior
186

Pastāsti par noderīgiem Property Wrapper'iem, kurus izmantoji projektā

Senior
183

struct ExampleView: View { var body: some View { VStack { FormView() Button("Reset") { // TODO: } } } } // TIKAI LASIŲ 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

Vai projektā ir vēl makrokomandas, izņemot tīkla slāni?

Senior
179

Cik noderīgi ir mākslīgā intelekta rīki (Cursor, Proxyman utt.), lai palīdzētu tev būt produktīvākam darbā?

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

Kura Swift valodas versija tiek projektā — virs 6 vai zemāka?

Senior
175

Array { value1 value2 if condition { value3 } }

Senior
175

Vai pēdējā WWDC bija interesantas sesijas/rāmji, kuras vēlētos izmēģināt savā darbā?

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?) .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)) } } ```

Senior
173

Kāds ir pašreizējais minimālais iOS mērķis projektā?

Senior
171
/2