 
   func grey_firstElement() -> GREYMatcher {
     var firstMatch = true
-    let matches: MatchesBlock = { (element: Any) -> Bool in
+    return GREYElementMatcherBlock(matchesBlock: { element in
       if firstMatch {
         firstMatch = false
         return true
       }
-
       return false
-    }
-
-    let describe: DescribeToBlock = { (description: GREYDescription?) -> Void in
-      description!.appendText("first match")
-    }
-
-    return GREYElementMatcherBlock.init(matchesBlock: matches, descriptionBlock: describe)
+    }, descriptionBlock: { description in
+      _ = description?.appendText("first match")
+    })
   }
 }


class FTRSwiftTests: XCTestCase {

  override func tearDown() {
    super.tearDown()
    let delegateWindow:UIWindow! = UIApplication.shared.delegate!.window!
    var navController:UINavigationController?
    if ((delegateWindow.rootViewController?.isKind(of: UINavigationController.self)) != nil) {
      navController = delegateWindow.rootViewController as? UINavigationController
    } else {
      navController = delegateWindow.rootViewController!.navigationController
    }
    _ = navController?.popToRootViewController(animated: true)
  }

  func testOpeningView() {
    self.openTestView("Typing Views")
  }

  func testRotation() {
    EarlGrey.rotateDeviceTo(orientation: UIDeviceOrientation.landscapeLeft, errorOrNil: nil)
    EarlGrey.rotateDeviceTo(orientation: UIDeviceOrientation.portrait, errorOrNil: nil)
  }

  func testTyping() {
    self.openTestView("Typing Views")
    let matcher = grey_accessibilityID("TypingTextField")
    let action = grey_typeText("Sample Swift Test")
    let assertionMatcher = grey_text("Sample Swift Test")

  }

  func testTypingWithError() {
    openTestView("Typing Views")
    EarlGrey.select(elementWithMatcher: grey_accessibilityID("TypingTextField"))
      .perform(grey_typeText("Sample Swift Test"))
      .assert(grey_text("Sample Swift Test"))
