Skip to content

Release 2.1.1

Choose a tag to compare

@anomaddev anomaddev released this 08 Oct 06:43
· 36 commits to main since this release

BoardingPassKit v2.1.1 Release Notes

Release Date: December 2024
IATA Compliance: Resolution 792 - BCBP Version 8 (Effective June 1, 2020) โœ…

๐ŸŽ‰ What's New in v2.1.1

This release combines the major improvements from v2.0.0 with critical bug fixes in v2.1.1, delivering the most robust and feature-rich version of BoardingPassKit yet.

โœจ New Configuration Options (from v2.0.0)

The BoardingPassDecoder now includes three powerful new configuration properties that give you complete control over how boarding pass data is processed:

let decoder = BoardingPassDecoder()

// NEW: All these properties are now available (all default to true)
decoder.trimLeadingZeroes = true        // Remove leading zeros from numeric fields
decoder.trimWhitespace = true          // Remove whitespace from string fields  
decoder.emptyStringIsNil = true        // Convert empty strings to nil for optional fields

๐Ÿ”ง Enhanced Data Processing (from v2.0.0)

1. Leading Zero Trimming (trimLeadingZeroes)

  • Before: Flight numbers like "00234" remained "00234"
  • After: Automatically cleaned to "234" for better readability
  • Affects: Flight numbers, seat numbers, issue dates, and other numeric fields

2. Whitespace Management (trimWhitespace)

  • Before: Fields like " ABC " remained " ABC "
  • After: Automatically trimmed to "ABC" for cleaner data
  • Affects: All string fields throughout the boarding pass

3. Empty String Handling (emptyStringIsNil)

  • Before: Empty strings "" remained as empty strings
  • After: Converted to nil for better Swift integration
  • Affects: Optional fields like passenger description, check-in source, bag tags

๐Ÿ“Š Improved Data Quality Examples (from v2.0.0)

// v1.0 behavior vs v2.1.1 behavior (with defaults)

// Flight Number
"00234" โ†’ "00234" (v1.0) vs "234" (v2.1.1)

// Passenger Description  
"  M  " โ†’ "  M  " (v1.0) vs "M" (v2.1.1)

// Optional Fields
"" โ†’ "" (v1.0) vs nil (v2.1.1)

// Bag Tags Array
["ABC123", "", "DEF456"] โ†’ ["ABC123", "", "DEF456"] (v1.0) vs ["ABC123", "DEF456"] (v2.1.1)

๐ŸŽฏ Better Swift Integration (from v2.0.0)

The new emptyStringIsNil option makes working with optional fields much more natural:

// v2.1.1 makes this cleaner and more Swift-like
if let description = boardingPass.passInfo.passengerDescription {
    // Handle valid description
} else {
    // Handle missing description - no need to check for empty strings
}

// v1.0 required checking for both nil and empty strings
if let description = boardingPass.passInfo.passengerDescription, !description.isEmpty {
    // Handle valid description
}

๐Ÿ› Bug Fixes

v2.1.1 Fixes

  • Fixed "0000" integer parsing issue: Resolved a critical bug where boarding pass fields containing "0000" would fail to parse correctly. The readint() function now properly handles fields with all zeros, ensuring consistent parsing across all boarding pass formats.

v2.0.0 Fixes

  • Fixed inconsistent string processing across different field types
  • Improved handling of empty optional fields
  • Enhanced error messages for better debugging
  • Better validation of conditional field parsing

๐Ÿ—๏ธ Technical Improvements

Enhanced Parsing Logic

  • More consistent string processing across all fields
  • Improved handling of optional and conditional fields
  • Better integration with Swift's optional system
  • NEW: Robust handling of "0000" and similar edge cases

Improved Error Handling

  • Enhanced debugging output with new configuration options
  • More detailed error messages for parsing failures
  • Better validation of field processing

Code Quality

  • Cleaner, more maintainable parsing logic
  • Better separation of concerns
  • Improved test coverage

๐Ÿ”„ Migration Guide

โœ… Backward Compatibility

Great news! This update is 100% backward compatible. Your existing code will continue to work without any changes.

๐ŸŽ›๏ธ For Most Users: No Action Required

The new features are enabled by default and will improve your data quality automatically:

let decoder = BoardingPassDecoder()
// All new features are enabled by default
// Your existing code works exactly as before

๐Ÿ”ง For Advanced Users: Custom Configuration

If you need to preserve the exact original formatting from v1.0, you can disable the new features:

let decoder = BoardingPassDecoder()

// Disable new data processing features to match v1.0 behavior
decoder.trimLeadingZeroes = false
decoder.trimWhitespace = false  
decoder.emptyStringIsNil = false

๐Ÿ“‹ Use Case Recommendations

For User-Facing Applications (Recommended):

let decoder = BoardingPassDecoder()
// Use defaults for clean, user-friendly data

For Data Analysis/Debugging:

let decoder = BoardingPassDecoder()
decoder.trimWhitespace = false
decoder.trimLeadingZeroes = false
// Preserves original field formatting for analysis

๐Ÿ“š Documentation Updates

  • Comprehensive Migration Guide - Step-by-step upgrade instructions
  • Configuration Examples - Real-world usage scenarios
  • Best Practices - Recommendations for different use cases
  • API Reference - Updated documentation for new properties
  • Version 2.1.1 Details - Latest bug fix information

๐Ÿ”ง Requirements

  • iOS: 15.0+
  • macOS: 10.15+
  • Swift: 5.7+
  • Xcode: 14.0+

๐Ÿ“ฆ Installation

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/anomaddev/BoardingPassKit.git", from: "2.1.1")
]

CocoaPods

pod 'BoardingPassParser', '~> 2.1.1'

๐Ÿงช Testing

The library includes comprehensive test coverage for:

  • All new configuration options
  • Backward compatibility scenarios
  • Edge cases and error conditions
  • Multi-leg boarding passes
  • Various airline formats
  • NEW: "0000" and similar edge case parsing

Run tests with:

swift test

๐Ÿ“ˆ Performance

  • No performance impact from new features
  • Optimized string processing logic
  • Improved memory efficiency for optional field handling
  • Enhanced: More robust parsing with better error recovery

๐Ÿ”ฎ What's Next

This release sets the foundation for future enhancements:

  • Enhanced validation capabilities
  • Additional configuration options
  • Improved multi-language support
  • Extended airline-specific parsing

๐Ÿ™ Acknowledgments

Special thanks to the community for feedback and testing that helped shape this release, including reports of the "0000" parsing issue that led to the v2.1.1 fix.


Full Changelog: v1.2.0...v2.1.1

Documentation: https://github.com/anomaddev/BoardingPassKit#readme

IATA Compliance: https://github.com/anomaddev/BoardingPassKit/blob/main/IATA_COMPLIANCE.md

Previous Version: v1.2.0