title: Fetching a relationship from core data swift 4
body: <p>I have an Artist and album Entity. I am able to retrieve all of the covers from the Album entity. However I cant figure out how to fetch only covers assigned to an specific artist. As far as I understand this should have some kind of Predicate with specific condition to retrieve that. 
  I am trying to work on the core data relationship to retrieve a cover attribute from the Album entity. Please see attached screens from the core data editor. As well as the code I am trying to implement. </p>
  
  <pre><code>var albums = [Album]()
      let request = NSFetchRequest&lt;Album&gt;(entityName: "Album")
      //request.predicate = NSPredicate(format: "recordArtist = %@", albums)
      do {
          albums = try context.fetch(request)
          for cover in albums {
              if ((currentArtist?.name) != nil){
                  print(currentArtist.cover)
              }
          }
      }
      catch { print(error)
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8taMy.png" rel="nofollow noreferrer">entity</a>
  <a href="https://i.stack.imgur.com/H239C.png" rel="nofollow noreferrer">album and artist</a></p>