Post

Replies

Boosts

Views

Activity

Reply to Xcode 12.4 builds do not install on devices using iOS 15
What version of iOS is the device running? What version of the iOS 15 support files did you install? Be more specific than iOS 15, such as iOS 15.6. If the device is running a newer version of iOS than the iOS SDK/Support Files, you won't be able to install the app on the device. I have seen multiple questions on these forums about people unable to install apps built with Xcode 13.4.1 on devices running iOS 15.6. Search these forums for those posts, and you might find a workaround. If you're going to use an older Xcode version, turn off automatic updates on your device. Updating iOS requires updating Xcode or installing iOS support files.
Aug ’22
Reply to URL-Session is not working in Command Line App but in Playground
Does the app have the App Sandbox turned on? If so, network connections might be turned off so the networking code won't do anything. There are checkboxes to turn on network connections in the App Sandbox. To check if the app has the App Sandbox turned on, open the project editor by selecting the project from the left side of the project window. Select the app from the target list on the left side of the project editor. Click the App Capabilities button at the top of the project editor.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’22
Reply to ipa archived on macOS 11.4 cannot be installed
For anyone to help you, you need to supply more information: How are you installing the app? What version of iOS is the device running? What version of Xcode did you use to archive the app? What version of the iOS SDK did you use to archive the app? The site Xcode Releases (https://xcodereleases.com) lists the SDK for each Xcode version. I know that apps submitted to the App Store must be built with the iOS 15 SDK. I don't know if that restriction applies when installing an app on your own device. Updating to the latest non-beta version of Xcode may solve your problem. At the very least you will be archiving with the iOS 15 SDK.
Aug ’22
Reply to HTTP Status 400 – Bad Request
I have two suggestions to help you figure out what's going wrong. First, set a breakpoint at the start of the postTaniTalep function. Step through the code line by line and check that everything in the request is what you expect to see. If you haven't used Xcode's debugger before, the following article will help you: https://www.swiftdevjournal.com/an-introduction-to-xcodes-debugger/ Second, you have the following line of code to make the network call: let (data, response) = try await URLSession.shared.data(for: request) The code uses try. Code with try can throw errors, but you don't handle them. Wrap the network call in a do-catch block and at least print the error in the catch part of the block. The error message you get should be more helpful than "400 Bad Request".
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Reply to Multipage PDF with PDFKit on macOS with swift
There are two ways to create PDFs on Mac. The first is to use NSPrintOperation, which is in the AppKit framework. The second is to use the Quartz framework. If you have a lot of text, using Core Text with Quartz may help. The following article shows what you need to do to create a PDF with Quartz and Core Text: https://www.meandmark.com/blog/2016/08/creating-pdfs-with-core-text-and-quartz/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Reply to Need help with WKWebKit browser loading website (macOS)
A common cause for your issue is the App Sandbox is turned on with network connections turned off. When the network connections are turned off, you won't be able to show anything in a web view. Select the project from the left side of the project window to open the project editor. Select your app target from the left side of the project editor. Click the Signing and Capabilities button at the top of the project editor. Is there an App Sandbox section? If so, make sure the checkboxes in the Network section are selected. Is the code you showed the whole code you're using for the web view? The code you showed needs to be part of a view controller class with the outlet as a property in the class and the other three lines inside the viewDidLoad function. class ViewController: NSViewController { @IBOutlet weak var web: WKWebView!     override func viewDidLoad() { super.viewDidLoad() let purl = URL(string: "https://www.google.com")! web.load(URLRequest(url: purl)) web.allowsBackForwardNavigationGestures = true     } }
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’22
Reply to Open CSS files in MacOS document-based App
If the CSS files still aren't selectable, delete the document type you have with the identifier com.example.plain-text. In a test project what I had to do to make CSS files selectable was to have one CSS document type for the app with identifier public.css and an imported type identifier for CSS with identifier public.css. Unfortunately the project editor won't let you delete a document type. You will have to select the Info.plist file from the left side of the project window to delete a document type.
Topic: UI Frameworks SubTopic: AppKit Tags:
Aug ’22
Reply to Multiple Type in MacOS Document-based App
The Open and Save panels for an app that uses NSDocument are initially configured to only allow opening and saving files of your document type. If you want to read and write multiple file types, you must create imported and exported UTIs (Uniform Type Identifiers) for those file types. NSDocument has a readableTypes and a writableTypes property for the types a document type supports, but they provide only get methods. You can't set them in your app's code. To add imported and exported UTIs for your document type, take the following steps: Open the project editor by selecting the project from the left side of the project window. Select your app target from the left side of the project editor. Click the Info button at the top of the project editor. Click the disclosure triangle next to Exported Type Identifiers to access and add exported UTIs. Click the disclosure triangle next to Imported Type Identifiers to access and add imported UTIs. In SwiftUI reading and writing multiple file types is easier. SwiftUI documents have readableContentTypes and writableContentTypes properties where you can specify an array of UTTypes your file can read and write.
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’22
Reply to I can't see the option to add new package in Xcode !
If choosing File > Add Packages in Xcode doesn't provide a sheet to add the package, add the package from the project editor. Select the project from the left side of the project window to open the project editor. Select the project from the left side of the project editor. Click the Project Dependencies button at the top of the project editor. Click the Add (+) button at the bottom of the package list to add the package.
Jul ’22