Skip to content

db-in/fusion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fusion

Fusion

Version Swift Package Manager Compatible CocoaPods Compatible Platform iOS Pipeline codebeat badge Carthage Compatible

Description

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.

Features

⚙️ Core Module (FusionCore)

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

📱 UI Module (FusionUI)

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

Requirements

  • iOS 15.0+
  • macOS 12.0+
  • tvOS 15.0+
  • watchOS 9.0+
  • Swift 5.0+
  • Xcode 13.0+

Usage Examples

Storage & Keychain

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

Networking

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

Animations

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()

User Flow Management

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

Text Styling

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

Installation

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:

  1. File → Add Package Dependencies
  2. Enter: https://github.com/db-in/fusion.git
  3. 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 install

Using Carthage

Add to your Cartfile:

github "db-in/fusion" ~> 1.3.5

Then run:

carthage update

Module Structure

Fusion 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 framework

Documentation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

Fusion is available under the MIT license. See the LICENSE file for more info.

Author

Diney Bomfim

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages