3

I have an app written in Swift that supports iOS 7. I want to use Realm for my database, but according to their documentation the Swift library supports iOS 8 only.

I don't want to write Objective-C code in my app. Is there any way around this?

Ron.Kliffer
  • 248
  • 1
  • 9

1 Answers1

4

Since RealmSwift must be distributed as a dynamic framework, there's no real way to use it on iOS 7. Realm Objective-C should work just fine in Swift, albeit with a less 'native' feel.

segiddins
  • 4,110
  • 1
  • 17
  • 22
  • Thanks for the answer. I'll go with Core Date unfortunately – Ron.Kliffer May 16 '15 at 21:38
  • @Ron.Kliffer To be clear, you don’t have to write Objective-C code to use Realm from Swift with iOS 7. You can use the “Realm Objective-C” library from Swift, writing only Swift language code. We are now encouraging people to build on “Realm Swift” instead, but you can still see what writing Swift code to use Realm Objective-C looks like in our [0.91.0 docs](http://realm.io/docs/objc/0.91.0/#models). I hope this helps. – timanglade May 19 '15 at 14:43
  • @timanglade I know that. I just preferred using native Swift and not using bridging. I might wait until my app supports iOS 8 and up, should happen soon anyway – Ron.Kliffer May 21 '15 at 09:29