Fusion is a comprehensive Swift framework that provides essential utilities and tools for iOS, macOS, tvOS, and watchOS development. It offers a modular architecture with two main components: FusionCore for fundamental functionality and FusionUI for user interface enhancements.
Storage & Data Management
- Keychain Integration - Secure storage for sensitive data
- Multiple Storage Backends - UserDefaults, FileManager, and in-memory storage
- Data Binding - Reactive data management with automatic updates
- In-Memory Caching - High-performance temporary data storage
- Thread-Safe Operations - Concurrent access protection
Networking & Communication
- REST API Client - Complete HTTP client with authentication
- Request/Response Handling - Type-safe networking with Codable support
- Cookie Management - HTTP cookie handling and persistence
- Encryption Utilities - Data encryption and security helpers
- Request Logging - Comprehensive network request logging
Utilities & Helpers
- Timer Control - High-performance timer management with background handling
- Async Operations - Advanced asynchronous operation management
- Text Processing - Rich text manipulation and styling
- Mathematical Functions - Extended math utilities and trigonometry
- Localization Support - Multi-language text handling
- Local Notifications - User notification management
Animation & Effects
- Tween Animations - Smooth property animations with easing functions
- Easing Functions - Multiple animation curves (linear, ease-in, ease-out, etc.)
- View Transitions - Custom view transition effects
User Interface Controls
- User Flow Management - Navigation and presentation flow control
- Control Actions - Unified action handling for UI controls
- View Hierarchy Utilities - Advanced view manipulation and traversal
- Haptic Feedback - Tactile feedback integration
- Scroll View Extensions - Enhanced scroll view functionality
Styling & Theming
- Color Management - Advanced color utilities and theming
- Font Handling - Dynamic font management and styling
- Gradient Views - Custom gradient view components
- Image Processing - Image loading, caching, and manipulation
- SwiftUI Integration - SwiftUI modifiers and style extensions
- Geometric Shapes - Custom shape drawing utilities
- iOS 15.0+
- macOS 12.0+
- tvOS 15.0+
- watchOS 9.0+
- Swift 5.0+
- Xcode 13.0+
import Fusion
// Secure keychain storage
let keychain = Keychain()
keychain["userToken"] = "abc123".data(using: .utf8)
let token = keychain["userToken"]
// Multiple storage backends
UserDefaults.shared.set("value", forKey: "key")
FileManager.shared.set(model, forKey: "model.json")
StateStorage.shared.set(temporaryData, forKey: "temp")import Fusion
// REST API requests
let request = RESTBuilder<UserModel>(url: "https://api.example.com/users", method: .get)
request.execute { result, response in
switch result {
case .success(let user):
print("User: \(user)")
case .failure(let error):
print("Error: \(error)")
}
}
// With authentication
let authRequest = RESTBuilder<UserModel>(url: "https://api.example.com/profile", method: .get)
.authenticated()
.headers(["Custom-Header": "value"])import Fusion
// Tween animations
let view = UIView()
let tween = Tween(view, duration: 1.0)
.to(\.alpha, 0.0)
.to(\.transform, CGAffineTransform(scaleX: 0.5, y: 0.5))
.ease(.easeInOut)
.onComplete { print("Animation finished") }
.start()import Fusion
// Define user flows
let loginFlow = UserFlow("Login", bundle: .main)
let profileFlow = UserFlow { _ in ProfileViewController() }
// Present flows
loginFlow.startAsModal(withNavigation: true)
profileFlow.startAsPush()
// With hooks
let flow = UserFlow("Main", bundle: .main, hooks: [
UserFlowHook(.userDidLogin, style: .push)
])import Fusion
// Rich text styling
let text = "Hello World"
.styled([.foregroundColor: UIColor.blue])
.styled([.font: UIFont.boldSystemFont(ofSize: 18)], onText: "World")
// HTML styling
let htmlText = "This is <b>bold</b> and <i>italic</i>"
.styledHTML([
"b": [.font: UIFont.boldSystemFont(ofSize: 16)],
"i": [.obliqueness: 0.3]
])Using Swift Package Manager (Recommended)
Add the following to your Package.swift file:
dependencies: [
.package(url: "https://github.com/db-in/fusion.git", from: "1.3.5")
]Or add it through Xcode:
- File → Add Package Dependencies
- Enter:
https://github.com/db-in/fusion.git - Select version 1.3.5 or later
Using CocoaPods
Add to your Podfile:
# Full framework
pod 'Fusion'
# Or install specific modules
pod 'Fusion/Core' # Core functionality only
pod 'Fusion/UI' # UI components (includes Core)Then run:
pod installUsing Carthage
Add to your Cartfile:
github "db-in/fusion" ~> 1.3.5
Then run:
carthage updateFusion is organized into modular components:
- FusionCore: Essential utilities, networking, storage, and data management
- FusionUI: User interface components, animations, and styling utilities
- Fusion: Complete framework (includes both Core and UI)
You can import specific modules based on your needs:
import FusionCore // Core functionality only
import FusionUI // UI components (automatically includes Core)
import Fusion // Complete frameworkContributions are welcome! Please feel free to submit a Pull Request.
Fusion is available under the MIT license. See the LICENSE file for more info.
Diney Bomfim
- GitHub: @dineybomfim
