Post

Replies

Boosts

Views

Activity

Reply to Set two var‘s after each other
I want to set the variable „selectedPlaceName“ before setting „showingPopover“ > Can you explain what you want to achieve? If the order of setting the variables is the purpose of you, you are doing it as you describe. If your actual purpose is sort of using selectedPlaceName in the popover, you may need to show more code.
Dec ’21
Reply to Action Button(Textfield)
Please try something like this: import SwiftUI struct HeartTextSquareView: View { @State private var name: String = "" @State private var adresse: String = "" @State var telefonnummern: [String] = [] //<- @State var something: String = "" var body: some View { VStack { List { TextField("Name/Vorname", text: $name) TextField("Adresse", text: $adresse) ForEach($telefonnummern, id: \.self) {$telefonnummer in TextField("Telefonnummer", text: $telefonnummer) } Button(action: { telefonnummern.append("") }) { Image(systemName: "plus.circle.fill") .foregroundColor(Color(.systemGreen)) } } } //End VStack }//End body }//End `HeartTextSquareView` When you want variable number of UI elements, you need to prepare a variable each element of which represents each UI element.
Topic: UI Frameworks SubTopic: UIKit Tags:
Dec ’21
Reply to Action Button(Textfield)
What I do not understand is that your code shown does not contain any TextField. You should better show more code even if it might not be perfect. That would explain what you want to do better than the too simple example.
Topic: UI Frameworks SubTopic: UIKit Tags:
Dec ’21
Reply to Playground 4 App doesn’t have code snippets?
Seems you are right and I cannot find a code snippet icon { } tapping +. (iPad mini 6) I guess Apple's designers of Swift Playgrounds have chosen some more specific set of code snippets for App project, rather than basic code snippets found in Playgrounds projects. Maybe they might be expecting that the users of App projects would be more experienced than users of Playground projects. You may send a feature request using the Feedback Assistant.
Dec ’21
Reply to Using Combine-Future to Fetch Server Data
What am I doing wrong?  In your code, you are making viewModel a local variable, so it will be released just after print("Yeah..."). Please try something like this: class ViewController: UIViewController { // MARK: - Variables private var cancellableSet: Set<AnyCancellable> = [] var viewModel: ViewModel! //<- // MARK: - Life cycle override func viewDidLoad() { super.viewDidLoad() let urlStr = "https://api.github.com/repos/ReactiveX/RxSwift/events" viewModel = ViewModel(urlStr: urlStr, waitTime: 2.0) //<- No `let` here` viewModel.fetchData(urlText: viewModel.urlStr, timeInterval: viewModel.waitTime) .sink { completion in print("complete") } receiveValue: { dataSet in print("count: \(dataSet)") } .store(in: &cancellableSet) print("Yeah...") } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Dec ’21
Reply to Set two var‘s after each other
I want to set the variable „selectedPlaceName“ before setting „showingPopover“ > Can you explain what you want to achieve? If the order of setting the variables is the purpose of you, you are doing it as you describe. If your actual purpose is sort of using selectedPlaceName in the popover, you may need to show more code.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Action Button(Textfield)
Please try something like this: import SwiftUI struct HeartTextSquareView: View { @State private var name: String = "" @State private var adresse: String = "" @State var telefonnummern: [String] = [] //<- @State var something: String = "" var body: some View { VStack { List { TextField("Name/Vorname", text: $name) TextField("Adresse", text: $adresse) ForEach($telefonnummern, id: \.self) {$telefonnummer in TextField("Telefonnummer", text: $telefonnummer) } Button(action: { telefonnummern.append("") }) { Image(systemName: "plus.circle.fill") .foregroundColor(Color(.systemGreen)) } } } //End VStack }//End body }//End `HeartTextSquareView` When you want variable number of UI elements, you need to prepare a variable each element of which represents each UI element.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Flutter installation
Flutter is not a framework of Apple's. You would get a better chance to get better responses sooner if you visit the supporting site or a community site of it.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Action Button(Textfield)
What I do not understand is that your code shown does not contain any TextField. You should better show more code even if it might not be perfect. That would explain what you want to do better than the too simple example.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to MY GAME IS CRASHING USING XCODE AND I DONT KNO HOW TO FIX
the issue is coming from unity? > It may be or may not be. Better find the right place and you would get the right answer sooner.
Replies
Boosts
Views
Activity
Dec ’21
Reply to MY GAME IS CRASHING USING XCODE AND I DONT KNO HOW TO FIX
Unity is not a framework of Apple's. You may get a better chance to receive better responses sooner if you visit the supporting site or a community site of Unity.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Error in downloading Xcode simulator
So, have you contacted Apple Developer Program Support?
Replies
Boosts
Views
Activity
Dec ’21
Reply to Action Button(Textfield)
Can you clarify what you want to ask?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to DateEncodingStrategy.custom encoder is immutable type?
(Duplicate answer removed)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to UITextFiled.selectedTextRange bug on iOS 15
Sharing some info about iOS bugs is not a bad thing, but the right place to report bugs is the Feedback Assistant. Have you already sent a bug report?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Write, Create and Read Excel Files in Swift without using third party library
No such functionalities in Apple's frameworks. Visit Microsoft's site which explains the data format of Excel and do all by yourself (maybe some work of years), or find a third party library.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to 60gb space gone after Xcode update
So what?
Replies
Boosts
Views
Activity
Dec ’21
Reply to Create a line break in a ForEach
Can you share your code? It would be much better if the code contains some example data.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Playground 4 App doesn’t have code snippets?
Seems you are right and I cannot find a code snippet icon { } tapping +. (iPad mini 6) I guess Apple's designers of Swift Playgrounds have chosen some more specific set of code snippets for App project, rather than basic code snippets found in Playgrounds projects. Maybe they might be expecting that the users of App projects would be more experienced than users of Playground projects. You may send a feature request using the Feedback Assistant.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Using Combine-Future to Fetch Server Data
What am I doing wrong?  In your code, you are making viewModel a local variable, so it will be released just after print("Yeah..."). Please try something like this: class ViewController: UIViewController { // MARK: - Variables private var cancellableSet: Set<AnyCancellable> = [] var viewModel: ViewModel! //<- // MARK: - Life cycle override func viewDidLoad() { super.viewDidLoad() let urlStr = "https://api.github.com/repos/ReactiveX/RxSwift/events" viewModel = ViewModel(urlStr: urlStr, waitTime: 2.0) //<- No `let` here` viewModel.fetchData(urlText: viewModel.urlStr, timeInterval: viewModel.waitTime) .sink { completion in print("complete") } receiveValue: { dataSet in print("count: \(dataSet)") } .store(in: &cancellableSet) print("Yeah...") } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’21