GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - boostcode/CacheManager: Swift CacheManager class built on top of Realm

BranchesTags
Open more actions menu

Latest commit

 

History

73 Commits
73 Commits

Folders and files

NameName
Last commit message
Last commit date
CacheManager.xcodeproj
CacheManager.xcodeproj
 
 
CacheManager.xcworkspace
CacheManager.xcworkspace
 
 
CacheManager
CacheManager
 
 
CacheManagerTests
CacheManagerTests
 
 
.gitignore
.gitignore
 
 
.swift
.swift
 
 
.swiftlint.yml
.swiftlint.yml
 
 
CacheManager.podspec
CacheManager.podspec
 
 
LICENSE
LICENSE
 
 
Podfile
Podfile
 
 
Podfile.lock
Podfile.lock
 
 
README.md
README.md
 
 

Repository files navigation

CacheManager

CacheManager is a swift local caching library built on top of Realm. Used with Moya it easily helps you to cache remote data from json.

Features

You have simple to build an Object realm class and then create you ObjectManager using CacheManager.

CacheManager will allows you to:

  • count items
  • ignoreOnUpdate key
  • sort & sortAscending on a key
  • filtering

Install

Pod

pod 'CacheManager', '0.0.3'

Usage

  • Create a Realm Object Class (eg. MyModel)
  • Create ModelManager (eg. MyModelManager)
import CacheManager
import Foundation

class MyModelManager: CacheManager<MyModel> {
    private let net = Net()

    override func getRemoteItems(completion: (error: NSError?) -> ()) {
        net.listProductsByCategory(catName) { (prods, error) in
            if (error != nil) {
                print(error)
                completion(error: error)
            } else {
                print("Models stored locally")
                super.itemAddFromArray(prods!)
                completion(error: nil)
            }
        }
    }
}

This examples makes use of Moya style to retrieve items from remote, you are free to user your favorite method.

Functions

  • getRemoteItems Force items to be updated from remote

  • count Returns the number of items cached locally

  • itemAt (Optionally) returns an item at defined index

About

Swift CacheManager class built on top of Realm

Resources

Readme
License
Activity
Custom properties

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.