https://github.com/k-arindam/arctkit
ArctKit swift package
https://github.com/k-arindam/arctkit
apple arctkit ios macos mvc swift swift-package swiftui
Last synced: 18 days ago
JSON representation
ArctKit swift package
- Host: GitHub
- URL: https://github.com/k-arindam/arctkit
- Owner: k-arindam
- License: mit
- Created: 2025-02-18T06:56:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-11T06:20:40.000Z (over 1 year ago)
- Last Synced: 2025-11-11T18:13:06.190Z (8 months ago)
- Topics: apple, arctkit, ios, macos, mvc, swift, swift-package, swiftui
- Language: Swift
- Homepage: http://arctkit.karindam.in
- Size: 2.22 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ArctKit π
**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.
## β¨ Features
- π **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.
## π¦ Installation
### Swift Package Manager (SPM)
Add ArctKit to your **Package.swift**:
```swift
.package(url: "https://github.com/k-arindam/ArctKit.git", from: "0.0.2")
```
Or add it via **Xcode**:
1. Open your Xcode project.
2. Go to **File > Add Packages**.
3. Enter the URL: `https://github.com/k-arindam/ArctKit.git`.
4. Select the latest version and add it to your project.
## π Getting Started
### 1οΈβ£ Define Your App Configuration
```swift
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)
}
}
}
```
### 2οΈβ£ Dependency Injection Made Easy π§©
```swift
// Register a dependency
let authControllerKey: String = "in.karindam.ArctKitDemo.auth"
do {
_ = try Arct.put(AuthController(), with: authControllerKey)
} catch {
print("Failed to register dependency: \(error)")
}
// Retrieve a dependency
let auth: AuthController? = try? Arct.find(with: authControllerKey)
```
### 3οΈβ£ Navigate Between Views Seamlessly π€
```swift
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)
```
### 4οΈβ£ Persistent Storage with UserDefaults π¦
```swift
// Save data
try Arct.write("John Doe", for: "username")
// Read data
let username: String? = try? Arct.read(String.self, for: "username")
```
## π Documentation
For full documentation, visit [here](http://arctkit.karindam.in).
## π Utility Functions
```swift
let isValidEmail = Arct.isEmail("test@example.com") // true
let isIPv4 = Arct.isIPv4("192.168.1.1") // true
let isIPv4 = Arct.isIPv6("192.168.1.1") // false
```
## π€ Contributing
We welcome contributions! Feel free to submit issues or pull requests.
## π License
ArctKit is available under the MIT License. See the [LICENSE](LICENSE) file for more details.
---
π **Supercharge your SwiftUI development with ArctKit today!**
---