Use internal when exposing low-level types like IntPtr
@ryzngard đang làm issue này rồi.
Từ ngày 5/5/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Is your feature request related to a problem? Please describe.
No, this is about hardening the API.
Exposing low-level types like IntPtr as public in user-facing code is bad practice for an interop library like this. It causes excessive, unnecessary information and APIs being exposed to users, which could lead to confusion and error-prone code being made with it.
Describe the solution you'd like
Refactor client-facing low-level members, constructors, etc. to be internal (or protected internal if necessary). For example, NSArray<T> has a public constructor with an IntPtr parameter. Users do not need to know about this, and makes the API messier for those trying to simply interface with it. Using an AssemblyInfo.cs can allow internal members to be available to other Apple assemblies without having to expose unnecessary data to users.
Describe alternatives you've considered
There are none.
Additional context
https://docs.unity3d.com/2020.1/Documentation/Manual/ScriptCompilationAssemblyDefinitionFiles.html
Example AssemblyInfo.cs file:
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Apple.Core.Tests")]
- Ngôn ngữ chính
- C#
- Star
- 986
- Fork
- 252
- Merge trung bình
- 1 giờ 36 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apple/unityplugins
-
bug Plug-in - GameKit
apple/unityplugins#98 · 2 bình luận · 1 người được giao ·
-
feature request
apple/unityplugins#94 · 3 bình luận · 8 reaction · 1 người được giao ·
-
feature request Plug-in - GameKit
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
apple/unityplugins#93 · 1 reaction ·
-
bug Plug-in - GameKit
apple/unityplugins#92 · 1 reaction · 1 người được giao ·
-
feature request
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
apple/unityplugins#86 · 3 reaction ·
Tất cả issue của apple/unityplugins
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
bug needs response
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Adyen/adyen-dotnet-api-library#1869 ·
-
Status: Needs Triage Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
bug effort:S P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
nightscout/nocturne#1602 ·