Post

Replies

Boosts

Views

Activity

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
Reply to Xcode has stopped working
Provide more details on what you mean when you say the following: When I checked out my account I am told that my session has timed out and I need to login.  What do you mean by "checked out my account"? What is the exact message you get telling you that you need to login? What happens if you login with your Mac user account's password instead of your Apple ID and password?
Jul ’22
Reply to Message "Expected '}' at end of brace statement"
You have four left braces in your code and only three right braces. Each left brace needs a matching right brace. Add a right brace after the second return statement. func responseTo(question: String) -> String {     if question.hasPrefix("hello") {         if lowerQuestion2.hasPrefix("hello") {             return "Hello there"         } else {             return "That really depends" } // Add the brace here to close the else block.     } // End the outer if block } // End of func
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’22
Reply to Submit an macOS app and Xcode version
You can publish Mac apps outside the App Store so you wouldn't have to use Xcode 13. If the app is free, you can host the app on your own site and provide a Download button. A paid app requires more work. You have to find a way to deal with licensing and process payments. Companies like Gumroad, Paddle, and FastSpring will help with this. The following book shows you how to sell software outside the Mac App Store: https://christiantietze.de/books/make-money-outside-mac-app-store-fastspring/
Jul ’22
Reply to How can I update my app to make it compatible with older ios versions?
Set the deployment target for the app's target to the earliest iOS version you want to support. Select the project file from the project navigator on the left side of the project window to access the deployment target. If you need more detailed instructions on setting the deployment target, read the following article: https://www.swiftdevjournal.com/supporting-older-versions-of-ios-and-macos/
Topic: Safari & Web SubTopic: General Tags:
Jul ’22
Reply to Fatal Error: UIViewControllerRepresentables must be value types: ViewControllerResolver
Does your app use UIViewControllerRepresentable? If so, is your data structure that uses UIViewControllerRepresentable a struct or a class? The error message is saying you have a class that conforms to UIViewControllerRepresentable, and that you have to use a struct instead of a class. Setting an exception breakpoint in Xcode and running the app can help you find where the app is crashing. Choose Debug > Breakpoints > Create Exception Breakpoint to set an exception breakpoint.
Jun ’22