Elegant library to manage the interactions between view and model in Swift

Overview

An assistant to manage the interactions between view and model

Swift 5 license MIT CocoaPods Compatible Platform codebeat badge Carthage compatible Twitter

ModelAssistant is a mediator between the view and model. This framework is tailored to work in conjunction with views that present collections of objects. These views typically expect their data source to present results as a list of sections made up of rows. ModelAssistant can efficiently analyze model objects and categorize them in sections. In addition it updates adopted view to its delegate, based on model objects changes.

Features

  • Inserting / Removing / Ordering / Updating model objects
  • Notifies changes to view
  • Full compatible with UITableView and UICollectionView
  • Supports Sections
  • Supports index titles
  • Compatible with Server data source
  • Compatible with all kind of persistent stores
  • Compatible with all design patterns
  • Easy to use
  • Thread safe
  • Fault Ability
  • Complete Documentation

What's New:

Version 1.1.3:

Now using modelAssitant is really easy with just two lines of codes, and delegates will be implement automatically to your collection view.

See Usage for new way of implementing modelAssistant.

Version 1.0.8.3:

Upgraded to Swift 5

Version 1.0.8:

  • Fault Ability: Now you can make entities in an specific range fault or fire them. For more information see Advanced Usage

Requirements

  • iOS 8.0+
  • Xcode 8.3+
  • Swift 3.1+

Installation

CocoaPods

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

$ gem install cocoapods

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

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '' do

    pod 'ModelAssistant'
    
end

If you are not upgraded to Swift 4.2, use the last non-swift 4.2 compatible release:

If you are using swift 4, replace pod 'ModelAssistant' with this:

pod 'ModelAssistant', '1.0.1' #Swift 4

If you are using swift 3, replace pod 'ModelAssistant' with this:

pod 'ModelAssistant', '1.0.0' #Swift 3

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 ModelAssistant into your Xcode project using Carthage, specify it in your Cartfile:

github "ssamadgh/ModelAssistant"

Run carthage update --platform iOS to build the framework and drag the built ModelAssistant.framework into your Xcode project.

Manually

If you prefer not to use any of the aforementioned dependency managers, you can integrate ModelAssistant into your project manually.

Embedded Framework

  • Open up Terminal, cd into your top-level project directory, and run the following command "if" your project is not initialized as a git repository:

    $ git init
  • Add ModelAssistant as a git submodule by running the following command:

    $ git submodule add https://github.com/ssamadgh/ModelAssistant.git
  • Open the new ModelAssistant folder, and drag the ModelAssistant.xcodeproj into the Project Navigator of your application's Xcode project.

    It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.

  • Select the ModelAssistant.xcodeproj in the Project Navigator and verify the deployment target matches that of your application target.

  • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.

  • In the tab bar at the top of that window, open the "General" panel.

  • Click on the + button under the "Embedded Binaries" section.

  • You will see two different ModelAssistant.xcodeproj folders each with a ModelAssistant.framework nested inside a Products folder.

    It does not matter which Products folder you choose from.

  • Select the ModelAssistant.framework.

  • And that's it!

    The ModelAssistant.framework is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.

FAQ

What is the position of ModelAssistant in design patterns?

ModelAssistant is fully compatible with all kind of design patterns. It doesn't violate them, instead it finds its place and sit there! As a guide the position of ModelAssistant in some of famous design patterns is as follows:

Design Pattern ModelAssistant Position
MVC Controller
MVP Presenter
MVVM ViewModel
VIPER Presenter

Credits

ModelAssistant is owned and maintained by the Seyed Samad Gholamzadeh. You can follow me on Twitter at @ssamadgh for project updates and releases.

License

ModelAssistant is released under the MIT license. See LICENSE for details.

You might also like...
KeyPathKit is a library that provides the standard functions to manipulate data along with a call-syntax that relies on typed keypaths to make the call sites as short and clean as possible.

KeyPathKit Context Swift 4 has introduced a new type called KeyPath, with allows to access the properties of an object with a very nice syntax. For in

PJAlertView - This library is to make your own custom alert views to match your apps look and feel

