SwiftUI's Ultimate Companion for State Management, Routing, Dependency Injection, Storage, and Utilities!
ArctKit is a lightweight yet powerful framework that combines high-performance state management, intelligent dependency injection, route management, storage, and utility functions—all in one seamless package. Inspired by GetX from Flutter, ArctKit enhances SwiftUI development by making it more scalable, maintainable, and efficient.
- 🚀 High-Performance State Management – Simplify state handling in your SwiftUI apps.
- 🔗 Intelligent Dependency Injection – Register and retrieve dependencies effortlessly.
- 🛤 Route Management – Navigate between views with ease.
- 📦 Persistent Storage – Save and retrieve data using a simple API.
- 🛠 Powerful Utility Functions – Commonly needed utilities like validation, file detection, and more.
- 🏎 Blazing Fast & Lightweight – No unnecessary boilerplate, just efficient code.
Add ArctKit to your Package.swift:
.package(url: "/~https://github.com/k-arindam/ArctKit.git", from: "0.0.2")
Or add it via Xcode:
- Open your Xcode project.
- Go to File > Add Packages.
- Enter the URL:
/~https://github.com/k-arindam/ArctKit.git
. - Select the latest version and add it to your project.
import ArctKit
struct MyApp: App {
var body: some Scene {
let config = ArctAppConfig(
appGroup: "group.in.karindam.ArctKitDemo",
initialBindings: [
Constants.dataControllerKey: DataController()
],
initialRoute: AppRoutes.home,
routeBuilder: AppRoutes.builder
)
WindowGroup {
ArctApp(config: config)
}
}
}
// Register a service
do {
try Arct.put(AuthService(), with: "authService")
} catch {
print("Failed to register dependency: \(error)")
}
// Retrieve a service
let authService: AuthService? = try? Arct.find(with: "authService")
enum AppRoutes: ArctRoute {
case home
case settings
@ViewBuilder
static func builder(_ route: Self) -> some View {
switch route {
case .home:
HomeView()
case .settings:
SettingsView()
}
}
}
try? Arct.push(AppRoutes.settings)
// Save data
try Arct.write("John Doe", for: "username")
// Read data
let username: String? = try? Arct.read(String.self, for: "username")
For full documentation, visit here.
let isValidEmail = Arct.isEmail("test@example.com") // true
let isIPv4 = Arct.isIPv4("192.168.1.1") // true
We welcome contributions! Feel free to submit issues or pull requests.
ArctKit is available under the MIT License. See the LICENSE file for more details.
🚀 Supercharge your SwiftUI development with ArctKit today!