title: Multipeer Connectivity foundDevice twice
body: <p>I have code below and my goal was to get a mac to recognize an iOS Device with Multipeer Connectivity. This worked for the most part, except that when I run both of these I get <strong>two</strong> "FOUND!!!" in the console. How can I fix this?</p>
  
  <p>Here is my code for the iOS Device:</p>
  
  <pre><code>import UIKit
  import MultipeerConnectivity
  
  class ViewController: UIViewController, MCNearbyServiceBrowserDelegate,      MCNearbyServiceAdvertiserDelegate {
  
  
  let browser = MCNearbyServiceBrowser(peer: MCPeerID(displayName: "iOS Device"), serviceType: "example-test")
  let peerID = MCPeerID(displayName: "iOS Device")
  let advertiser = MCNearbyServiceAdvertiser(peer: MCPeerID(displayName: "iOS Device"), discoveryInfo: nil, serviceType: "example-test")
  
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
      advertiser.delegate = self
      advertiser.startAdvertisingPeer()
      browser.delegate = self
      browser.startBrowsingForPeers()
  }
  
  func browser(_ browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) {
  
  }
  
  func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) {
  
  }
  
  func browser(_ browser: MCNearbyServiceBrowser, foundPeer peerID: MCPeerID, withDiscoveryInfo info: [String : String]?) {
      print("FOUND!!!")
  }
  
  func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) {
  
  }
  
  func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -&gt; Void) {
  
  }
  
  
   }
  </code></pre>
  
  <p>And for the mac:</p>
  
  <pre><code>import MultipeerConnectivity
  
  class ConnectionsManager: NSObject, MCNearbyServiceBrowserDelegate,     MCNearbyServiceAdvertiserDelegate {
  
  
  let browser : MCNearbyServiceBrowser
  let advertiser: MCNearbyServiceAdvertiser
  let peerID = MCPeerID(displayName: "macDevice")
  
  
  
  override init() {
      advertiser = MCNearbyServiceAdvertiser(peer: MCPeerID(displayName: "mac Device"), discoveryInfo: nil, serviceType: "example-test")
      browser = MCNearbyServiceBrowser(peer: MCPeerID(displayName: "mac Device"), serviceType: "example-test")
      super.init()
      advertiser.delegate = self
      advertiser.startAdvertisingPeer()
      browser.delegate = self
      browser.startBrowsingForPeers()
  }
  deinit {
      browser.stopBrowsingForPeers()
      advertiser.stopAdvertisingPeer()
  }
  
      func browser(_ browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) {
  
      }
  
      func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) {
  
      }
  
      func browser(_ browser: MCNearbyServiceBrowser, foundPeer peerID: MCPeerID, withDiscoveryInfo info: [String : String]?) {
          print("FOUND!!!")
      }
  
      func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) {
  
      }
  
      func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -&gt; Void) {
  
      }
  
  
  
      }
  </code></pre>
  
  <p>Thanks,</p>