Skip to content

Commit

Permalink
Remove Realm support
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Piñera Buendía committed Apr 7, 2017
1 parent c82e510 commit 3049419
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 1,220 deletions.
649 changes: 0 additions & 649 deletions Carthage.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

80 changes: 0 additions & 80 deletions Carthage.xcodeproj/xcshareddata/xcschemes/iOSRealm.xcscheme

This file was deleted.

80 changes: 0 additions & 80 deletions Carthage.xcodeproj/xcshareddata/xcschemes/macOSRealm.xcscheme

This file was deleted.

80 changes: 0 additions & 80 deletions Carthage.xcodeproj/xcshareddata/xcschemes/tvOSRealm.xcscheme

This file was deleted.

80 changes: 0 additions & 80 deletions Carthage.xcodeproj/xcshareddata/xcschemes/watchOSRealm.xcscheme

This file was deleted.

18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

## What is SugarRecord?
SugarRecord is a persistence wrapper designed to make working with persistence solutions like CoreData/Realm/... in a much easier way. Thanks to SugarRecord you'll be able to use CoreData with just a few lines of code: Just choose your stack and start playing with your data.
SugarRecord is a persistence wrapper designed to make working with persistence solutions like CoreData in a much easier way. Thanks to SugarRecord you'll be able to use CoreData with just a few lines of code: Just choose your stack and start playing with your data.

The library is maintained by [@carambalabs](https://github.com/carambalabs). You can reach me at [[email protected]](mailto://[email protected]) for help or whatever you need to commend about the library.

Expand Down Expand Up @@ -43,7 +43,6 @@ Choose the right one depending ton the configuration you need for you app.
```ruby
pod "SugarRecord/CoreData"
pod "SugarRecord/CoreData+iCloud"
pod "SugarRecord/Realm"
```

### [Carthage](https://github.com/carthage)
Expand All @@ -53,8 +52,6 @@ pod "SugarRecord/Realm"
3. Execute `carthage update`
4. Add the frameworks to your project as explained on the [Carthage repository](https://github.com/carthage).

> Note: If you use the [Realm](https://realm.io) you have to also add `Realm.framework` and `RealmSwift.framework`.
### Reactive programming

We provide extensions for SugarRecord that offer a reactive interface to the library:
Expand All @@ -68,7 +65,7 @@ You can check generated SugarRecord documentation [here](http://cocoadocs.org/do
# How to use

#### Creating your Storage
A storage represents your database, Realm, or CoreData. The first step to start using SugarRecord is initializing the storage. SugarRecord provides two default storages, one for CoreData, `CoreDataDefaultStorage` and another one for Realm, `RealmDefaultStorage`.
A storage represents your database. The first step to start using SugarRecord is initializing the storage. SugarRecord provides a default storages, `CoreDataDefaultStorage`.

```swift
// Initializing CoreDataDefaultStorage
Expand All @@ -79,11 +76,6 @@ func coreDataStorage() -> CoreDataDefaultStorage {
let defaultStorage = try! CoreDataDefaultStorage(store: store, model: model)
return defaultStorage
}

// Initializing RealmDefaultStorage
func realmStorage() -> RealmDefaultStorage {
return RealmDefaultStorage()
}
```

##### Creating an iCloud Storage
Expand All @@ -101,7 +93,7 @@ func icloudStorage() -> CoreDataiCloudStorage {
```

#### Contexts
Storages offer multiple kind of contexts that are the entry points to the database. For curious developers, in case of CoreData a context is a wrapper around `NSManagedObjectContext`, in case of Realm a wrapper around `Realm`. The available contexts are:
Storages offer multiple kind of contexts that are the entry points to the database. For curious developers, in case of CoreData a context is a wrapper around `NSManagedObjectContext`. The available contexts are:

- **MainContext:** Use it for main thread operations, for example fetches whose data will be presented in the UI.
- **SaveContext:** Use this context for background operations. The context is initialized when the storage instance is created. That context is used for storage operations.
Expand Down Expand Up @@ -186,11 +178,11 @@ do {
```

<br>
> This is the first approach of SugarRecord for the interface. We'll improve it with the feedback you can report and according to the use of the framework. Do not hesitate to reach us with your proposals. Everything that has to be with making the use of CoreData/Realm easier, funnier, and enjoyable is welcome! :tada:
> This is the first approach of SugarRecord for the interface. We'll improve it with the feedback you can report and according to the use of the framework. Do not hesitate to reach us with your proposals. Everything that has to be with making the use of CoreData easier, funnier, and enjoyable is welcome! :tada:
### RequestObservable

SugarRecord provides a component, `RequestObservable` that allows observing changes in the DataBase. It uses Realm notifications and CoreData `NSFetchedResultsController` under the hood.
SugarRecord provides a component, `RequestObservable` that allows observing changes in the DataBase. It uses `NSFetchedResultsController` under the hood.

**Observing**

Expand Down
Loading

0 comments on commit 3049419

Please sign in to comment.