PJAlertView - This library is to make your own custom alert views to match your apps look and feel

A stand-alone Swift wrapper around the mongo-c client library, enabling access to MongoDB servers.
A stand-alone Swift wrapper around the mongo-c client library, enabling access to MongoDB servers.

This package is deprecated in favour of the official Mongo Swift Driver. We advise users to switch to that pack

A stand-alone Swift wrapper around the MySQL client library, enabling access to MySQL servers.
A stand-alone Swift wrapper around the MySQL client library, enabling access to MySQL servers.

Perfect - MySQL Connector This project provides a Swift wrapper around the MySQL client library, enabling access to MySQL database servers. This packa

A stand-alone Swift wrapper around the libpq client library, enabling access to PostgreSQL servers.
A stand-alone Swift wrapper around the libpq client library, enabling access to PostgreSQL servers.

Perfect - PostgreSQL Connector This project provides a Swift wrapper around the libpq client library, enabling access to PostgreSQL servers. This pack

Swift library that makes easier to serialize the user's preferences (app's settings) with system User Defaults or Property List file on disk.

PersistentStorageSerializable PersistentStorageSerializable is a protocol for automatic serialization and deserialization of Swift class, struct or NS

A PostgreSQL client library for Swift. Does not require libpq.

PostgresClientKit PostgresClientKit provides a friendly Swift API for operating against a PostgreSQL database. Features Doesn't require libpq. Postgre

Easiest local storage library in Swift
Easiest local storage library in Swift

SundeedQLite SundeedQLite is the easiest offline database integration, built using Swift language Requirements iOS 12.0+ XCode 10.3+ Swift 5+ Installa

A stand-alone Swift wrapper around the SQLite 3 client library.
A stand-alone Swift wrapper around the SQLite 3 client library.

Perfect - SQLite Connector This project provides a Swift wrapper around the SQLite 3 library. This package builds with Swift Package Manager and is pa

Owner
Seyed Samad Gholamzadeh
Seyed Samad Gholamzadeh
iForage helps foragers to track and manage foraging spots around them using CloudKit

iForage CloudKit Preface To expand on what I've created here: https://github.com/LynchConnor/iForage, I initially developed the app using Firebase. Th

Connor Lynch 3 Jul 14, 2022
Amplitude Analytics 0 Feb 1, 2022
Classes-and-structures-in-swift - This source files show what is the difference between class and structure

This source files show what is the difference between class and structure You ca

null 0 Jan 4, 2022
Sharing SQL queries between Server and Mobile databases

Sharing SQL queries between Server and Mobile databases Overview As we all know, code is expensive to maintain, and the more complex the code, the mor

Aaron LaBeau 4 May 24, 2022
An elegant, fast, thread-safe, multipurpose key-value storage, compatible with all Apple platforms.

KeyValueStorage An elegant, fast, thread-safe, multipurpose key-value storage, compatible with all Apple platforms. Supported Platforms iOS macOS watc

null 3 Aug 21, 2022
PassValuesBetweenViewControllers - Pass Values Between ViewControllers

PassValuesBetweenViewControllers Vista creada con: Programmatic + AutoLayout Bre

Vanesa Giselle Korbenfeld 0 Jan 18, 2022
An e-commerce app with some function: searching, like product, demo paying and view product

Emarket_060921 An e-commerce app with some function: searching, like product, demo paying and view product. I have developed this app all by myself, b

null 0 Jan 17, 2022
Hotels By Location - Click on the table view cell will navigate to hotel url

HotelsByLocation About This is the final project of IOS Nano Degree. Longpress or search locations. It'll drop a pin on the map. Click on the annotaio

HWYS 0 Jan 15, 2022
🧡 SQLiteOrm-Swift is an ORM library for SQLite3 built with Swift 5

?? Easy to use SQLite ORM library written with Swift

Yevgeniy Zakharov 25 Oct 6, 2022
Disk is a powerful and simple file management library built with Apple's iOS Data Storage Guidelines in mind

Disk is a powerful and simple file management library built with Apple's iOS Data Storage Guidelines in mind

Saoud Rizwan 3k Jan 3, 2023