Realm Swift for MacOS


I built an iOS app using RealmSwift, and I’m looking into coding a MacOS app. I tried installing Realm using ‘pod install’ just like I did for my iOS app, but it doesn’t seem to be working. I’m getting a “No such module” error.

I opened the podfile and I see that the platform is set to ‘iOS’:

platform :ios, '9.0'

My question is: How do I install RealmSwift on a MacOS app, if at all feasible?

Thank you.


you can use

platform :osx
for macos pods :slight_smile:


Thanks freeubi. That was helpful.


Your podfile should look list this

project 'My_Project.xcodeproj'
target 'My_Project' do
  platform :osx, '10.14'
  pod 'RealmSwift'

And for ease of install, use the

Also once you use install pods be sure to start your project by double clicking the . xcworkspace file instead of the . xcodeproj file.