Post

Replies

Boosts

Views

Activity

Reply to XCode swift assistant editor
What is the course you are following? Above the source code editor on the right side are a set of buttons with small icons. Clicking the button with the stack of horizontal lines lets you open the assistant editor. Choose Assistant to open the assistant editor. If that doesn't do what you need, clicking the button with the + sign in the screenshot (the right button in the group of three at the top left of the screenshot) opens another editor view. That should let you see both the storyboard and the source code file at the same time. If that doesn't work, you are going to have provide more details on what you are trying to do.
Jan ’24
Reply to any example based on SpriteKit for getting started ?
There are two books that I would recommend to learn SpriteKit, one paid and one free. The paid one is Apple Game Frameworks and Technologies. https://pragprog.com/titles/tcswift/apple-game-frameworks-and-technologies/ The free one is 2D Apple Games by Tutorials. It covers SpriteKit. You may also have to deal with changes in Xcode since the book was published. You can download the book from Kodeco's deprecated book repository. https://github.com/kodecocodes/deprecated-books The site Check Sim Games has introductory SpriteKit articles. https://www.checksimgames.com/
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Jan ’24
Reply to Xcode build/Developer Account
Choose Product > Archive in Xcode to archive your project. Open the Organizer by choosing Window > Organizer. Select your archived project from the list on the left side of the Organizer. Click the Distribute App button. Choose Copy App from the list of options. Click the Next button. Pick a location to save the app. Click the Export button. Optionally you can copy the exported app to your Applications folder. The following article has more details: https://www.swiftdevjournal.com/running-a-mac-app-outside-of-xcode/
Jan ’24
Reply to Xcode build/Developer Account
When I called apple they said Id have to pay for a developer account if I wanted the software to work beyond a pre-determined testing period. Is this true? Only for iOS. You don't need a paid developer account to make Mac apps for personal use. Based on the information you supplied, the most likely cause of your build errors is the Xcode project is set to use the original developer's signing certificate. You are not the original developer so you don't have access to the certificate. I recommend setting the development team for the project to None. That will tell Xcode to not use the original developer's signing certificate when building the project. Take the following steps to do this: Open the project editor by selecting the project from the left side of the project window. Select the app target from the list of targets on the left side of the project editor. Click the Signing & Capabilities button at the top of the project editor. Choose None from the Team menu in the Signing section. That should fix the first error. Build the project again. If the second error still appears, take the following steps to add your Apple account to Xcode: Choose Xcode > Preferences to open Xcode's preferences window. Click the Accounts button at the top of the preferences window. Click the Add (+) button at the bottom of the list of accounts. Select Apple ID from the list of account types. Click the Continue button. Enter the email of your Apple ID. Click the Next button. Enter the password for your Apple ID. Click the Next button. A sheet will open with the title Apple ID Security. Click the Continue button to set up two factor authentication for signing in with this account. If that does not fix the build error, you are going to provide more information for anyone to be able to help you. Provide a link to the GitHub project you are trying to build. List the steps you took to clone and build the project.
Jan ’24
Reply to Implementing Renaming and Reordering in SwiftUI Sidebar for macOS App
Please provide more details on "the ability to rename an item with the Return key (behavior 2) stops working". What exactly happens when you select a list item and press the Return key? What are you using with your navigation links: NavigationSplitView, NavigationStack, or NavigationView? Show your code for the functions moveItem and renameItem. I tested some code in an app of mine that lets people rearrange and rename list items, and I could not replicate the behavior you see. I was able to select an item, press the Return key, and rename the item. My code uses NavigationView because my app must support macOS 12. My code for the navigation link binds the text field to the selected item, the item property in your item view, instead of using a separate property, such as your newTitle property.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’24
Reply to Xcode 14.2 Running Extremely Slow
The 8 GB of RAM and a 5400 rpm hard drive are not good specs for running Xcode. I have a similar model of iMac with 16 GB of RAM and Xcode on an external SSD, and Xcode 14.2 runs decently. It's not blazing fast, but it's not painfully slow either. If your iMac is a 27 inch model, you can add RAM to it. Doing that and moving your boot drive to an external SSD will improve things.
Dec ’23
Reply to How can I solve build failed error?
The usual causes of build errors are errors in your code and missing frameworks. You can see the build errors in Xcode's issue navigator. Press Cmd-5 in Xcode to show the issue navigator. No one here can give you an answer right now based on the information you provided. For anyone to help you, you must list the errors and show the source code for any compiler errors. Use text, not screenshots, to show your errors and code. Text is easier to read than trying to read text from a screenshot. The following article may help you get started with fixing the errors in your code: https://www.swiftdevjournal.com/why-wont-my-xcode-project-build/
Dec ’23
Reply to How to create paginated PDF from NSTextView?
Creating a PDF with multiple pages isn't easy. You are going to have use Quartz (CoreGraphics). Create a PDF context. Do the following until you reach the end of the text: Determine how much text can fit on a page. Call the PDF context's beginPage function. Draw the page of text. Call the PDF context's endPage function. Update the location in the text to start drawing the next page. The following article explains what you have to do to create a multiple page PDF with Quartz and Core Text: https://www.meandmark.com/blog/2016/08/creating-pdfs-with-core-text-and-quartz/ The TPPDF Swift package can be used to create PDF files. You will probably find it easier to use than to create a PDF with Quartz. https://github.com/techprimate/TPPDF
Topic: UI Frameworks SubTopic: AppKit Tags:
Dec ’23
Reply to No Observable Object of type...found
I have not used the Observation framework or SwiftUI's image renderer, but I think you need to move your pdfReport function out of the view model and into a SwiftUI view. I don't think you can create the image renderer in a view model. One question about your code. Why do you pass an array of Person objects to pdfReport and have the personsToPrint property in the ViewModel class? You don't use the person argument in the pdfReport function. Wouldn't it be easier to get rid of the personsToPrint property and use the array of Person objects in the for loop? Then you wouldn't have to worry about the array being nil. @MainActor func pdfReport(people: [Person]) { for person in people { // Rest of code omitted } }
Topic: App & System Services SubTopic: General Tags:
Dec ’23