How To Share Code Between Cross-Platform Applications on Xamarin?
How To Share Code Between Cross-Platform Applications on Xamarin?
To share code between cross-platform applications on Xamarin, there are several strategies you can employ. The main methods include using .NET Standard Libraries, Shared Projects, and Portable Class Libraries (PCLs). Here’s a detailed overview of each approach:
.NET Standard is a specification of .NET APIs that are intended to be available on all .NET implementations. It provides a uniform API for all .NET platforms, including Xamarin, .NET Core, and .NET Framework. This makes it the preferred option for sharing code across different platforms.
Visual Studio for Mac:
Visual Studio 2017/2019:
#if __IOS__ for platform-specific code.Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.