Realm Swift for MacOS


#1

Hello,
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.


#2

you can use

platform :osx
for macos pods :slight_smile:


#3

Thanks freeubi. That was helpful.


#4

Your podfile should look list this

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

And for ease of install, use the Cocoapods.app

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