Skip to content

Commit

Permalink
Add examples for MagicalRecord installing
Browse files Browse the repository at this point in the history
  • Loading branch information
Serge Sukhanov authored and Coeur committed May 30, 2019
1 parent fde8728 commit 9e4edfb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Docs/Installing-MagicalRecord.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,23 @@ By default, all of the category methods that MagicalRecord provides are prefixed
If you like, you can include the following headers to use shorter, non-prefixed category methods:

```objective-c
// Objective-C
#import <MagicalRecord/MagicalRecord.h>
#import <MagicalRecord/MagicalRecord+ShorthandMethods.h>
#import <MagicalRecord/MagicalRecordShorthandMethodAliases.h>
```

```swift
// Swift
import MagicalRecord
```

If you're using Swift, you'll need to add these imports to your target's Objective-C bridging header.

Once you've included the headers, you should call the `+[MagicalRecord enableShorthandMethods]` class method _before_ you setup/use MagicalRecord:

```objective-c
// Objective-C
- (void)theMethodWhereYouSetupMagicalRecord
{
[MagicalRecord enableShorthandMethods];
Expand All @@ -79,4 +86,13 @@ Once you've included the headers, you should call the `+[MagicalRecord enableSho
}
```

```swift
// Swift
func theMethodWhereYouSetupMagicalRecord() {
MagicalRecord.enableShorthandMethods()
// Setup MagicalRecord as per usual
}
```

**Please note that we do not offer support for this feature**. If it doesn't work, [please file an issue](https://github.com/magicalpanda/MagicalRecord/issues/new) and we'll fix it when we can.

0 comments on commit 9e4edfb

Please sign in to comment.