Post

Replies

Boosts

Views

Activity

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:
Jun ’21
Reply to Form vs Vstack for SwiftUI for iOS
So my question is, is there any reason I should put up with the trouble and use Form? In my opinion, Form is a collection of bunch of styles or behaviors which Apple's designer thinks is appropriate for input forms. So, many of the modifiers do not work as expected for Form or components inside Form. If you want to make many components customized, not using Form seems to be a practical way than hacking the implementation details. From what I can tell, there don't seem to be any real benefits, right? Form is a good container if you want to implement the default styles or behaviors. Seems you do not think it a real benefit, but not all developer would think as you do. One clear thing is, you can have your own opinion.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
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
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 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 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 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 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 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 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 What is a scope declaration in swift programming language ?
You are leaving many of the threads untouched even if you get replies. You should respond to the comments or answers before starting a new question.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Form vs Vstack for SwiftUI for iOS
So my question is, is there any reason I should put up with the trouble and use Form? In my opinion, Form is a collection of bunch of styles or behaviors which Apple's designer thinks is appropriate for input forms. So, many of the modifiers do not work as expected for Form or components inside Form. If you want to make many components customized, not using Form seems to be a practical way than hacking the implementation details. From what I can tell, there don't seem to be any real benefits, right? Form is a good container if you want to implement the default styles or behaviors. Seems you do not think it a real benefit, but not all developer would think as you do. One clear thing is, you can have your own opinion.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Value of type 'UISearchBar' has no member 'showLoading'
As the error message is clearly stating, UISearchBar does not have a method named showLoading. Did you define it by yourself? Where? How? And what is search (or self.search) in your code?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to getting Error While using Date picker class ActionSheetDatePicker.init
As far as I know there are no class named ActionSheetDatePicker in Apple's framework. Can you tell me how it is defined? And showing teared fragments of code would not be helpful to find what's going on. Can you show whole class(es) or method(s) in one piece?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Cannot convert value of type 'EventsTrigger' to expected argument type 'String?
Depends on how NewService and its initializer is defined. Can you show the definition of it?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to React native build failure
React Native is not a framework of Apple's. You should better contact to the author of it or find a supporting site or a community site of it, to get better responses sooner.
Replies
Boosts
Views
Activity
Jun ’21
Reply to Cannot convert value of type 'EventsTrigger' to expected argument type 'String?
It has 4 parameters and the second parameter would be imported into Swift as String?. What do you want to pass to rAddress? And one more, the third parameter needs to be an instance of class conforming to ServiceCallback. Your EventsTrigger does not seem to conform to ServiceCallback.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21