Post

Replies

Boosts

Views

Activity

Reply to Receive error when attempting to use .listStyle() function.
Thanks for showing your code. You may need to use Answers to show additional info well formatted. I do not have enough time to watch the session video carefully, but your code seems to be taken from the session video or the sample code for the session. It is intended to be compiled with Swift 5.5/Xcode 13. Please try changing .listStyle(.carousel) to .listStyle(CarouselListStyle()). But there may be other parts you need Swift 5.5.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’21
Reply to Filter in ForEach SwiftUI
it works just with the valori property but not with the date property Seems the description is not correct enough. When I input 2021 into the textField, the list keeps showing the entries containing 2021. You are using "\($0)".contains(text) for filtering, but do you really understand what sort of Strings are generate by "\($0)"? As far as I tested with Xcode 12.5/iOS 14.5 Simulator, they were as follows: LifetimeInputsModel(id: FB973EBF-D56B-438D-BB8B-5EFDFA63983A, valori: 300.0, date: 2021-06-13 21:35:27 +0000) LifetimeInputsModel(id: 3A57A94C-79EA-4430-90B6-D415C460C243, valori: 200.0, date: 2021-06-14 21:35:27 +0000) Do you want to make the word LifetimeInputsModel hit all entries? Apps should not rely on the default String representations generated by Swift runtime. One possible way, to control the String representation of a struct would be adding CustomStringConvertible conformance. Please try adding this extension to your project and see if the filter works as expected: extension LifetimeInputsModel: CustomStringConvertible { var description: String { return "\(String(format: "%.0f", valori)) \(dateFormatter.string(from: date))" } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’21
Reply to Receive error when attempting to use .listStyle() function.
Thanks for showing your code. You may need to use Answers to show additional info well formatted. I do not have enough time to watch the session video carefully, but your code seems to be taken from the session video or the sample code for the session. It is intended to be compiled with Swift 5.5/Xcode 13. Please try changing .listStyle(.carousel) to .listStyle(CarouselListStyle()). But there may be other parts you need Swift 5.5.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Receive error when attempting to use .listStyle() function.
That error depends on other parts of your code. Can you show your code enough to reproduce the issue?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to keyboardGetUnicodeString returns carrier return
keyboardGetUnicodeString will return '\r' only...  As far as I tried, I could not find the behavior that return '\r' only. How did you checked it? Your code is not capable of showing control characters. Please try changing print to debugPrint and tell us what you see.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Filter in ForEach SwiftUI
it works just with the valori property but not with the date property Seems the description is not correct enough. When I input 2021 into the textField, the list keeps showing the entries containing 2021. You are using "\($0)".contains(text) for filtering, but do you really understand what sort of Strings are generate by "\($0)"? As far as I tested with Xcode 12.5/iOS 14.5 Simulator, they were as follows: LifetimeInputsModel(id: FB973EBF-D56B-438D-BB8B-5EFDFA63983A, valori: 300.0, date: 2021-06-13 21:35:27 +0000) LifetimeInputsModel(id: 3A57A94C-79EA-4430-90B6-D415C460C243, valori: 200.0, date: 2021-06-14 21:35:27 +0000) Do you want to make the word LifetimeInputsModel hit all entries? Apps should not rely on the default String representations generated by Swift runtime. One possible way, to control the String representation of a struct would be adding CustomStringConvertible conformance. Please try adding this extension to your project and see if the filter works as expected: extension LifetimeInputsModel: CustomStringConvertible { var description: String { return "\(String(format: "%.0f", valori)) \(dateFormatter.string(from: date))" } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Passing a variable to a function
You should better use Code Block when you show some code. If you can edit your post, please try.
Replies
Boosts
Views
Activity
Jun ’21
Reply to Passing a variable to a function
I'm not sure if I can help you or not, but showing your code would make your post more appealing and you would get more chance to get better replies sooner. Unfortunately, editing feature is strongly restricted in the dev forums and you may need to use answers to show additional info.
Replies
Boosts
Views
Activity
Jun ’21
Reply to testflight
This is not a place to apply to be a beta tester of some specific app. You should better contact to the developer of the app and ask if it is possible.
Replies
Boosts
Views
Activity
Jun ’21
Reply to After Xcode 12 update getting errors in cocoapods project.
CocoaPods is not a tool supported by Apple. You should better visit the support sites or communication sites of CocoaPods and/or each framework to get better responses sooner.
Replies
Boosts
Views
Activity
Jun ’21