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
344

Түздөн-түз иштеген модулдарда атаандаштык маселелери (Sendable, unchecked Sendable, актёрлор арасындагы өтүүлөр) болду беле?

Senior
253

SomeProtocol протоколу {} функция test1_1 мааниси: SomeProtocol {} функция test2_1 мааниси: some SomeProtocol {} функция test1_2 мааниси: any SomeProtocol {}

Senior
209

UIKit жана SwiftUI ортосунда дизайн системасы кандай иштейт — компоненттердин же каптоолордун көчүрмөлөрү барбы?

Senior
203

протокол 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

Өз акыркы долбооруңуз тууралуу көбүрөөк айтып бериңиз — Авито'догу фотогалерея модулу, жооптуу болгон (кыска мөөнөттүү ижара, брондоо формасы жана башка)

Senior
188

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

Senior
187

Фотогалереяда кыймылдар жана зум менен өз ара аракеттенүү кандай ишке ашырылды — UIKit же SwiftUI?

Senior
186

ата-эне 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
177

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

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
174

Жобада колдонулган Swift тилинин версиясы — 6дан жогору же төмөнбү?

Senior
173

Жобада азыркы минималдуу iOS максаты кандай?

Senior
171

Array { value1 value2 if condition { value3 } }

Senior
171

Жобага келгенде, Swift 6 эле бар болчу, же өтүү сенин катышууңда болду беле?

Senior
170

```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()) } } } 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)) } } ``` Вызывается задача о настройке стиля кнопки SwiftUI, экспериментировании с различными модификаторами, такими как отступы, цвет переднего плана, ширина рамки, цвет фона и форма обрезки. Вероятно, вопрос включает исправление или улучшение стиля кнопки для достижения желаемого внешнего вида или поведения, например, чтобы кнопка заполняла доступную ширину или настраивала ее визуальный стиль.

Senior
169
/2