Post

Replies

Boosts

Views

Activity

Reply to State change doesn't affect TextField lineLimit UI in Xcode 14 Beta
I have not tested this but give it a try SB import SwiftUI struct TextFieldDynamicHeight: ViewModifier {     var fullSize: Binding<Bool> = .constant(false)     var upperRange: ClosedRange<Int>     var lowerRange: ClosedRange<Int>     var upperBound: Int     var lowerBound: Int     func body(content: Content) -> some View {         if #available(iOS 16.0, *) {             content                 .lineLimit(fullSize.wrappedValue ? upperRange : lowerRange)         } else {             content                 .lineLimit(fullSize.wrappedValue ? upperBound : lowerBound)         }     } } extension View {     @available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *)     func lineLimit(_ fullSize: Binding<Bool>, upperRange: ClosedRange<Int>, lowerRange: ClosedRange<Int>) -> some View {         modifier(TextFieldDynamicHeight(fullSize: fullSize, upperRange: upperRange, lowerRange: lowerRange,                                         upperBound: 0, lowerBound: 0))     }     @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)     func lineLimit(_ fullSize: Binding<Bool>, upperBound: Int, lowerBound: Int) -> some View {         modifier(TextFieldDynamicHeight(fullSize: fullSize, upperRange: 0...0, lowerRange: 0...0,                                         upperBound: upperBound, lowerBound: lowerBound))     } } struct ContentView: View {     @State private var description: String = ""     @State private var fullSize: Bool = false     @State private var fullHeight: Bool = false     var body: some View {         VStack {             VStack {                 Image(systemName: "globe")                     .imageScale(.large)                     .foregroundColor(.accentColor)                 Text("Hello world!")             }             if #available(iOS 16.0, *) {                 TextField("Type a textmail", text: $description, axis: .vertical)                     .lineLimit($fullSize, upperRange: 2...6, lowerRange: 2...3)                     .foregroundColor(.white)                     .background(Color.blue)                     .frame(height: fullHeight ? 300 : 100)                     .padding(0)             } else {                 TextField("Type a textmail", text: $description)                     .lineLimit($fullSize, upperBound:6, lowerBound: 3)                     .foregroundColor(.white)                     .background(Color.blue)                     .frame(height: fullHeight ? 300 : 100)                     .padding(0)             }             Button("Full size") {                 fullSize.toggle()                 print("fullSize: \(fullSize)")             }             .padding(5)             Button("Full height") {                 fullHeight.toggle()                 print("fullHeight: \(fullHeight)")             }             .padding(5)         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to Dynamic list sections with observed data with SwiftUI
I ran your code with Xcode 13.4.1 & iOS 15.5 and it works as expected and not as described: one thing I will do is sort the data at source         self.objectList = [             Testclass(name: "A1"),             Testclass(name: "B1"),             Testclass(name: "Z2"),             Testclass(name: "C1"),             Testclass(name: "D1"),             Testclass(name: "D2"),             Testclass(name: "A2"),             Testclass(name: "Z1")         ].sorted(by: {$0.name < $1.name})
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to How to do async IO using IOUSBHostPipe?
I think it is more or less your implementation of the ioCompleteCallback function that is missing. Any async callback data is passed to this function.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Apple Mail : How to remove emails in follow up tab
You will have ask this question in the non-developer community here: https://discussions.apple.com/welcome
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Parallel Protocol Hierarchies
Programming is a science and not an art. Please read the swift documentation.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to GPU much slower than CPU for LSTMs and bidirectional in TensorFlow 2.8
Post a bug report on the tensorflow github project
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to How to get focused element's cursor position using accessibility API?
You should this question to the Electron JS github project as electron is not an Apple native solution.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Xcode Cloud - machines
Treat it as a black box - you don't need to know.
Replies
Boosts
Views
Activity
Jun ’22
Reply to State change doesn't affect TextField lineLimit UI in Xcode 14 Beta
I have not tested this but give it a try SB import SwiftUI struct TextFieldDynamicHeight: ViewModifier {     var fullSize: Binding<Bool> = .constant(false)     var upperRange: ClosedRange<Int>     var lowerRange: ClosedRange<Int>     var upperBound: Int     var lowerBound: Int     func body(content: Content) -> some View {         if #available(iOS 16.0, *) {             content                 .lineLimit(fullSize.wrappedValue ? upperRange : lowerRange)         } else {             content                 .lineLimit(fullSize.wrappedValue ? upperBound : lowerBound)         }     } } extension View {     @available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *)     func lineLimit(_ fullSize: Binding<Bool>, upperRange: ClosedRange<Int>, lowerRange: ClosedRange<Int>) -> some View {         modifier(TextFieldDynamicHeight(fullSize: fullSize, upperRange: upperRange, lowerRange: lowerRange,                                         upperBound: 0, lowerBound: 0))     }     @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)     func lineLimit(_ fullSize: Binding<Bool>, upperBound: Int, lowerBound: Int) -> some View {         modifier(TextFieldDynamicHeight(fullSize: fullSize, upperRange: 0...0, lowerRange: 0...0,                                         upperBound: upperBound, lowerBound: lowerBound))     } } struct ContentView: View {     @State private var description: String = ""     @State private var fullSize: Bool = false     @State private var fullHeight: Bool = false     var body: some View {         VStack {             VStack {                 Image(systemName: "globe")                     .imageScale(.large)                     .foregroundColor(.accentColor)                 Text("Hello world!")             }             if #available(iOS 16.0, *) {                 TextField("Type a textmail", text: $description, axis: .vertical)                     .lineLimit($fullSize, upperRange: 2...6, lowerRange: 2...3)                     .foregroundColor(.white)                     .background(Color.blue)                     .frame(height: fullHeight ? 300 : 100)                     .padding(0)             } else {                 TextField("Type a textmail", text: $description)                     .lineLimit($fullSize, upperBound:6, lowerBound: 3)                     .foregroundColor(.white)                     .background(Color.blue)                     .frame(height: fullHeight ? 300 : 100)                     .padding(0)             }             Button("Full size") {                 fullSize.toggle()                 print("fullSize: \(fullSize)")             }             .padding(5)             Button("Full height") {                 fullHeight.toggle()                 print("fullHeight: \(fullHeight)")             }             .padding(5)         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to I would avoid Xcode 14 (seems to have corrupted my system)
Git SCM is usually the way to go by branching your code into maybe an Xcode 14 branch where all work related to Xcode 14 takes place in there and some other branch from develop is where normal Xcode 13 or feature development continues to take place.
Replies
Boosts
Views
Activity
Jun ’22
Reply to IOS-Stocks application similar UI gesture
Adding Gestures to a 3rd party library can cause unexpected side effects if not supported by the very same 3rd party library. Consult the 3rd party site/Github project or documentation on what is and is not supported by their framework.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Poor Performance of Sample code from "Counting human body action repetitions in a live video feed"
This is Beta software so anything is expected at this point of time if running any of the Beta tools or OSes.
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to There is a problem with Swift Error type check on iOS16 beta.
I've tested your findings above and this does look like an issue of a potential String: Error {} extension conformance. The most we can do is wait and see where the Beta revisions take us with the implementation SFError.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Creating custom synchronization primitives with priority inheritance
File a bug report
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Sidebar inset spacing changes on rotation and reload - SwiftUI
Maybe give the ContentView your root view, some padding.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Dynamic list sections with observed data with SwiftUI
I ran your code with Xcode 13.4.1 & iOS 15.5 and it works as expected and not as described: one thing I will do is sort the data at source         self.objectList = [             Testclass(name: "A1"),             Testclass(name: "B1"),             Testclass(name: "Z2"),             Testclass(name: "C1"),             Testclass(name: "D1"),             Testclass(name: "D2"),             Testclass(name: "A2"),             Testclass(name: "Z1")         ].sorted(by: {$0.name < $1.name})
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to No such module 'Amplify' & Could not read serialized diagnostics file: error("Invalid diagnostics signature")
The error message is pointing you to the solution. Open ApiService.swift and look for the import statement import Amplify remove it or make sure the module, framework or library is added to the project correctly.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22