This repository contains the SixLayer Framework, a comprehensive SwiftUI framework implementing a six-layer architecture for cross-platform development.
6layer/
โโโ Framework/ โ **This is the Swift Package**
โ โโโ Sources/ โ Framework source code
โ โโโ Package.swift โ Package definition
โ โโโ README.md โ Framework documentation
โ โโโ Stubs/ โ Framework stubs
โโโ Development/ โ Development files (not in package)
โโโ ROADMAP.md โ Project roadmap
โโโ PROJECT_STATUS.md โ Current status
โโโ Tests/ โ Test suite
โโโ docs/ โ Technical documentation
โโโ Examples/ โ Usage examples
Navigate to the Framework/ directory and use it as a Swift Package:
// In your Package.swift
dependencies: [
.package(url: "https://github.com/schatt/sixlayer.git", from: "7.3.0")
]- Framework Code:
Framework/Sources/ - Documentation:
Framework/docs/ - Project Status:
Development/ROADMAP.md - Tests:
Development/Tests/
The framework is distributed as a Swift Package from the Framework/ directory. This ensures that only the essential framework code is included when other projects consume it.
๐ Platform Container Stack Aliases: Added shorter convenience aliases platformVStack, platformHStack, and platformZStack for more intuitive API names. Refactored iCloud availability checks for improved code clarity.
๐ FieldActionOCRScanner Enhancement: Added configurable photo source options. Developers can now choose whether to offer camera, photo library, or both options to end users, with automatic device capability detection and graceful fallbacks.
๐ ItemBadge and ItemIcon Components: New components that automatically resolve colors from hints files. Supports colorName and fileExtension provider types. Card components now support optional badge content.
๐ Presentation Properties in Hints Files: Added support for _dataType, _complexity, _context, _customPreferences, and _presentationPreference in .hints files. All PresentationHints properties can now be configured declaratively in hints files, matching code-based functionality.
๐ Color Configuration in Hints Files: Added support for _defaultColor and _colorMapping in .hints files. Color configuration can now be stored in hints files and automatically loaded when creating PresentationHints from model names.
CardDisplayable protocol no longer includes cardColor property. Color configuration is now done via PresentationHints at the presentation layer. Models are now SwiftUI-free and can be used in Intent extensions.
๐ PresentationHints Color Configuration: Added type-based color mapping, per-item color provider, and default color support. Color decisions are now made at the presentation layer, following 6-layer architecture principles.
๐ง PlatformStrategy Module: Consolidated 19 platform switch statements into a centralized PlatformStrategy module. Eliminated 4 duplicate functions. Total: 23 code duplications eliminated. Single source of truth for platform-specific simple values.
๐ Runtime Check Pattern Consistency: Established consistent pattern for runtime capability checks in PlatformStrategy. Ensures platform-specific values are only returned when capabilities are actually available.
๐ Count-Based Automatic Presentation: Added intelligent count-aware presentation strategy selection. .automatic presentation preference now considers item count for generic/collection content, with platform-aware thresholds. Added .countBased(lowCount:highCount:threshold:) enum case for explicit control.
๐ง Touch Target Test Fixes: Fixed touch target minimum tests to correctly validate Apple HIG compliance. Tests now correctly expect 44.0 minimum touch target when touch is enabled, with tolerance-based floating point comparison.
๐งช Test Infrastructure Improvements: Added frame size safety checks, fixed resource warnings in Swift Package Manager builds, removed platform mocking code from tests, and cleaned up test warnings.
๐ง Collection View Scrolling: Fixed missing ScrollView wrappers in all collection views. GridCollectionView, ListCollectionView, ExpandableCardCollectionView, and MasonryCollectionView now properly scroll when content exceeds view bounds, maintaining the framework's abstraction layer.
๐ง Swift 6 Compatibility: Fixed Swift 6 compilation errors and deprecation warnings. Includes main actor isolation fixes, iOS 17+ API updates, switch exhaustiveness fixes, and removal of unnecessary availability checks.
๐ง Bundle Resource Access: Fixed Swift Package Manager bundle name issue. Updated to use Bundle.module for Swift Package builds with proper fallback for Xcode framework builds. Fixed CFBundleName in Info.plist.
๐ง Apple HIG Compliance: Fixed platform capability detection to align with Apple Human Interface Guidelines. minTouchTarget is now platform-based (44.0 for iOS/watchOS, 0.0 for others), supportsAssistiveTouch correctly checks platform availability, and tests use runtime platform detection for better accuracy.
๐ง Swift 6 Compatibility: Fixed all compilation errors and actor isolation issues for full Swift 6 compatibility. Includes fixes for CloudKitService, test kit examples, and design system tests. Test infrastructure improved with proper async setup/teardown and actor isolation.
๐ง Cross-Platform Toolbar Placement: Added platformBottomBarPlacement() function for bottom-aligned toolbar items. Returns .bottomBar on iOS and .automatic on macOS/other platforms. Resolves Issue #125.
๐ Compilation Fix: Fixed optional Bool unwrapping in NotificationService.checkIOSDoNotDisturbStatusAsync() (Issue #124). Function now properly handles nil Focus status values with conservative default.
๐จ Design System Bridge: Framework-level abstraction for mapping external design tokens to SixLayer components with theme injection.
๐งช SixLayerTestKit: Comprehensive testing utilities for framework consumers with service mocks and test helpers.
๐ Sample Applications: Canonical TaskManager sample app demonstrating proper SixLayer architecture patterns.
๐ Localization Improvements: .xcstrings support and localization completeness checking.
๐ง Developer Experience: Stable extension surface and migration tooling.
๐จ Color API improvements: Extended Color.named() to support systemBackground and other commonly used color names (cardBackground, label, secondaryLabel, tertiaryLabel, separator).
๐ง Convenience method: Added Color.named(_:default:) that returns a non-optional Color with a fallback, preventing compiler type-checking issues.
๐ Bug fixes: Resolved compiler type-checking timeouts when chaining multiple optionals with Color.named().
๐ Form improvements: Collapsible sections, required field indicators, character counters, validation summary, Stepper field type, and Link component for URLs.
๐ OCR enhancements: Batch OCR workflow for filling multiple fields from single scan, declarative field hints with Mirror fallback.
๐จ UI enhancements: Semantic background colors via Color.named(), barcode scanning support.
๐ ๏ธ Platform extensions: Sidebar pull indicator, container extensions, list toolbar extension, animation system extensions, string sanitization function.
๐งญ Intelligent navigation: Device-aware app navigation with automatic pattern selection (NavigationSplitView vs detail-only).
๐จ๏ธ Cross-platform printing: Unified printing API supporting text, images, PDFs, and SwiftUI views.
๐ File system utilities: Comprehensive file system utilities with iCloud Drive support.
๐ง Toolbar placement: Platform-specific toolbar placement helpers for cross-platform apps.
๐ HIG-compliant spacing: Refactored spacing system aligned with macOS HIG 8pt grid guidelines.
โฟ Accessibility: Automatic accessibility identifiers and full VoiceOver support.
๐งช Comprehensive testing: Full test coverage for all new features.
๐ Complete documentation: Full guides with usage examples and best practices.
๐ง Intelligent decimal correction: Automatically corrects missing decimal points using expected ranges and calculation groups as heuristics.
๐ Range inference: Infers ranges from calculation groups for fields without explicit ranges.
OCRResult.adjustedFields tracks which fields were adjusted or calculated for user verification.
๐ Enhanced range validation: Expected ranges are now guidelines (not hard requirements) - out-of-range values are kept but flagged.
๐ Field averages: Apps can provide typical/average values to flag unusual values even within range.
๐ Bidirectional pattern matching: Handles both "Gallons 9.022" and "9.022 Gallons" patterns.
๐งช Comprehensive testing: Range validation tests cover boundaries, precedence, and edge cases.
๐ Configurable entity mapping: OCRContext now accepts entityName so projects choose which .hints file to load.
๐ค Automatic hints loading: OCRService loads {entityName}.hints, converts ocrHints to regex patterns, and merges them with built-in/custom hints.
๐งฎ Calculation group evaluation: Structured extraction automatically derives missing values (e.g., price-per-gallon) using hint-defined formulas.
๐จ Custom View Support: Layer 1 functions gained optional custom view wrappers while preserving framework benefits.
โจ๏ธ KeyboardType Extensions: Cross-platform View extension for all 11 keyboard types with proper platform mappings.
๐งช Comprehensive Testing: 32+ new tests covering custom view usage and keyboard behaviors.
Highlights:
- โ Complete TDD Implementation - Strict Test-Driven Development throughout
- โ Advanced Accessibility System - Automatic identifier generation for all components
- โ 800+ Comprehensive Tests - Full platform coverage with behavioral verification
- โ Apple HIG Compliance - Complete compliance with Human Interface Guidelines
- โ Platform Capability Detection - Accurate runtime detection for all platforms
- โ Component Architecture - All components support automatic accessibility
- โ Testing Infrastructure - Suite organization with Xcode test navigator integration
- โ Cross-Platform Validation - Enhanced testing across iOS, macOS, visionOS
See Field Hints Complete Guide for full documentation
Example:
platformPresentItemCollection_L1(
items: products,
hints: hints,
customItemView: { product in
MyCustomProductView(product: product)
}
)- Framework README - Complete framework documentation
- Project Status - Current development status
- Roadmap - Development phases and progress
- Documentation - Technical implementation details
- Release Notes v4.1.3 - Fix Critical Automatic Accessibility Identifier Bug
- OCR Overlay Guide - Interactive visual text correction
This framework has a specific architecture that requires careful understanding. Please read the AI Agent Guide first before attempting to help with this framework:
- AI_AGENT Guide - Complete guide with version-specific links
- Latest Features - Automatic Accessibility Identifiers Fix for Layers 2-6
- All AI Agent Files - Complete history of version-specific guides
These guides contain critical information about the Layer 1 Semantic Intent philosophy, correct usage patterns, and common mistakes to avoid.
Version: v7.3.0 (Convenience Aliases and Code Quality Improvements) Phase: Minor Release Next: TBD
Please read the development documentation in the Development/ directory before contributing. The framework follows a strict six-layer architecture pattern.
Note: This repository structure separates framework code from development files, ensuring clean package distribution while maintaining development transparency.