MaxUI is a robust, declarative UI framework designed for developers who want to leverage the power and flexibility of UIKit while enjoying the modern, intuitive design approach of SwiftUI. The goal of MaxUI is to provide an efficient and straightforward way to create iOS applications without compromising performance, customization, or the design principles of UIKit.
MaxUI uses a declarative UI programming style similar to SwiftUI. Its MHStack
struct allows developers to construct complex user interfaces by nesting composable components (or MView
s).
Despite the SwiftUI-like syntax, MaxUI integrates seamlessly with UIKit. This seamless integration is evident in the way MaxUI interacts with UIView (in the MHStack
class) and other UIKit classes.
MaxUI utilizes Combine's publishers to enable dynamic UI updates. The UI responds reactively to data changes, keeping your application responsive and up-to-date.
MaxUI provides support for SwiftUI previews, significantly improving the developer experience. Developers can preview their UIKit-based interfaces in SwiftUI's PreviewProvider, enabling rapid iteration during the development process.
MaxUI is designed with reusability in mind. Components such as the MHStack
can be reused throughout your code, leading to cleaner, more maintainable code.
MaxUI's components, like MHStack
, are highly customizable. Developers can modify properties like alignment, spacing, and distribution to achieve the desired look and feel.
MaxUI uses MBinding
for state management, leading to more organized and readable code and contributing to the better maintenance and understanding of the codebase.
- iOS 15 or later
- XCode 11 or later
MaxUI can be installed using the Swift Package Manager, a tool for managing the distribution of Swift code.
To integrate MaxUI into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift:
dependencies: [
.package(url: "https://github.com/Xopoko/MaxUI.git")
]
MaxUI can be used to build complex, customizable user interfaces. Here are some examples:
// Most common use
MButton("some text") {
print("tap")
}
.insets(top: 24)
.configure(in: self)
// Initialization with custom 'label'
MButton {
print("tap")
} label: {
Text("some text")
}
.insets(top: 24)
.configure(in: self)
MHStack {
Text("some text")
Button("some button") {
print("tap")
}
}
.spacing(24)
.configure(in: self)
Please note that these are just samples. The actual usage will depend on your application's specific needs and constraints.
MaxUI is released under the MIT license. See LICENSE for details.
If you have any questions or encounter any issues, please open an issue on our GitHub page.
Your contributions and suggestions are always welcome!
Visual aids (screenshots, gifs, videos) will be added to this README soon to provide a better understanding of the usage and features of MaxUI.
Thank you for considering MaxUI for your project!