/mvi-swift

Primary LanguageSwiftMIT LicenseMIT

MVISwift

Build Status Cocoapods Carthage compatible SPM compatible Platforms Xcode Swift License

MVISwift is a modern, Swift-based MVI framework with Combine

Contents

Requirements

  • iOS 13.0+ / tvOS 13.0+
  • Xcode 11+
  • Swift 5.1+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate MVISwift into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '13.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'MVISwift', '~> 1.0.2'
end

Finally run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate MVISwift into your Xcode project using Carthage, specify it in your Cartfile:

github "hhru/mvi-swift" ~> 1.0.2

Finally run carthage update to build the framework and drag the built MVISwift.framework into your Xcode project.

Swift Package Manager

The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

To integrate MVISwift into your Xcode project using Swift Package Manager, add the following as a dependency to your Package.swift:

.package(url: "https://github.com/hhru/mvi-swift.git", from: "1.0.2")

Then specify "MVISwift" as a dependency of the Target in which you wish to use MVISwift.

Here's an example Package.swift:

// swift-tools-version:5.1
import PackageDescription

let package = Package(
    name: "MyPackage",
    products: [
        .library(name: "MyPackage", targets: ["MyPackage"])
    ],
    dependencies: [
        .package(url: "https://github.com/hhru/mvi-swift.git", from: "1.0.2")
    ],
    targets: [
        .target(name: "MyPackage", dependencies: ["MVISwift"])
    ]
)

Usage

API Documentation

Xcode Templates

For convenient creation of new files, the project provides a set of Xcode templates, which are located in the XcodeTemplates folder.

To install Xcode templates, you need to run installation script:

./XcodeTemplates/install.sh

After executing the script, the templates will be available in the menu for creating new files ('File -> New -> File...').

Example App

Example app is a simple iOS and tvOS app that demonstrates how MVISwift works in practice. It's also a good place to start playing with the framework.

To install it, run these commands in a terminal:

$ git clone https://github.com/hhru/mvi-swift.git
$ cd /Example/MVISwiftExample
$ pod install
$ open MVISwiftExample.xcworkspace

Communication

  • If you need help, open an issue.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

📬 You can also write to us in telegram, we will help you: https://t.me/hh_tech

License

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