Repository navigation
Release 2.1.1
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
nilfor 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 dataFor 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