How to specify different dock icon in Swift for macOS App - swift

My app icons are a light blue with clear background and I find that it doesn't show up nicely in the macOS dock.
I'm trying to find a way to use a different icon for the dock icon only but can't seem to find a way to do it programatically or through Xcode.
The dock icon I created does adhere to the Apple HIG guidelines however I'm not distributing through the App Store anyways.
Can anyone help me out?
I'm using XCode 13 with Swift 5.

Setting NSApp.applicationIconImage should do what you need.
EDIT: If you need to display a custom icon even when the app is not running, you need to make a dock tile plugin. Unfortunately, documentation on this is pretty scarce, but basically you need to make a plugin target, embed it inside your app's bundle with the extension .docktileplugin, put the path to your plugin in your app's Info.plist under the NSDockTilePlugIn key, and then make the plugin's principal class implement the NSDockTilePlugIn protocol. Also keep in mind that dock tile plugins are not allowed in the Mac App Store, so you'll need to self-publish with a Developer ID certificate if you go this route.

Related

Setting little app icon in iOS in .NET MAUI app

All the app icons in my .NET MAUI app seem to work correctly, except for this little guy on iOS. You see this icon when you swipe up to see all the open apps.
I guess, somehow I'm missing this but I uploaded all the icons with different sizes Apple requires for iOS apps. Which one is this icon and how do I make sure I'm giving Apple my app's icon for this particular size so it doesn't default to the .NET icon?
Yes,this is often the case when you are using images that are not formatted correctly or are very complex. And I've had similar problems before.
Vector graphics are highly recommended in ios.

How to Fix Missing App Icon in WatchOS Dock/App Switcher

I've searched far and wide but can't seem to find a solution. When building a watchOS companion app in Xcode, the App Icon on watchOS is missing in the dock/app switcher screen on the Apple Watch. I've added all the appropriate PNG image sizes in Assets and the icons are displayed correctly everywhere else such as in Notification Center, Companion Settings, Home Screen, Notifications, etc. The only place the icon is missing and just shows a generic wireframe image is in the dock/app switcher screen on the Apple Watch. I've checked the Xcode build settings and made sure the watchOS target is pointing to the correct App Icon Source. Please help. Thanks.
See Image Examples Below:

How to make my app to support multitasking

i am developing an app for iphone and ipad with 4.0 as base SDK and 3.0 as target.
how to enable multitasking to this app.
thanks..
To adopt Multi-Tasking in your app. apply the following points:
Support all orientation from the target's General section in settings.
In the General section too. remove the check next to Requires full screen if any.
Select storyboard, click the File Inspector icon in the right side bar. check the box next to Use Size Classes. Check out tutorials how to use size class to adjust your views according to the screen size assigned to your app.
Refer http://answers.oreilly.com/topic/1867-how-to-update-your-iphone-app-for-multitasking-with-ios-4/
Also duplicate question how to do multitasking application in ios 4.0
If you build an iOS app using a 4.x SDK, Apple's "multitasking" will be enabled by default, unless you explicitly add a plist key to prevent it.
But multitasking may not work properly unless you add support for it in the app's resign/become active, and/or app's suspend/resume delegates.
If you actually want to run code in the background, then your app needs to be of a few very specific types, or add support for running some code for a very limited amount of time, for which you probably want to read Apple's documentation.

iPhone - Change app icon pointed to by info.plist within the application?

Is there any way to change the 47x47 PNG, pointed to within info.plist, for the iPhone springboard icon from within code?
I understand I can add a translation and change the springboard icon per language that the iPhone supports via a changed info.plist per language, but I would like to change the springboard icon for my iPhone app based on a user preference within the app.
Any ideas?
I haven't tried this, but can a file be copied over another within an app bundle? Could I ship with info.plist pointing to "base.png" then replace "base.png" with another PNG I package with my app from within code?
Thanks.
--Batgar
This cannot be done - an iPhone application main bundle is read only, so you cannot change your app icon from within your app.
What you want to do is create a new target (with the relevant icon) for each "sister" app and that will allow you to compile multiple apps using the same code base. Hope this helps!

Iphone working with icons

I want to write a simple program which can customize iphone icons like their positions or something like theme creators. and I want to know how some programs' settings are in the iphone main setting tab. I really need help.
thanx in advance
If you mean you want to retheme the springboard (the place where apps icons are displayed) you can't. If you want to retheme things inside your own application it is doable, but it really depends on the design of your application.
To get your apps settings into the Settings app you just need to add a Settings.bundle to your app, which a plist describing the preferences. There is documentation for it here.
There's an app that already does this for jailbroken iPhones. It's called iconoclasm, you can get it from Cydia.