Skip to content

Commit a5740e4

Browse files
committed
Finish readme
1 parent 1e374b5 commit a5740e4

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

BitByteData.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ Pod::Spec.new do |s|
22

33
s.name = "BitByteData"
44
s.version = "1.0.0-test.3"
5-
s.summary = "Read and write bits and bytes from data consequently in Swift."
5+
s.summary = "Read and write bits and bytes in Swift."
66

7-
s.description = "A Swift framework with functions for reading and writing bytes and bits."
7+
s.description = "A Swift framework with classes for reading and writing bits and bytes."
88

99
s.homepage = "https://github.com/tsolomko/BitByteData"
1010
s.documentation_url = "http://tsolomko.github.io/BitByteData"

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
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+
1315
To install using SPM, add BitByteData to you package dependencies
1416
and specify it as a dependency for your target, e.g.:
1517

@@ -33,9 +35,34 @@ let package = Package(
3335

3436
More 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,
4875
please [create an issue](https://github.com/tsolomko/BitByteData/issues) on GitHub.
4976

5077
If 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

Comments
 (0)