Swiftpack.co -  SomeRandomiOSDev/SwiftyCast as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Easy Object to UnsafeRawPointer Casting in Swift
.package(url: "https://github.com/SomeRandomiOSDev/SwiftyCast.git", from: "1.0.2")


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

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


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")


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

// For casting to a raw pointer while incrementing the retain count of the object

// For casting from a raw pointer while decrementing the retain count of the object

// For casting to or from a raw pointer but only in the context of a callback block


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.


Joseph Newton, somerandomiosdev@gmail.com


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


Stars: 1
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API