Last active
          May 22, 2018 16:44 
        
      - 
      
 - 
        
Save macteo/d36f8884e39838d11a321996098a53c4 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
macteo revised this gist
May 22, 2018 . 1 changed file with 4 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,4 @@ for contact in contacts where contact.emailAddress == emailAddress { completion(contact) } completion(nil)  - 
        
macteo created this gist
May 22, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ public func lookup(emailAddress: String, completion: (_ contact: Contact?) -> Void) { /* Here we are searching through a local array of contacts. This could instead be an asynchronous call to a remote server. */ for contact in contacts where contact.emailAddress == emailAddress { completion(contact) } completion(nil) }