Releases: 0xLeif/AppState
Releases · 0xLeif/AppState
2.1.3
2.1.2
2.1.1
What's Changed
Fixed
- Bug Fix: Resolved the issue where state was set before being accessed, which caused failures. Now utilizing the MainActor for state management to ensure proper concurrency handling. #117 by @0xLeif
Miscellaneous
- Added new lines in the project files to improve formatting. #115 by @0xLeif
- Updated the macOS build configuration file
macOS.yml
to enhance CI support. #116 by @0xLeif
Full Changelog: Compare 2.1.0...2.1.1
2.1.0
What's New in Version 2.1.0
New Features
- Protocol Support for Dependencies: Introduced protocols for dependencies, allowing more flexibility and customization when managing state dependencies.
Core Improvements
- Fix for Double Slash in File Paths: Resolved an issue where file paths contained double slashes, ensuring smoother file operations.
- MainActor Usage in FileState: Updated
FileState
to ensure all state interactions happen on theMainActor
, improving thread safety and UI responsiveness. - Logging Enhancements: Moved logging strings into closures for improved performance and better logging control.
Code Clean-Up
- Removed Unused Code: Streamlined the codebase by removing unused code, improving maintainability and readability.
Documentation Improvements
- Enhanced Documentation: Comprehensive updates to improve clarity and provide additional examples in the documentation.
- Keychain Integration: Added detailed documentation on how to use the
Keychain
with AppState, making secure storage easier to understand and implement. - Updated Advanced Usage Guides: Expanded guidance on advanced AppState topics, including
FileState
and dependency protocols.
Full Changelog: View the full list of changes
2.0.0
2.0.0-beta.2
Full Changelog: 2.0.0-beta.1...2.0.0-beta.2
2.0.0-beta.1
- Swift 6 support
1.17.0
1.16.0
What's Changed
Now you can use the setup parameter to preform any operations you need before the Application starts consuming the cache and publishing changes. This is useful for loading default dependencies your custom application might use.
class SomeApplication: Application {
static func someFunction() { /* no-op */ }
required init(setup: (Application) -> Void = { _ in }) {
super.init { application in
application.load(dependency: \.icloudStore)
setup(application)
}
}
}
Full Changelog: 1.15.0...1.16.0
1.15.0
What's Changed
- Added new
Application.preview
to be used in#Preview
to override the needed dependencies for the content view. (Leif/preview improvements by @0xLeif in #98)
class Service {
var title: String { "Live Service" }
}
class MockService: Service {
override var title: String { "Mock Service" }
}
extension Application {
var service: Dependency<Service> {
dependency(Service())
}
}
struct ContentView: View {
@AppDependency(\.service) private var service
var body: some View {
Text(service.title)
}
}
#Preview {
Application.preview(
Application.override(\.service, with: MockService()),
Application.override(\.userDefaults, with: UserDefaults())
) {
ContentView()
}
}
Full Changelog: 1.14.0...1.15.0