44[ ![ GitHub license] ( https://img.shields.io/badge/license-MIT-lightgrey.svg )] ( https://raw.githubusercontent.com/tsolomko/BitByteData/master/LICENSE )
55[ ![ Build Status] ( https://travis-ci.org/tsolomko/BitByteData.svg?branch=develop )] ( https://travis-ci.org/tsolomko/BitByteData )
66
7- A Swift framework with classes for reading and writing bytes and bits .
7+ A Swift framework with classes for reading and writing bits and bytes .
88
99## Installation
1010
11- Right now only Swift Package manager is supported.
12- (Carthage and CocoaPods will be available at the 1.0 release).
11+ BitByteData can be integrated into your project using Swift Package Manager, CocoaPods or Carthage.
12+
13+ ### Swift Package Manager
14+
1315To install using SPM, add BitByteData to you package dependencies
1416and specify it as a dependency for your target, e.g.:
1517
@@ -33,9 +35,34 @@ let package = Package(
3335
3436More details you can find in [ Swift Package Manager's Documentation] ( https://github.com/apple/swift-package-manager/tree/master/Documentation ) .
3537
38+ ### CocoaPods
39+
40+ Add ` pod 'BitByteData', '~> 1.0' ` and ` use_frameworks! ` lines to your Podfile.
41+
42+ To complete installation, run ` pod install ` .
43+
44+ ### Carthage
45+
46+ Add to your Cartfile ` github "tsolomko/BitByteData" ~> 1.0 ` .
47+
48+ Then run ` carthage update ` .
49+
50+ Finally, drag and drop ` BitByteData.framework ` from ` Carthage/Build ` folder
51+ into the "Embedded Binaries" section on your targets' "General" tab in Xcode.
52+
3653## Usage
3754
38- TBD.
55+ Use ` ByteReader ` class to read bytes.
56+ For reading bits there are two classes: ` LsbBitReader ` and ` MsbBitReader ` , which implement ` BitReader ` protocol
57+ for two bit-numbering schemes ("LSB 0" and "MSB 0" correspondingly).
58+ Both ` LsbBitReader ` and ` MsbBitReader ` classes inherit from ` ByteReader ` so you can also use them to read bytes
59+ (but they must be aligned, see documentation for more details).
60+
61+ Writing bits is implemented in two classes ` LsbBitWriter ` and ` MsbBitWriter ` (again, for two bit-numbering schemes).
62+ They both conform to ` BitWriter ` protocol.
63+
64+ __ Note:__ All readers and writers aren't structs, but classes intentionally.
65+ This is done to make it easier to pass them as arguments to functions and to eliminate unnecessary copying and ` inout ` s.
3966
4067## Documentation
4168
@@ -48,3 +75,6 @@ Whether you find a bug, have a suggestion, idea or something else,
4875please [ create an issue] ( https://github.com/tsolomko/BitByteData/issues ) on GitHub.
4976
5077If you'd like to contribute code, please [ create a pull request] ( https://github.com/tsolomko/BitByteData/pulls ) on GitHub.
78+
79+ __ Note:__ If you are considering working on BitByteData, please note that Xcode project (BitByteData.xcodeproj)
80+ was created manually and you shouldn't use ` swift package generate-xcodeproj ` command.
0 commit comments