How fellowgeek/enclose works
Main Components
• Native iOS Module:
• Located in the iOS-Swift folder.
• Native macOS Module:
• Located in the MacOS-Swift folder.
• Contains components such as AppDelegate.swift, ViewController.swift, Main.storyboard (in Base.lproj), info.plist, and an assets folder.
• Web Asset Layer:
• Both the iOS-Swift and MacOS-Swift folders contain a “www” directory.
• This directory contains HTML files (index.html, display.html), CSS (styles.css), JavaScript files (application.js, enClose.js), and additional image assets.
• Development and Build Infrastructure:
• Xcode project files (e.g., enClose.xcodeproj for both platforms) indicate that Xcode is used as the IDE and build tool.
• Configuration files (Info.plist, entitlements, project.pbxproj) are essential to the project setup.
Relationships and Interactions
• Platform-specific Native Layers:
• Each platform module (iOS and macOS) encapsulates native initialization (AppDelegate, SceneDelegate on iOS) and view controllers that likely instantiate and display web content.
• Typically, a WKWebView or similar component is used by these controllers to load content from the corresponding "www" folder.
• Web-to-Native Interaction:
• The framework’s core concept is to allow JavaScript code in the web layer to call native Swift functions. This bidirectional bridge should be a prominent part of the design.
• Native-to-Web Interaction:
Architectural Patterns and Design Principles
• Hybrid Application Architecture:
• Separation of concerns between the native UI layer and the web-based presentation/logic layer is critical.
• Bridge mechanism that allows these two layers to interact seamlessly.
• Modularity by Platform:
• Flexibility:
• As noted in the README, enClose is designed to remove restrictions by not confining developers to predefined APIs/plugins. Capture this flexibility by highlighting the open communication channels between layers.