Sobes.tech

бигзор, ки падар вазифа бошад { бигзор, ки кӯдак вазифа бошад { 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() /////// бигзор, ки падар вазифа бошад { 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 {} функсия test1_1 арзиши: SomeProtocol {} функсия test2_1 арзиши: some SomeProtocol {} функсия 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