Plugin.Maui.ApplePlatform 1.0.0.1

dotnet add package Plugin.Maui.ApplePlatform --version 1.0.0.1
                    
NuGet\Install-Package Plugin.Maui.ApplePlatform -Version 1.0.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Plugin.Maui.ApplePlatform" Version="1.0.0.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Plugin.Maui.ApplePlatform" Version="1.0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Plugin.Maui.ApplePlatform">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Plugin.Maui.ApplePlatform --version 1.0.0.1
                    
#r "nuget: Plugin.Maui.ApplePlatform, 1.0.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Plugin.Maui.ApplePlatform@1.0.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Plugin.Maui.ApplePlatform&version=1.0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Plugin.Maui.ApplePlatform&version=1.0.0.1
                    
Install as a Cake Tool

Plugin.Maui.ApplePlatform

License: MIT Publish Nugets

Compile shared iOS + MacCatalyst code from Platforms\Apple .NET MAUI app folder.

The Problem

In .NET MAUI, Platforms\iOS and Platforms\MacCatalyst compile separately. If your iOS and MacCatalyst code is identical — partial classes, handlers, renderers — you end up maintaining two copies of the same files or manually setting up conditional compilation, placing files outside of the Platforms folder.

The Solution

Installing this package will create a new folder Platforms\Apple, no more hassle, just place your shared files for IOS and MACCATALYST platform there!

Platforms\
  Apple\          ← shared code for Apple
    MyAppleHandler.cs
  iOS\            ← still works as usual
  MacCatalyst\    ← still works as usual
  Android\
  Windows\

Install

dotnet add package Plugin.Maui.ApplePlatform

Or via NuGet Package Manager — search Plugin.Maui.ApplePlatform.

How It Works

The package ships an MSBuild .targets file that:

  1. Creates Platforms\Apple folder before build (if missing)
  2. When targeting net*-ios — includes all Platforms\Apple\**\*.cs with virtual link Platforms\iOS\...
  3. When targeting net*-maccatalyst — includes all Platforms\Apple\**\*.cs with virtual link Platforms\macCatalyst\...

Files are never copied. The compiler sees them at the correct virtual path. Solution Explorer shows them under the right platform node.

Notes

  • Files in Platforms\iOS and Platforms\MacCatalyst still work as before — platform-specific overrides go there
  • Partial classes split between Platforms\Apple and a platform-specific folder work correctly
  • No manual configuration needed after install!

License

MIT

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.1 156 4/20/2026
1.0.0-pre6 144 4/20/2026