Post

Replies

Boosts

Views

Activity

Reply to Beginner Debug Problem
You have to wrap the variable you are logging with the @ character, @i@, instead of $i. The message you log should be the following: The current value for I is: @i@ Read the following article for more details: https://www.swiftdevjournal.com/replace-swift-print-statements-with-xcode-breakpoint-actions/ The article talks about Swift code, not C++, but the material applies to C++ code as well.
Dec ’23
Reply to why my form does not work
Provide more specifics on what you mean by "form does not work". What do you expect to see? What do you see when you run your app? I suggest moving your networking code out of the form into its own function. Call the function when someone taps the Sign In button.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’23
Reply to Binding a Textfield to a name in a Object
You have two problems in your code. First, the @State property wrapper is for structs, not classes. You need to use the @StateObject property wrapper for classes. Either use @StateObject in the view or make QuizPlayer a struct instead of a class and remove @Published from the QuizPlayer fields. Second, you are overcomplicating things with binding a player's name to a text field. Instead of accessing the players using an index, go through the array of players and bind each player's name to the text field. The code will look similar to the following: ForEach(quizPlayers, id:\.self) { $player in TextField("Player Name: ", text: $player.name) } The $player argument gives you the current player so you do not have to access the quizPlayers array or deal with array indexes. Keep in mind I typed the code from memory so I cannot guarantee it will work correctly if you copy and paste it in your code. You may need to change $player to player. But the code gives you an idea of what you need to do to bind the player's name to the text field.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’23
Reply to Problems with PDFKit
I do not see anything wrong with the logic in the code you supplied. I see two possible formatting errors: importing the two frameworks on the same line and declaring the url property on the same line as the struct declaration. Does the code build if you place the import statements on separate lines and the url declaration on its own line? import SwiftUI import PDFKit struct PDFViewerView: UIViewRepresentable { var url: URL func makeUIView(context: Context) -> PDFView { let pdfView = PDFView() pdfView.document = PDFDocument(url: self.url) return pdfView } func updateUIView(_ uiView: PDFView, context: Context) { // Update the view. } }
Nov ’23
Reply to Problem with starting my Project
Would you recommend starting with Swift or SwiftUI. SwiftUI uses Swift so you have to know both. The question you really have is using UIKit or SwiftUI. For a new project I would recommend SwiftUI. Read the following article for additional details: https://www.swiftdevjournal.com/should-i-learn-swift-or-swiftui/ how I could download the App to my own Phone. is the 100€ a year Apple Developer enrolment necessary ? Or is there a free way without downloading it every week. No, a paid developer account is the only way to avoid having to reinstall your app every week. is there a way to publish the App as private. So only I see it myself ? Use unlisted app distribution to make the app private. https://developer.apple.com/support/unlisted-app-distribution/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’23
Reply to problem with .FileImporter in fisical divice
Paste the code as text and format it as a code block. Text in a code block is easier to read than a screenshot. Plus, people can copy and paste the code when it is in a code block. The code block button is the 4th button from the left in the list of buttons below the text editor on the forum. You can also add three backticks on the line above and below the code. https://www.markdownguide.org/extended-syntax/#fenced-code-blocks I am going to put, my code, as I say, in the breakpoints everything works fine, it does not show any errors, it simply does not load the file, nor does its name appear, when I pass it to testfligh and install it Please clarify one thing. When you run the project from Xcode on your iPad, are you able to open the file? Does the problem occur only when you install your app from TestFlight and run it on the iPad? My guess is the reason the file does not load and does not show any errors is the condition in the guard statement is false. Here is the code. guard let archivoURL1 = try result.get() as? URL else { return } If the call to result.get fails, you return before you get to any code that prints error messages. That is why no errors appear in Xcode's console.
Nov ’23
Reply to problem with .FileImporter in fisical divice
What happens when you run the app from Xcode on your iPad? Are you able to open the file? If you can, that narrows the problem down to TestFlight. I recommend running the app from Xcode on your iPad and set a breakpoint in your file importing code. If you step through the code line by line, Xcode's console should show error messages if there's a problem with opening the file. Show your file importing code. Without the code, people here will just be guessing about the cause of the problem.
Nov ’23
Reply to Problems using Core data.
When you create a new Core Data project in Xcode, the project is set to automatically create subclasses for your Core Data entities when you build the project. When you create a NSManagedObject subclass manually, you now have two copies of the subclass: the one Xcode generates and the one you created. You can have only one copy of the subclass. To fix the problem either remove the NSManagedObject subclass files you created or tell Xcode not to generate subclasses for your entities. Read the following article for more details: https://www.swiftdevjournal.com/core-data-code-generation/
Nov ’23
Reply to give developer account to programmer?!
List the steps you take to sign in to your developer account. What you are seeing is what someone without a developer account would see if they signed in to Apple. When I sign in to my developer account, I see a Program Resources section with the following columns: App Store Connect, Certificates, IDs, and Profiles, and Additional Resources. Each of these columns has a list of links. Do you see these columns when you sign in? Are you able to click the Users and Access link I mentioned in Step 2 in my earlier answer? When I click the Users and Access link under App Store Connect, I see the following links at the top of the page: People, Sandbox, Keys, Shared Secret, and Xcode Cloud. The People link is the initially selected link. There is a Users sidebar with a list of categories. Selecting the All items shows all the users on my team with an Add button above the list of users. Clicking the Add button lets me add someone to my team. I am not an Apple employee so I cannot provide more assistance. You may have to contact Apple's developer support to get this issue resolved.
Topic: App & System Services SubTopic: General Tags:
Nov ’23
Reply to give developer account to programmer?!
Add the programmer to your team in App Store Connect. Go to your developer account page: https://developer.apple.com/account Click the Users and Access link under App Store Connect. Click the Add (+) button to add a user to your team. Enter the programmer’s information and give him the Developer role to invite him to your team.
Topic: App & System Services SubTopic: General Tags:
Nov ’23