title: Why do I keep getting the error "no such module 'realmswift'"?
body: <p>The previous answers to this question are over a year old. I've tried them. They don't really work. I have installed the pod for using Realm successfully. I wrote a couple of users with a name and role onto the Realm database that I could see with Realm Studio. I then walked away from my computer for an hour (no one else touched it during this time). When I got back I got the no such module error.</p>
  
  <p>I have tried to update the pod file several times through the terminal. I also quit Xcode and restarted it. I also Google-ed around looking for a solution and tried adding a new scheme via the Product drop down. Although that will get my project to successfully compile, the new scheme won't launch on the simulator.</p>
  
  <p>This is my podfile: </p>
  
  <pre><code># Uncomment the next line to define a global platform for your project
  # platform :ios, '12.2'
  
  target 'realmProject' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  
  # Pods for realmProject
  pod 'RealmSwift'
  
  end
  </code></pre>
  
  <p>This is the ViewController that is giving me the error:</p>
  
  <pre><code>import UIKit
  import RealmSwift
  
  class SecondViewController: UIViewController {
      @IBOutlet weak var nameTextField: UITextField!
  
      @IBOutlet weak var rolePickerView: UIPickerView!
  
      let roles = ["Designer", "Developer"]
  
      override func viewDidLoad() {
          super.viewDidLoad()
          rolePickerView.dataSource = self
          rolePickerView.delegate = self
      }
  
      var employees = Employee()
  
      @IBAction func addButtonPressed(_ sender: Any) {
  
  
          employees.name = nameTextField.text ?? "no name"
  
          employees.role = roles[rolePickerView.selectedRow(inComponent:     0)]
  
          let realm = try! Realm()
  
          try! realm.write {
              realm.add(employees)
          }
  
          let results = realm.objects(Employee.self)
  
          for r in results {
              employees.append(r)
          }
  
          print("button pressed")
  
      }
  }
  
  extension SecondViewController: UIPickerViewDelegate, UIPickerViewDataSource {
  
      func numberOfComponents(in pickerView: UIPickerView) -&gt; Int {
          return 1
      }
  
      func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String? {
          return roles[row]
      }
  
      func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
          return roles.count
      }
  }
  </code></pre>
  
  <p>I am simply trying to use Realm to save data and use that to populate a tableview. Right now I get the above error saying I can't use Realm.</p>