Skip to content

schatt/sixlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SixLayer Framework Repository

This repository contains the SixLayer Framework, a comprehensive SwiftUI framework implementing a six-layer architecture for cross-platform development.

๐Ÿ“ Repository Structure

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

๐Ÿš€ Getting Started

For Users (Consuming the Framework):

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")
]

For Developers (Contributing):

  • Framework Code: Framework/Sources/
  • Documentation: Framework/docs/
  • Project Status: Development/ROADMAP.md
  • Tests: Development/Tests/

๐Ÿ“ฆ Swift Package

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.

๐Ÿ†• Latest Release: v7.3.0

Convenience Aliases and Code Quality Improvements

๐Ÿ†• 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.

Previous Release: v7.2.0 - Configurable Photo Sources for OCR Scanner

๐Ÿ†• 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.

Previous Release: v7.1.0 - Color Resolution System from Hints Files

๐Ÿ†• 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.

Previous Release: v7.0.2 - Hints File Presentation Properties Support

๐Ÿ†• 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.

Previous Release: v7.0.1 - Hints File Color Configuration Support

๐Ÿ†• 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.

Previous Release: v7.0.0 - Breaking Changes

โš ๏ธ BREAKING CHANGE: 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.

Previous Release: v6.8.0 - DRY Improvements - Platform Switch Consolidation

๐Ÿ”ง 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.

Previous Release: v6.7.0 - Test Fixes & Count-Based Presentation

๐Ÿ†• 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.

Previous Release: v6.6.3 - ScrollView Wrapper Fixes

๐Ÿ”ง 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.

Previous Release: v6.6.2 - Swift 6 Compilation Fixes

๐Ÿ”ง 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.

Previous Release: v6.6.1 - SPM Bundle Name Fix

๐Ÿ”ง 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.

Previous Release: v6.6.0 - Platform Capability Detection Fixes

๐Ÿ”ง 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.

Previous Release: v6.5.0 - Swift 6 Compilation Fixes & Test Infrastructure

๐Ÿ”ง 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.

Previous Release: v6.4.2 - Platform Bottom-Bar Toolbar Placement Helper

๐Ÿ”ง 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.

Previous Release: v6.4.1 - NotificationService Bug Fix

๐Ÿ› Compilation Fix: Fixed optional Bool unwrapping in NotificationService.checkIOSDoNotDisturbStatusAsync() (Issue #124). Function now properly handles nil Focus status values with conservative default.

Previous Release: v6.4.0 - Design System Bridge & Developer Experience

๐ŸŽจ 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.

Previous Release: v6.1.1 - Color.named() Extensions

๐ŸŽจ 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().

Previous Release: v6.1.0 - Form UX Enhancements & Platform Extensions

๐Ÿ“ 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.

Previous Release: v6.0.0 - Intelligent Device-Aware Navigation & Cross-Platform Utilities

๐Ÿงญ 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.

Previous Release: v5.7.2 โ€“ Intelligent Decimal Correction & Enhanced Range Validation

๐Ÿ”ง 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.
โš ๏ธ Field adjustment tracking: 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.

Previous Release: v5.7.0 โ€“ Automatic OCR Hints & Structured Extraction Intelligence

๐Ÿ“„ 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.

Previous Release: v5.6.0 โ€“ Enhanced Layer 1 Functions & KeyboardType Extensions

๐ŸŽจ 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)
    }
)

๐Ÿ”— Quick Links

๐Ÿค– For AI Assistants

This framework has a specific architecture that requires careful understanding. Please read the AI Agent Guide first before attempting to help with this framework:

These guides contain critical information about the Layer 1 Semantic Intent philosophy, correct usage patterns, and common mistakes to avoid.

๐Ÿ“‹ Current Status

Version: v7.3.0 (Convenience Aliases and Code Quality Improvements) Phase: Minor Release Next: TBD

๐Ÿค Contributing

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.

About

Six Layer UI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •