A Swift wrapper for libmagic
swift-magic is a Swift interface to the libmagic file type
identification library. libmagic identifies file types by checking
their headers according to a predefined list of file types. This
functionality is exposed to the command line by the Unix command
file
.
import Magic
let description = try Magic.shared.file(path)
swift-magic is written in Swift 4.2. Compatible with iOS 8.0+
swift-magic is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'swift-magic'
For Carthage, add the following to your Cartfile
:
github "kishikawakatsumi/swift-magic"
Kishikawa Katsumi, kishikawakatsumi@mac.com
swift-magic is available under the BSD license. See the LICENSE file for more info.