Post

Replies

Boosts

Views

Activity

Can NSInputStream.read(_:maxLength:) read less than maxLength even if more is available?
Can NSInputStream.read(_:maxLength:) return less bytes read even when more data available? I haven't found it in the docs Use-case: we pass maxLength = 512, but actual reading of 512 bytes will do in 2 rounds: 256 in first round + 256 in second. It's important for my use-case (encryption/decryption) not to have intermediate partial readings unless it's last "tail" part. Otherwise I might end-up encrypting different-length blocks & decryption will fail assuming different buffer length.
2
0
678
Jan ’22
SwiftUI rendering path optimisation for `let` values
Hello colleagues, I have question regarding passing data that doesn't need to change. In video suggested to use let, and it totally make sense! But I also found following issue: https://forums.raywenderlich.com/t/question-regarding-chapter-8-4/136398/2 I am wondering how to avoid rendering path optimisation to make sure it's not cached somewhere in between? Or was this something already fixed in prior SwiftUI versions? My example: struct ModelDetailsView { @ObservedObject var viewModel: ViewModel     @ViewBuilder     var body: some View {         ModelItemsSection(viewModel.$model.subitems) .onAppear(perform: {             self.viewModel.load()         })     } } struct ModelItemsSection: View {     let items: [ModelSubitem] // simple struct     var body: some View {                 PreviewItemsView(items: items, allItemsTitle: "All Items") { item in Text(item.titleDetail + item.subtitle)                 } allItemsView: { items in //3rd level screen where `let` data is passed that's destination to NavigationLink                     AllModelItemsView(items: items)                 }     } } Thanks, Dzmitry.
0
0
428
Sep ’21
Can report UI status of interactive widget triggered action (pending, loading, completed)?
Report status of interactive widget triggered action (pending, loading, failed, completed)? I can think of continuously calling WidgetCenter.shared.reloadTimelines(ofKind:) but afraid to exceed reload budget.
Replies
0
Boosts
0
Views
817
Activity
Jun ’23
Cannot disable share menu for QuickLook controller iOS16
Starting iOS16 navigation title has default share menu. Is there any APIs to disable it? I tried following but it didn't help: navigationItem.documentProperties = .init(metadata: LPLinkMetadata.init()) navigationItem.titleMenuProvider = { _ in UIMenu.init() }
Replies
0
Boosts
0
Views
883
Activity
Sep ’22
Can NSInputStream.read(_:maxLength:) read less than maxLength even if more is available?
Can NSInputStream.read(_:maxLength:) return less bytes read even when more data available? I haven't found it in the docs Use-case: we pass maxLength = 512, but actual reading of 512 bytes will do in 2 rounds: 256 in first round + 256 in second. It's important for my use-case (encryption/decryption) not to have intermediate partial readings unless it's last "tail" part. Otherwise I might end-up encrypting different-length blocks & decryption will fail assuming different buffer length.
Replies
2
Boosts
0
Views
678
Activity
Jan ’22
SwiftUI rendering path optimisation for `let` values
Hello colleagues, I have question regarding passing data that doesn't need to change. In video suggested to use let, and it totally make sense! But I also found following issue: https://forums.raywenderlich.com/t/question-regarding-chapter-8-4/136398/2 I am wondering how to avoid rendering path optimisation to make sure it's not cached somewhere in between? Or was this something already fixed in prior SwiftUI versions? My example: struct ModelDetailsView { @ObservedObject var viewModel: ViewModel     @ViewBuilder     var body: some View {         ModelItemsSection(viewModel.$model.subitems) .onAppear(perform: {             self.viewModel.load()         })     } } struct ModelItemsSection: View {     let items: [ModelSubitem] // simple struct     var body: some View {                 PreviewItemsView(items: items, allItemsTitle: "All Items") { item in Text(item.titleDetail + item.subtitle)                 } allItemsView: { items in //3rd level screen where `let` data is passed that's destination to NavigationLink                     AllModelItemsView(items: items)                 }     } } Thanks, Dzmitry.
Replies
0
Boosts
0
Views
428
Activity
Sep ’21
Are SwiftUI Previews source code included in release build?
Hello colleagues. My question is whether or not Xcode Previews source code included (or removed) starting Xcode 12.5 in: final binary of the application? SwiftPM package library artifact? I know there's "Development Assets" folder that's included for previews only. But I didn't really find information about preview source code. Thanks, Dzmitry.
Replies
0
Boosts
0
Views
618
Activity
Aug ’21