Latest0.2.4
Homepagehttps://github.com/bearjaw/RBSRealmBrowser
LicenseMIT
Platformsios 9.0, requires ARC
DependenciesRealmSwift
Authors

CI Status
Version
License
Platform
CocoaPods

RBSRealmBrowser is based on NBNRealmBrowser by Nerdish by Nature. It’s a simple lightweight browser that lets you inspect which objects are currently in your realm database on your iOS device or simulator.
Simply edit your existing object’s property values by switching into edit mode.

Features

  • Quickly browse realm objects
  • Edit Realm objects
  • Delete Realm objects
  • Quick actions (start the browser from the homescreen)
  • Open RealmBrowser constrained to specific classes (i.e. you only want to inspect the Person classes)

For editing objects these types are currently supported:

  • Bool
  • String
  • Int
  • Float
  • Double

RBSRealmBrowser

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

This browser only works with RealmSwift because Realm (Objective-C) and RealmSwift ‘are not interoperable and using them together is not supported.’

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // add a UIBarButtonItem 
        let bbi = UIBarButtonItem(title: "Open", style: UIBarButtonItemStyle.plain, target: self, action:   #selector(ViewController.openBrowser))
        navigationItem.rightBarButtonItem = bbi
    }

    @objc func openBrowser() {
        guard let realmBrowser = RBSRealmBrowser.realmBrowser(showing: ["Person"]) else { return }
        present(realmBrowser, animated: true, completion: nil)
    }
}

Use one of the methods to browse your Realm database

All these convenience methods come with a second method using a classes option. Use theses methods if you want to restrict the results to (a) specific class(es).

If you pass in nil, all objects will be displayed. The [String] must be composed
of classNames and they must match.

If you quickly want to access all objects in the default realm database use one these two methods:

// get the RealmBrowser for default Realm 
public static func realmBrowser() -> UINavigationController?
// get the RealmBrowser for default Realm, filtered by an optional class names array 
public static func realmBrowser(showing classes:[String]?) -> UINavigationController?

If you want to specifiy a realm use one of these two methods:

// get the RealmBrowser for Realm 
public static func realmBrowserForRealm(_ realm: Realm) -> UINavigationController?
// Pass an optional array of class names you want to display & your realm
public static func realmBrowserForRealm(_ realm: Realm, showing filteredClasses:[String]?) -> UINavigationController?

If you want to access your realm at a given URL use one of theses methods:

// get the RealmBrowser for Realm at a specific url
public static func realmBroswerForRealmURL(_ url: URL) -> UINavigationController?
// Same as the above but you can pass an optional [String] containing Class names
public static func realmBrowser(showing classes:[String]?,aURL URL:URL) -> UINavigationController?

Quick actions

This latest version supports dynamic quick actions on iOS 9.0 and above.
To use the quick action add this code to your AppDelegate applicationDidFinishLaunching(:) method.

// add the realmbrowser quick action to your shortcut items array
   if #available(iOS 9.0, *) {
       application.shortcutItems = [RBSRealmBrowser.addBrowserQuickAction()]
   } else {
       // Fallback on earlier versions
   }

Now handle the action:

    func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {

        // handle the quick action
        guard let rb = RBSRealmBrowser.realmBrowser() else {
            print("realm browser is nil!")
            return
        }
        let vc = (window?.rootViewController)! as UIViewController
        vc.present(rb, animated: true)
    }

Try

To try the example project, clone the repo, and run pod try from the Example directory first.

Requirements

  • Xcode 8
  • iOS 9.0+
  • Swift 3.0 for any release after 0.1.4
  • Swift 4.0 for any release after 0.1.9
  • Swift 4.1 for any release after 0.2.2

Installation

RBSRealmBrowser is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'RBSRealmBrowser'

Future features

What’s on the roadmap… 🚀

  • [ ] Tests
  • [ ] Be able to create objects
  • [ ] Clean up
  • [ ] Live reload the browser if updates happen in the background
  • [x] Layout improvements
  • [ ] Search

Documentation

Available method documentation here

RealmBrowser for Android

Realm browser by Jonas Rottmann for your Android projects available jonasrottmann/realm-browser

Author

Max Baumbach, [email protected]

License

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

Latest podspec

{
    "name": "RBSRealmBrowser",
    "version": "0.2.4",
    "summary": "RBSRealmBrowser is a a Realm browser which you can use in your Swift projects.",
    "description": "RBSRealmBrowser is based on NBN's RealmBrowser. If you're using RealmSwift, this browser offers a brief insight into your Realm database. You can define an array of classNames to get those explicit models.nInspect objects, their properties and their values with ease.",
    "homepage": "https://github.com/bearjaw/RBSRealmBrowser",
    "license": "MIT",
    "authors": {
        "Max Baumbach": "[email protected]"
    },
    "source": {
        "git": "https://github.com/bearjaw/RBSRealmBrowser.git",
        "tag": "0.2.4"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/*.swift",
    "swift_version": "4.1",
    "dependencies": {
        "RealmSwift": []
    }
}

Pin It on Pinterest

Share This