diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ddd6b6..fdf4cce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,10 @@ on: jobs: build: - name: Build Job + name: Build and Test runs-on: macos-15 + outputs: + version: ${{ steps.gitversion.outputs.semVer }} defaults: run: working-directory: Source @@ -20,8 +22,7 @@ jobs: uses: actions/checkout@v5 with: fetch-depth: 0 # Required for Calculate Version step (e.g. GitVersion) - - # Required by GitVersion + - name: Install .NET 8.0 uses: actions/setup-dotnet@v5 with: @@ -42,21 +43,54 @@ jobs: useConfigFile: true updateProjectFiles: true - - name: NuGet + - name: NuGet Restore run: dotnet restore # Smoke test to make sure the Example Client builds. We don't do a release build # of the Example Client because it takes a long time and we don't publish it. - - name: Debug Build of Solution to Smoke test Example Client + - name: Debug Build of Solution to Smoke Test Example Client run: dotnet build -c Debug - name: Create NuGet Package run: dotnet pack SaturdayMP.XPlugins.iOS.BEMCheckBox/SaturdayMP.XPlugins.iOS.BEMCheckBox.csproj -c Release + - name: Upload NuGet Package Artifact + uses: actions/upload-artifact@v4 + with: + name: nuget-package + path: Source/SaturdayMP.XPlugins.iOS.BEMCheckBox/bin/Release/SaturdayMP.XPlugins.iOS.BEMCheckBox.${{ steps.gitversion.outputs.semVer }}.nupkg + retention-days: 90 + - name: Publish to MyGet run: dotnet nuget push SaturdayMP.XPlugins.iOS.BEMCheckBox/bin/Release/SaturdayMP.XPlugins.iOS.BEMCheckBox.${{ steps.gitversion.outputs.semVer }}.nupkg -k ${{ secrets.MYGET_API_KEY }} -s https://www.myget.org/F/saturdaymp/api/v3/index.json - # Only push tagged builds to NuGet. These will be production or release candidates. - - name: Upload to NuGet - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - run: dotnet nuget push SaturdayMP.XPlugins.iOS.BEMCheckBox/bin/Release/SaturdayMP.XPlugins.iOS.BEMCheckBox.${{ steps.gitversion.outputs.semVer }}.nupkg -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols -s https://api.nuget.org/v3/index.json \ No newline at end of file + publish-nuget: + name: Publish to NuGet + runs-on: ubuntu-latest + needs: build + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + permissions: + id-token: write # Required for Trusted Publishing (OIDC token generation) + + steps: + - name: Install .NET 8.0 + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 8.0 + + - name: Download NuGet Package Artifact + uses: actions/download-artifact@v4 + with: + name: nuget-package + path: ./packages + + # Authenticate to NuGet.org using Trusted Publishing (OIDC) + - name: Login to NuGet + uses: NuGet/login@v1 + id: nuget-login + with: + user: ${{ secrets.NUGET_USERNAME }} + + # Only push tagged builds to NuGet. These will be production or release candidates. + - name: Publish to NuGet + run: dotnet nuget push ./packages/SaturdayMP.XPlugins.iOS.BEMCheckBox.${{ needs.build.outputs.version }}.nupkg --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY}} --skip-duplicate --no-symbols -s https://api.nuget.org/v3/index.json \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..c7e91aa --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,452 @@ +# AGENTS.md + +This document provides guidance for AI agents (like Claude Code, GitHub Copilot, etc.) when working with the XPlugins.iOS.BEMCheckBox project. + +## Project Overview + +**XPlugins.iOS.BEMCheckBox** is a .NET iOS binding library that wraps the native Swift BEMCheckBox framework for use in .NET iOS applications. It enables .NET developers to use highly customizable, animated checkbox controls in their iOS applications. + +**Current Version:** 8.0.0 +**Target Framework:** net8.0-ios18.0 +**Language:** C# 12 +**Package:** SaturdayMP.XPlugins.iOS.BEMCheckBox (NuGet) + +## Project Structure + +``` +/Source/ +├── SaturdayMP.XPlugins.iOS.BEMCheckBox/ # Main binding library +│ ├── NativeReferences/ # Native BEMCheckBox.xcframework (v2.2.0) +│ ├── ApiDefinitions.cs # C# binding API definitions +│ ├── StructsAndEnums.cs # Enums and structs +│ └── *.csproj # Binding project configuration +├── ExampleClient/ # Demo iOS application +│ ├── MainViewController.cs # Usage examples +│ └── *.csproj # Example app project +└── global.json # .NET SDK version (8.0.0) +``` + +## Key Components + +### Core API Classes (ApiDefinitions.cs:1) + +1. **BEMCheckBox** - Main checkbox control (UIControl subclass) + - Properties: On, BoxType, LineWidth, CornerRadius, AnimationDuration, Colors, etc. + - Methods: SetOn(bool, bool) for state changes with optional animation + - Delegate: BEMCheckBoxDelegate for event handling + +2. **BEMAnimationManager** - Handles checkbox animations + - Methods: StrokeAnimationReverse, FillAnimationWithBounces, MorphAnimationFrom, etc. + +3. **BEMCheckBoxGroup** - Groups checkboxes for radio button behavior + - Properties: CheckBoxes, SelectedCheckBox, MustHaveSelection + - Methods: AddCheckBoxToGroup, RemoveCheckBoxFromGroup, Contains + +4. **BEMCheckBoxDelegate** (Protocol) - Event callbacks + - DidTap: Fired before state changes + - AnimationDidStopFor: Fired after animation completes + +### Enumerations (StructsAndEnums.cs:1) + +- **BEMBoxType**: Circle (0), Square (1) +- **BEMAnimationType**: Stroke, Fill, Bounce, Flat, OneStroke, Fade + +## Development Guidelines + +### When Adding/Modifying Bindings + +1. **Always preserve Objective-C/Swift signatures in comments** + - Keep existing comment patterns for method signatures + - Example: `// @property (nonatomic, assign) BOOL on;` + +2. **Use correct binding attributes** + - `[BaseType]` for class inheritance + - `[Export("selector:")]` for method/property mappings + - `[Protocol]`, `[Model]` for delegates + - `[NullAllowed]` for optional parameters + - `[EventArgs("EventName")]` for delegate events + +3. **Follow naming conventions** + - Use PascalCase for properties and methods + - Keep names close to original Swift/Objective-C names + - Maintain .NET naming standards while preserving clarity + +4. **Namespace organization** + - All bindings go in namespace: `SaturdayMP.XPlugins.iOS` + - Do not create sub-namespaces + +### When Updating the Native Framework + +1. **Replace the xcframework in NativeReferences/** + - Update BEMCheckBox.xcframework + - Verify architecture support: ios-arm64, ios-arm64_x86_64-simulator + +2. **Update ApiDefinitions.cs if API changes** + - Review Swift framework changelog + - Add/modify/remove bindings as needed + - Test with ExampleClient + +3. **Update version mapping in README.md** + - Add row to version mapping table + - Document any breaking changes + +### When Modifying ExampleClient + +1. **Keep it simple and focused** + - Demonstrate core functionality only + - One ViewController pattern (MainViewController.cs:1) + - Console logging for debugging + +2. **Update examples for new features** + - Add usage examples for new bindings + - Wire up event handlers + - Show best practices + +3. **Do not publish ExampleClient** + - It's for testing/demonstration only + - Only the binding library is published to NuGet + +## Build and CI/CD + +### Local Build Commands + +```bash +# Restore dependencies +dotnet restore Source/SaturdayMP.XPlugins.iOS.BEMCheckBox.sln + +# Build debug (includes ExampleClient smoke test) +dotnet build Source/SaturdayMP.XPlugins.iOS.BEMCheckBox.sln -c Debug + +# Create NuGet package (Release configuration) +dotnet pack Source/SaturdayMP.XPlugins.iOS.BEMCheckBox/SaturdayMP.XPlugins.iOS.BEMCheckBox.csproj -c Release +``` + +### Version Management + +**Strategy:** GitHubFlow with GitVersion + +- Version is determined from Git tags and branch names +- Format: Semantic versioning (major.minor.patch) +- Configuration: GitVersion.yml:1 +- Current version: 8.0.0 + +**Version workflow:** +1. Work on feature branches or release/* branches +2. Create PR to main +3. Merge to main (minor version increment) +4. Create release branch: `release/X.Y.Z` +5. Tag release: `vX.Y.Z` +6. CI automatically publishes to NuGet + +**Important:** Do NOT manually edit version numbers in csproj or nuspec files. They are automatically generated by GitVersion. + +### CI/CD Pipeline (.github/workflows/ci.yml:1) + +**Triggers:** +- Push to main or release/* branches +- Tags matching v* +- Pull requests + +**Build steps:** +1. Checkout with full Git history (required for GitVersion) +2. Install .NET 8.0 +3. Restore workloads +4. Install GitVersion (6.3.0) +5. Determine version +6. Restore NuGet packages +7. Build Debug (smoke test) +8. Create Release NuGet package +9. Publish to MyGet (all builds) +10. Publish to NuGet (tagged releases only) + +**Runner:** macOS-15 (required for iOS builds) + +### Release Notes (.github/workflows/release-notes.yml:1) + +**Automated changelog generation:** +- Uses GitReleaseManager (0.20.0) +- Reads from GitHub milestones and issues +- Categories defined in GitReleaseManager.yml:1 +- Auto-commits updated CHANGELOG.md + +**Categories:** +- breaking: Breaking Changes +- bug: Bug Fixes +- devops: DevOps +- dependency: Dependencies +- documentation: Documentation +- enhancement: Enhancements +- refactoring: Refactoring +- security: Security + +**Important:** Always tag issues/PRs with appropriate labels for changelog generation. + +## Common Tasks + +### Adding a New Property Binding + +1. Locate the property in BEMCheckBox Swift source +2. Add to ApiDefinitions.cs in the BEMCheckBox interface +3. Use `[Export("propertyName")]` attribute +4. Add appropriate type mapping (nint, nuint, bool, NSString, etc.) +5. Add `[NullAllowed]` if optional +6. Test in ExampleClient + +**Example:** +```csharp +// @property (nonatomic, strong) UIColor *onTintColor; +[Export("onTintColor", ArgumentSemantic.Strong)] +[NullAllowed] +UIColor OnTintColor { get; set; } +``` + +### Adding a New Method Binding + +1. Locate the method in BEMCheckBox Swift source +2. Add to ApiDefinitions.cs in the appropriate interface +3. Use `[Export("methodName:withParam:")]` with full selector +4. Map parameter types correctly +5. Test in ExampleClient + +**Example:** +```csharp +// - (void)setOn:(BOOL)on animated:(BOOL)animated; +[Export("setOn:animated:")] +void SetOn(bool on, bool animated); +``` + +### Adding a New Delegate Event + +1. Define the delegate method in BEMCheckBoxDelegate protocol +2. Add `[EventArgs("EventArgType")]` attribute +3. Create corresponding EventArgs class if needed +4. Add `[EventName("EventName")]` for .NET event name +5. Test event firing in ExampleClient + +### Updating to a New BEMCheckBox Version + +1. Download new xcframework from source repository +2. Replace in NativeReferences/BEMCheckBox.xcframework/ +3. Review BEMCheckBox changelog for API changes +4. Update ApiDefinitions.cs for new/changed APIs +5. Update StructsAndEnums.cs for new enums +6. Update ExampleClient to demonstrate new features +7. Test thoroughly +8. Update README.md version mapping table +9. Create GitHub issue/milestone for the update +10. Create release branch and tag + +### Fixing Build Errors + +**Common issues:** + +1. **"Framework not found BEMCheckBox"** + - Check NativeReferences/BEMCheckBox.xcframework exists + - Verify NativeReference in csproj + +2. **"Selector not found"** + - Check Export selector matches exactly + - Case-sensitive, include colons for parameters + +3. **"Type mismatch"** + - Review Objective-C to C# type mappings + - Common mappings: BOOL→bool, NSInteger→nint, NSString→string + +4. **"Workload not found"** + - Run: `dotnet workload restore` + - Ensure macOS with Xcode installed + +### Running ExampleClient + +**From an IDE:** +1. Open solution in Visual Studio for Mac or VS Code +2. Set ExampleClient as startup project +3. Select iOS Simulator +4. Build and run (F5) +5. Interact with checkbox to test functionality + +**From the Command Line:** +The .NET CLI does not directly support running iOS applications. To verify the ExampleClient builds correctly: + +```bash +# Navigate to Source directory +cd Source + +# Build the solution (includes ExampleClient) +dotnet build -c Debug +``` + +To actually run the app, you must use an IDE (Visual Studio for Mac, Visual Studio, or Rider) or use advanced tools like `xcrun simctl` to manually install and launch the built .app bundle. + +**Requirements:** +- macOS with Xcode installed +- .NET 8.0 SDK +- iOS Simulator available (for running) +- IDE required for running (command-line build only) + +## Important Constraints + +### Platform Requirements + +- **macOS required** for building (iOS SDK dependency) +- **Xcode** must be installed (iOS development tools) +- **.NET 8.0 SDK** required (pinned in global.json:1) +- **iOS 18.0+** minimum target + +### Binding Limitations + +1. **No generic types** - Objective-C runtime limitation +2. **No operator overloading** - Use explicit methods +3. **Delegate pattern** - Use events or strong delegates +4. **Memory management** - Let runtime handle retain/release + +### Package Configuration + +**Important:** The nuspec file (SaturdayMP.XPlugins.iOS.BEMCheckBox.nuspec:1) currently references net6.0-ios but the project targets net8.0-ios18.0. When modifying package settings, ensure consistency. + +**NuGet package contents:** +- Main DLL only (not ExampleClient) +- LICENSE.txt +- README.md (referenced, not embedded) +- Target framework: Update to net8.0-ios + +## Testing Strategy + +**Current approach:** Manual testing via ExampleClient + +**No automated tests exist**, but CI validates: +- Entire solution compiles (Debug mode) +- NuGet package builds (Release mode) +- Implicit validation of binding correctness + +**When making changes:** +1. Build in Debug mode: `dotnet build -c Debug` +2. Run ExampleClient in iOS Simulator (via IDE) +3. Test affected functionality manually +4. Verify NuGet package creation: `dotnet pack -c Release` +5. Check CI passes before merging + +**Future considerations:** +- Add unit tests for binding layer +- Add UI tests for ExampleClient +- Add device testing (not just simulator) + +## Code Quality Standards + +### Code Style + +- **C# 12** language features allowed +- **Nullable reference types** enabled +- **ImplicitUsings** enabled +- Follow .NET naming conventions +- Keep binding code minimal and clean + +### Documentation + +- Update README.md for user-facing changes +- Add inline comments for complex bindings +- Update CHANGELOG.md via GitReleaseManager +- Keep version mapping table current + +### Git Workflow + +1. Create feature branch from main +2. Make changes following these guidelines +3. Test locally with ExampleClient +4. Create PR to main +5. Ensure CI passes +6. Tag issues/PRs with appropriate labels +7. Merge to main +8. Create release branch for publishing +9. Tag for NuGet publication + +## Common Pitfalls + +### 1. Version Conflicts + +**Pitfall:** Manually setting versions in csproj or nuspec +**Solution:** Always use GitVersion; versions are auto-generated from Git tags + +### 2. Missing Native Reference + +**Pitfall:** Forgetting to include xcframework in project +**Solution:** Ensure `` exists in csproj + +### 3. Incorrect Selector Mapping + +**Pitfall:** Export selector doesn't match Objective-C method +**Solution:** Use exact selector including colons (e.g., `setOn:animated:`) + +### 4. Type Marshalling Errors + +**Pitfall:** Using wrong C# type for Objective-C types +**Solution:** Refer to binding type reference: +- BOOL → bool +- NSInteger → nint +- NSUInteger → nuint +- NSString → string +- id → NSObject + +### 5. Breaking API Changes + +**Pitfall:** Changing public API without considering consumers +**Solution:** Mark breaking changes with issue label, increment major version, document in changelog + +### 6. Platform-Specific Code + +**Pitfall:** Assuming .NET Standard patterns work +**Solution:** This is iOS-specific; use iOS APIs and patterns only + +### 7. CI Build Failures + +**Pitfall:** Works locally but fails in CI +**Solution:** CI uses macOS-15 runner; ensure compatibility with GitHub Actions environment + +## External References + +### Documentation +- [Microsoft Learn: Binding iOS Swift Libraries](https://learn.microsoft.com/xamarin/ios/platform/binding-swift/) +- [Project README](README.md:1) +- [BEMCheckBox Original Framework](https://github.com/saturdaymp/BEMCheckBox) + +### Package Distribution +- [NuGet Package](https://www.nuget.org/packages/SaturdayMP.XPlugins.iOS.BEMCheckBox) +- [MyGet Feed (WIP builds)](https://www.myget.org/feed/saturdaymp) + +### Related Blog Posts +- [Creating Xamarin iOS Binding Series](https://www.saturdaymp.com/tag/creating-xamarin-ios-bindings/) + +## Quick Reference + +### File Responsibilities + +| File | Purpose | When to Modify | +|------|---------|---------------| +| ApiDefinitions.cs:1 | C# binding definitions | Adding/modifying bindings | +| StructsAndEnums.cs:1 | Enums and structs | New enum types from framework | +| *.csproj | Project configuration | Changing target framework, references | +| *.nuspec | NuGet package metadata | Package description, dependencies | +| MainViewController.cs:1 | Example usage | Demonstrating new features | +| README.md:1 | User documentation | API changes, version updates | +| GitVersion.yml:1 | Version configuration | Changing version strategy | +| GitReleaseManager.yml:1 | Release notes config | Adding new issue categories | + +### Build Configuration Reference + +- **Debug**: Includes ExampleClient, used for testing +- **Release**: Library only, creates NuGet package +- **Target Framework**: net8.0-ios18.0 +- **Package ID**: SaturdayMP.XPlugins.iOS.BEMCheckBox +- **License**: MIT + +### Support and Maintenance + +- **Issues**: Report on GitHub repository +- **Sponsorship**: GitHub Sponsors enabled (FUNDING.yml:1) +- **Maintainer**: SaturdayMP organization + +--- + +**Last Updated:** 2025-11-19 +**For Version:** 8.0.0 +**Agent Compatibility:** Optimized for Claude Code, GitHub Copilot, and other AI coding assistants diff --git a/CHANGELOG.md b/CHANGELOG.md index db28687..540b7ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## v8.0.0 (Nov, 14, 2025) -As part of this release we had [5 issues](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/milestone/6?closed=1) closed. +As part of this release we had [8 issues](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/milestone/6?closed=1) closed. Release for .NET 8. Other updates include updating to iOS 18.0 and BEMChecBox 2.2.0. @@ -13,11 +13,14 @@ __DevOps__ - [__!30__](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/pull/30) Add SaturdayMP sponsorship button - [__!35__](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/pull/35) Update GitVersion and CI workflow configurations +- [__!36__](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/pull/36) Update release notes workflow +- [__!38__](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/pull/38) Enable Trusted Publishing for NuGet __Documentation__ - [__!29__](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/pull/29) Update XPlugin version mapping to README - [__!31__](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/pull/31) Added sponsor shield to README +- [__!37__](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/pull/37) Update documentation for v8.0.0 release ## v3.1.0 (Oct, 17, 2023) diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..9e435cf --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,3 @@ +# Claude Code Assistant Guide + +@AGENTS.md \ No newline at end of file diff --git a/README.md b/README.md index 1cd7ff5..c07815c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ [![GitHub release (with filter)](https://img.shields.io/github/v/release/saturdaymp/XPlugins.iOS.BEMCheckBox?sort=semver&label=Latest%20Release&labelColor=3C444C&logoColor=959DA5&logo=GitHub)](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/latest) [![Nuget](https://img.shields.io/nuget/dt/SaturdayMP.XPlugins.iOS.BEMCheckBox?logo=nuget&label=Downloads&labelColor=3C444C&logoColor=959DA5)](https://www.nuget.org/packages/SaturdayMP.XPlugins.iOS.BEMCheckBox) [![CI](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/actions/workflows/ci.yml/badge.svg)](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/actions/workflows/ci.yml) -[![Release Notes](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/actions/workflows/release-notes.yml/badge.svg)](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/actions/workflows/release-notes.yml) [![GitHub Sponsors](https://img.shields.io/github/sponsors/saturdaymp?label=Sponsors&logo=githubsponsors&labelColor=3C444C)](https://github.com/sponsors/saturdaymp) # XPlugins.iOS.BEMCheckBox -This plugin lets you use the [BEMCheckBox](https://github.com/saturdaymp/BEMCheckBox) in your .NET iOS applications. This README outlines how to get started with BEMCheckBox in .NET and some common uses. For a list of all the features of the please see the BEMCheckBox GitHub [page](https://github.com/saturdaymp/BEMCheckBox). +This .NET iOS binding library lets you use the [BEMCheckBox](https://github.com/saturdaymp/BEMCheckBox) framework in your .NET iOS applications. This README outlines how to get started with BEMCheckBox in .NET and some common uses. For a list of all features, please see the BEMCheckBox GitHub [page](https://github.com/saturdaymp/BEMCheckBox). # Installing XPlugins is a NuGet Package and can be installed using the dotnet command line: @@ -14,10 +13,10 @@ XPlugins is a NuGet Package and can be installed using the dotnet command line: dotnet add package SaturdayMP.XPlugins.iOS.BEMCheckBox ``` -You can find other ways to install the latest stable version of the BEMCheckBox XPlugin via [NuGet](https://www.nuget.org/packages/SaturdayMP.XPlugins.iOS.BEMCheckBox/). You can find work in progress (WIP) and alpha builds on [MyGet](https://www.myget.org/feed/saturdaymp/package/nuget/SaturdayMP.XPlugins.iOS.BEMCheckBox). If you have any trouble installing please let me know by opening an [issue](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/issues). +You can find other ways to install the latest stable version of the BEMCheckBox XPlugin on [NuGet](https://www.nuget.org/packages/SaturdayMP.XPlugins.iOS.BEMCheckBox/). You can find work in progress (WIP) and alpha builds on [MyGet](https://www.myget.org/feed/saturdaymp/package/nuget/SaturdayMP.XPlugins.iOS.BEMCheckBox). If you have any trouble installing, please let me know by opening an [issue](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/issues). # Quickstart -To create a BEMCheckBox call the constructor with a frame as shown below. +To create a BEMCheckBox, call the constructor with a frame as shown below. ```C# var checkbox = new SaturdayMP.XPlugins.iOS.BEMCheckBox(new CoreGraphics.CGRect(140, 40, 25, 25)); @@ -36,7 +35,7 @@ checkbox.OnAnimationType = BEMAnimationType.Fill; checkbox.OffAnimationType = BEMAnimationType.Fill; ``` -Yes you can set the on and off animation types to be different. You can set the color: +Yes, you can set the on and off animation types to be different. You can set the color: ```C# checkbox.OnFillColor = UIColor.Red; @@ -52,7 +51,7 @@ checkbox.On = true; checkbox.On = false; ``` -Finally to handle checkbox clicks setup an event: +Finally, to handle the checkbox click event set up an event: ```C# private void CheckBoxClickedEvent(object sender, EventArgs eventArgs) @@ -73,38 +72,59 @@ checkbox.AnimationDidStopFor += CheckBoxClickedEvent; For a full list of settings such as animation type, colours, etc see the [BEMCheckBox](https://github.com/saturdaymp/BEMCheckBox) page. -You can also play with the BEMCheckBox settings in the [Example Client](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/tree/master/Source/ExampleClient). To run the Example Client open the source in Visual Studio 2017 and set the Example Client as the startup project. If the Example Client does not run please [let me know](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/issues). +## Running the Example Client + +You can also play with the BEMCheckBox settings in the [Example Client](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/tree/main/Source/ExampleClient). + +### From an IDE +Open the solution in Visual Studio for Mac, Visual Studio, or your preferred .NET IDE and set the Example Client as the startup project, then run it (F5). + +### From the Command Line +Building and running iOS applications from the command line requires an IDE. The recommended approach is: + +1. Build the solution to verify it compiles: + ```bash + cd Source + dotnet build -c Debug + ``` + +2. Open the solution in Visual Studio and run the ExampleClient from there. + +**Note:** Running iOS applications requires macOS with Xcode installed. Command-line execution of iOS apps is not directly supported by the .NET CLI and requires using an IDE or additional tools like `simctl`. # Version Mapping -Below is the mapping of the BEMCheckBox version used in the XPlugin wrapper version along with the Xamain/.NET version. +Below is the mapping of the BEMCheckBox version used in the XPlugin wrapper version along with the Xamarin/.NET version. -The .NET version lists the minimum .NET and iOS versions required. For example, `net6.0-ios12`` means the XPlugin will work with .NET 6.0 and iOS 12 or higher (e.g. it will work with .NET 7 and iOS 16). +The .NET version lists the minimum .NET and iOS versions required. For example, `net8.0-ios18.0` means the XPlugin will work with .NET 8.0 and iOS 18.0 or higher (e.g. it will work with .NET 8, .NET 9, .NET 10, and iOS 18, iOS 26). -Please let me know if this XPlugin does not work work with a future version of .NET or iOS by opening an [issue](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/issues). +Starting with version 8, the XPlugin version will match the .NET release it is targeting. -| XPlugin | BEMCheckBox | Frameworks/Minimum Version | -| ---: | ---: | ---: | -| [1.4.1](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/1.4.1) | [1.4.1](https://github.com/saturdaymp/BEMCheckBox/releases/tag/1.4.1) | Xamarin.iOS/xamarinios10 -| [1.4.2](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/1.4.2) | [1.4.1](https://github.com/saturdaymp/BEMCheckBox/releases/tag/1.4.1) | Xamarin.iOS/xamarinios10 | -| [1.4.3](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/1.4.3) | [1.4.1](https://github.com/saturdaymp/BEMCheckBox/releases/tag/1.4.1) | Xamarin.iOS/xamarinios10 -| [2.0.0](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/2.0.0) | [2.0.0](https://github.com/saturdaymp/BEMCheckBox/releases/tag/2.0.0) | Xamarin.iOS/xamarinios10 -| [3.0.0](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/3.0.0) | [2.0.0](https://github.com/saturdaymp/BEMCheckBox/releases/tag/2.0.0) | .NET/net6.0-ios16.1 -| [3.0.1](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/3.0.1) | [2.0.0](https://github.com/saturdaymp/BEMCheckBox/releases/tag/2.0.0) | .NET/net6.0-ios12.0 +| XPlugin | BEMCheckBox | Frameworks/Minimum Version | +|-----------------------------------------------------------------------------------:|----------------------------------------------------------------------:|---------------------------:| +| [8.0.0](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/8.0.0) | [2.2.0](https://github.com/saturdaymp/BEMCheckBox/releases/tag/2.2.0) | .NET/net8.0-ios18.0 | +| [3.1.0](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/3.1.0) | [2.0.0](https://github.com/saturdaymp/BEMCheckBox/releases/tag/2.0.0) | .NET/net6.0-ios12.0 | +| [3.0.1](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/3.0.1) | [2.0.0](https://github.com/saturdaymp/BEMCheckBox/releases/tag/2.0.0) | .NET/net6.0-ios12.0 | +| [3.0.0](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/3.0.0) | [2.0.0](https://github.com/saturdaymp/BEMCheckBox/releases/tag/2.0.0) | .NET/net6.0-ios16.1 | +| [2.0.0](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/2.0.0) | [2.0.0](https://github.com/saturdaymp/BEMCheckBox/releases/tag/2.0.0) | Xamarin.iOS/xamarinios10 | +| [1.4.3](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/1.4.3) | [1.4.1](https://github.com/saturdaymp/BEMCheckBox/releases/tag/1.4.1) | Xamarin.iOS/xamarinios10 | +| [1.4.2](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/1.4.2) | [1.4.1](https://github.com/saturdaymp/BEMCheckBox/releases/tag/1.4.1) | Xamarin.iOS/xamarinios10 | +| [1.4.1](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/releases/tag/1.4.1) | [1.4.1](https://github.com/saturdaymp/BEMCheckBox/releases/tag/1.4.1) | Xamarin.iOS/xamarinios10 | + +If you spot any issues with the versioning table or a version combination you need is not listed, even unsupported versions, let me know by opening an [issue](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/issues). # Acknowledgements Thanks to [Boris Emorine](https://github.com/Boris-Em) for creating the BEMCheckBox. # Further Reading -## Microsoft Learning -[Walkthrough: Bind an iOS Swift library](https://learn.microsoft.com/en-ca/xamarin/ios/platform/binding-swift/walkthrough) -## Noise from the Basement -Today I Learned How to Create a Xamarin iOS Binding for Objective-C Libraries: +### Build the Xamarin lipo bundle (XPlugin 3.1.0 and earlier) + +**Microsoft Learning:** +[Walkthrough: Bind an iOS Swift library](https://learn.microsoft.com/xamarin/ios/platform/binding-swift/walkthrough) + +**Blog Posts:** * [Part 1](https://nftb.saturdaymp.com/today-i-learned-how-to-create-a-xamarin-ios-binding-for-objective-c-libraries-part-1-compiling-the-objective-c-library/) * [Part 2](https://nftb.saturdaymp.com/today-i-learned-how-to-create-a-xamarin-ios-binding-for-objective-c-libraries-part-2-combining-libraries/) * [Part 3](https://nftb.saturdaymp.com/today-i-learned-how-to-create-a-xamarin-ios-binding-for-objective-c-libraries-part-3-using-sharpie-to-create-binding-interface/) * [Part 4](https://nftb.saturdaymp.com/today-i-learned-how-to-create-a-xamarin-ios-binding-for-objective-c-libraries-part-4-the-actual-binding/) - -[Today I Learned How to Automate Objective-c Builds in TeamCity](https://nftb.saturdaymp.com/today-i-learned-how-to-automate-objective-c-builds-in-teamcity/) - -The above is bit outdated as the BEMCheckBox is now a Swift project but the overall steps are the same. +* [Today I Learned How to Automate Objective-C Builds in TeamCity](https://nftb.saturdaymp.com/today-i-learned-how-to-automate-objective-c-builds-in-teamcity/) \ No newline at end of file diff --git a/Source/SaturdayMP.XPlugins.iOS.BEMCheckBox.nuspec b/Source/SaturdayMP.XPlugins.iOS.BEMCheckBox.nuspec deleted file mode 100644 index 5cb9e44..0000000 --- a/Source/SaturdayMP.XPlugins.iOS.BEMCheckBox.nuspec +++ /dev/null @@ -1,21 +0,0 @@ - - - - SaturdayMP.XPlugins.iOS.BEMCheckBox - $version$ - XPlugins.iOS.BEMCheckBox - Saturday Morning Productions - LICENSE.txt - https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox - false - Use the excellent BEMCheckBox in Xamarin iOS applications. BEMCheckBox allows you to create beautiful, highly customizable, animated checkboxs for iOS. - docs\README.md - Copyright (c) 2023 Saturday Morning Productions Inc. - net6.0 net6.0-ios ios ios-binding bemcheckbox checkbox saturdaymp - - - - - - - \ No newline at end of file