Contributions to ClampedPropertyWrapper are most welcome. Check out some of the issue templates for more info.
💻 Developing
Requirements
Xcode 12.5+ (Recommended)
📜 Generating Documentation
Documentation is generated by Swift Doc. Installation instructions can be found here, and as soon as you have it set up, docs can be generated simply by running ./Scripts/generate-html-docs.zsh from the command line.
📝 Note that this will only generate a .build/documentation folder for you to view locally. This folder is being ignored by git, and a GitHub action exists to automatically generate docs at the root level and serve them on the project’s gh-pages branch.
🏷 License
ClampedPropertyWrapper is available under the MIT license. See the LICENSE file for more info.
Clamped: A Swift Property Wrapper
A Swift Property Wrapper for automatically clamping Comparable values to closed or partial ranges.
Features
Comparabletype to aClosedRangeor a “Half-Open” range.FloatingPointproperties with aPartialRangeThrough,PartialRangeFrom, orPartialRangeUpToexpression.FloatingPointorFixedWidthIntegerproperties with exclusive lower and upper bounds.Installation
Xcode Projects
Select
File->Swift Packages->Add Package Dependencyand enterhttps://github.com/CypherPoet/ClampedPropertyWrapper.Swift Package Manager Projects
You can add
ClampedPropertyWrapperas a package dependency in yourPackage.swiftfile:From there, refer to
ClampedPropertyWrapperas a “target dependency” in any of your package’s targets that need it.Then simply
import ClampedPropertyWrapperwherever you’d like to use it.Usage
Basic Example:
You can also take things further in this project’s Xcode Playground:
Contributing
Contributions to
ClampedPropertyWrapperare most welcome. Check out some of the issue templates for more info.💻 Developing
Requirements
📜 Generating Documentation
Documentation is generated by Swift Doc. Installation instructions can be found here, and as soon as you have it set up, docs can be generated simply by running
./Scripts/generate-html-docs.zshfrom the command line.📝 Note that this will only generate a
.build/documentationfolder for you to view locally. This folder is being ignored bygit, and a GitHub action exists to automatically generate docs at the root level and serve them on the project’sgh-pagesbranch.🏷 License
ClampedPropertyWrapperis available under the MIT license. See the LICENSE file for more info.