How to disable fullscreen button in macOS app (Mac Catalyst) - macos

I tried to disable the fullscreen button (green button) that appears on my app mac window (originally it's an iOS app and I made it available for macOS through the app setting in Xcode - Mac Catalyst feature) using a code like the below in AppDelegate.swift, but it's not working because I am using UIKit not AppKit:
for window in NSApplication.shared.windows {
if let zoomButton = window.standardWindowButton(NSWindow.ButtonType.zoomButton) {
zoomButton.isHidden = true;
}
}
Does anyone have any idea how to disable the fullscreen button using the UIKit library?
Please note that I built an iOS app using an Ionic framework and I want to make it available for macOS, what I did is enable the macOS version on the app setting on the Xcode, so I am using AppDelegate.swift file only on Xcode.

I found how to do it by creating a macOS bundle target and Helper class to use and include AppKit API, then disabling the zoom button on the didFinishLaunchingWithOptions method.
For anyone who faces this issue when enabling Mac Catalyst, please follow the steps on below link:
https://crunchybagel.com/disabling-the-mac-zoom-maximise-button-in-catalyst/

Related

Can't find NavigationStack in autocomplete and can't run playground apps on MacOS

I'm trying to work on editing grids sample app in playgrounds. It works fine on my iPad but it is not working on my Mac. I can see the code but I get an error message that minimum deployment target is 16 and there is no preview showing. MacOS is up to 13 no? So I guess it is refering to iPad OS 16? How do I fix this on my Mac?
Also the code references NavigationStack which now replaced NavigationView but in Xcode it doesn't show up in autocomplete and the compiler doesn't recognize it.
When I go into apple store both xcode and playground just say "open", there is no update option.
What do I do?

How to remove the frame in the Mac Appstore from the application icon?

There is an ios application that is ported to macos using catalyst. When submit the latest update, the application icon in the MacAppstore has strange borders. At the same time, the application icon in macOS is displayed correctly.

How can I use Safari to debug a WKWebView in my Mac app?

I'm developing a Mac app that uses WKWebView to display HTML resources. I want to use the Safari inspector to debug the JavaScript in my app.
When I debug my app by launching it from Xcode, Safari doesn't show my app in the Develop menu — it displays "No Inspectable Applications".
How do I get my Mac app to appear in Safari's Develop menu?
From https://forums.developer.apple.com/thread/21521:
Add an entitlement file to the application, then set the entitlement key com.apple.security.get-task-allow to YES. This key is automatically added to iOS applications for Xcode debugging, but it must be added manually to Mac applications.
If you only want to use Safari to inspect while Xcode is running a debug build, add the entitlement file to a Debug configuration and not the Release configuration.
Download & try same in Safari Technology Preview
https://developer.apple.com/safari/technology-preview/

Xcode 8.1 missing Object Library

I have an android background, but am just learning how to build iPhone apps using swift. I am using the book Beginning iPhone Development with Swift 2: Exploring the iOS SDK.
Problem is that it refers to Buttons and such being in the Object Library and I don't have anything in my object library. I have clicked on the View as instructed.
I have a newly installed MacBook and am running Xcode 8.1, which is newer than the book's directions. It refers to iOS UIkit, but I don't know how to install this.
I did Single View Application under iPhone to get where I am. Can anyone point me to what I need to do? I am brand new to the Apple world entirely.
Aha! In the main window, I clicked on the storyboard and that allowed the Object Library to contain the view items, including buttons.
So, click on the storyboard in the main window, then click on the view in the IB.

How do I add the iPad view option to Xcode preview?

In my main Swift iOS app I see in Xcode the preview pane and it lets me add various iPhone and iPad devices successfully and view the selected UI View Controller in my app storyboard.
In my Today extension preview I can only add iPhone devices, not the iPad.
Any ideas?
Works fine for the main app:
Devices appear fine in simulator:
Universal app:
How to preview Storyboard in Xcode using Non-Base localisation ----> check it and enable UseAutolayout Opention , and size Classes

Resources