- Swift 5.2 is no longer supported.
- Enable visionOS deployment target (except for SPM).
- Add PrivacyInfo file.
- There are now minimum deployment targets specified in Swift Package Manager manifest.
- Swift 5.0 and 5.1 are no longer supported.
- Increased minimum deployment versions (when installed via CocoaPods or Carthage) for Darwin platforms: macOS from 10.10 to 10.13, iOS from 9.0 to 11.0, tvOS from 9.0 to 11.0, and watchOS from 2.0 to 4.0.
- Added an explicit precondition on
bitsCount
argument in the default implementation of theBitWriter.write(signedNumber:bitsCount:representation:)
function. - Added missing documentation about a precondition in
L/MsbBitWriter.write(unsignedNumber:bitsCount:)
.
- Swift 4.2 is no longer supported.
- Minimum iOS deployment version (when installed via CocoaPods or Carthage) is now 9.0.
- Renamed the
ByteReader
class toLittleEndianByteReader
. LittleEndianByteReader
(ex-ByteReader
) is now a final class.LsbBitReader
andMsbBitReader
are no longer its subclasses.
- Added a new
BigEndianByteReader
class with the same set of APIs asLittleEndianByteReader
. - Added a
ByteReader
protocol which inheritsAnyObject
.- Most of the methods and properties of the previously existing
ByteReader
class are now requirements of the new protocol. ByteReader
provides default implementations for the initializer, which implements conversion from aBitReader
, and for thebytesLeft
,bytesRead
, andisFinished
properties (all of these are not protocol requirements).ByteReader
provides a default implementation for theint(fromBytes:)
method.- Both
LittleEndianByteReader
andBigEndianByteReader
now conform to theByteReader
protocol.
- Most of the methods and properties of the previously existing
- Added a
SignedNumberRepresentation
enum with five cases and two instance methods. - The
BitReader
protocol now inherits theByteReader
protocol.- Two new method requirements have been added to the
BitReader
protocol:signedInt(fromBits:representation:)
andadvance(by:)
. BitReader
now provides a default implementation forint(fromBits:)
.
- Two new method requirements have been added to the
- It is no longer possible to set the
offset
property of theLsbBitReader
andMsbBitReader
classes if they are not aligned (a precondition crash occurs instead). - The
signedInt(fromBits:representation:)
function has been added to theLsbBitReader
andMsbBitReader
classes with the default value ofSignedNumberRepresentation.twoComplementNegatives
for therepresentation
argument. - Two new method requirements have been added to the
BitWriter
protocol:write(unsignedNumber:bitsCount:)
andwrite(signedNumber:bitsCount:representation:)
. BitWriter
now provides default implementations forwrite(signedNumber:bitsCount:representation:)
andwrite(number:bitsCount:)
.- The default implementation of the
write(number:bitsCount:)
function now has a precondition crash if thebitsCount
argument exceeds the bit width of the integer type on the current platform.
- The default implementation of the
- The
write(unsignedNumber:bitsCount:)
function of theLsbBitWriter
andMsbBitWriter
classes now has a precondition crash if thebitsCount
argument exceeds the bit width of the integer type on the current platform. - Documentation has been updated.
- Added documentation for new APIs.
- A couple of missing precondition checks are now properly documented.
- Existing documentation has been made more concise and slightly more grammatically correct.
- Fixed a compilation warning about "deprecated class keyword" appearing when using Swift 5.4.
- Fixed incompatibility with Swift Package Manager from Swift 4.2.
- Improved compatibility with the latest versions of Swift (5.x) and Xcode.
- Reverted performance improvements of 1.4.0 update due to their incompatibility with Swift 5.0.
- Significantly improved performance of
ByteReader
,LsbBitReader
andMsbBitReader
.
- Improved performance of
ByteReader
's functions and properties when compiled with Swift 4.2 compiler.
- Updated to support Swift 4.2.
- Added
advance(by:)
function to bothLsbBitReader
andMsbBitReader
. - Added
write(unsignedNumber:bitsCount:)
function to bothLsbBitWriter
andMsbBitWriter
(PR #1 by @cowgp).
- Updated to support Swift 4.1.
- Added
bytesLeft
andbytesRead
computed properties toByteReader
. - Added
int(fromBytes:)
,uint16(fromBytes:)
,uint32(fromBytes:)
, anduint64(fromBytes:)
functions to all readers. - Added
byte(fromBits:)
,uint16(fromBits:)
,uint32(fromBits:)
, anduint64(fromBits:)
functions toLsbBitReader
andMsbBitReader
, as well asBitReader
protocol. int(fromBits:)
function now has a precondition that its argument doesn't exceedInt
bit width.- Reverted "disable symbol stripping" change from 1.1.1 update, since underlying problem in Carthage was fixed.
- Minor updates to documentation.
- Added missing documentation for
bitsLeft
andbitsRead
computed properties. - Disabled symbol stripping in archives generated by Carthage and published on GitHub Releases.
- Added converting from
ByteReader
initializers toLsbBitReader
andMsbBitReader
, as well asBitReader
protocol. - Added
bitsLeft
andbitsRead
computed properties toLsbBitReader
andMsbBitReader
, as well asBitReader
protocol.
- Fixed several problems causing incorrect preconditions failures.
- Improved performance of
bit()
,bits(count:)
andint(fromBits:)
functions for bothLsbBitReader
andMsbBitReader
. - More consistent behaviour (precondition failures) for situtations when there is not enough data left.
- Small updates to documentation.
ByteReader
class for reading bytes.BitReader
protocol,LsbBitReader
andMsbBitReader
classes for reading bits (and bytes).BitWriter
protocol,LsbBitWriter
andMsbBitWriter
classes for writing bits (and bytes).