Go to file
Joe Newton f84f66e307
Update swift-pacakge.yml
2021-10-22 13:17:56 -04:00
.github/workflows Update swift-pacakge.yml 2021-10-22 13:17:56 -04:00
Plists Modernized the project 2021-10-21 23:08:13 -04:00
Sources/SwiftyCast Modernized the project 2021-10-21 23:08:13 -04:00
SwiftyCast.xcodeproj Modernized the project 2021-10-21 23:08:13 -04:00
Tests Modernized the project 2021-10-21 23:08:13 -04:00
scripts Modernized the project 2021-10-21 23:08:13 -04:00
.gitignore Modernized the project 2021-10-21 23:08:13 -04:00
.swiftlint.yml Removed `implicit_return` SwiftLint rule 2021-10-22 10:23:29 -04:00
LICENSE Modernized the project 2021-10-21 23:08:13 -04:00
Package.swift Modernized the project 2021-10-21 23:08:13 -04:00
Package@swift-4.0.swift Restructured project to interop better with SwiftPM, added Package.swift files for Swift 4.0 & Swift 4.2, added Linux testing support, and added Github workflow 2020-02-28 15:18:49 -05:00
Package@swift-4.2.swift Restructured project to interop better with SwiftPM, added Package.swift files for Swift 4.0 & Swift 4.2, added Linux testing support, and added Github workflow 2020-02-28 15:18:49 -05:00
README.md Modernized the project 2021-10-21 23:08:13 -04:00
SwiftyCast.podspec Modernized the project 2021-10-21 23:08:13 -04:00
codecov.yml Modernized the project 2021-10-21 23:08:13 -04:00

README.md

SwiftyCast

Codacy Badge License MIT CocoaPods Compatible Carthage Compatible Platform Linux Code Coverage

Swift Package Xcode Project Cocoapods Carthage

SwiftyCast is a lightweight framework for easily casting objects to an from UnsafeRawPointer types for iOS, macOS, tvOS, and watchOS.

Installation

SwiftyCast is available through CocoaPods, Carthage and the Swift Package Manager.

To install via CocoaPods, simply add the following line to your Podfile:

pod 'SwiftyCast'

To install via Carthage, simply add the following line to your Cartfile:

github "SomeRandomiOSDev/SwiftyCast"

To install via the Swift Package Manager add the following line to your Package.swift file's dependencies:

.package(url: "https://github.com/SomeRandomiOSDev/SwiftyCast.git", from: "1.0.0")

Usage

First import SwiftyCast at the top of your Swift file:

import SwiftyCast

After importing, the use is as simple as calling one of four functions:

// For casting to or from a raw pointer
unsafeBridgingCast(_:) 

// For casting to a raw pointer while incrementing the retain count of the object
unsafeBridgingRetain(_:)

// For casting from a raw pointer while decrementing the retain count of the object
unsafeBridgingRelease(_:)

// For casting to or from a raw pointer but only in the context of a callback block
withUnsafeBridgingCast(_:body:)

Contributing

If you have need for a specific feature or you encounter a bug, please open an issue. If you extend the functionality of SwiftyCast yourself or you feel like fixing a bug yourself, please submit a pull request.

Author

Joe Newton, somerandomiosdev@gmail.com

License

SwiftyCast is available under the MIT license. See the LICENSE file for more info.