title: Xcode/Swift error: Command failed due to signal: Segmentation fault: 11
body: <p>I am trying to call a function of a singleton class with completion handler argument but I get "Command failed due to signal: Segmentation fault: 11" error. I am using Xcode 6.2 (6C101) and trying to build for iOS 8 on iPhone 6 simulator. Here is the singlton class:</p>
  
  <pre><code>public class ClientManager {
  
      public class var sharedInstance: ClientManager {
          struct Singleton {
              static let instance = ClientManager()
          }
          return Singleton.instance
      }
  
      private init() {
      }
  
      public func fetchServiceInfo(serviceName: String, completionHandler: (JSON?, NSError?) -&gt; Void) {
          Alamofire.request(.GET, Router.ServiceInfo(serviceName)).responseJSON { (req, res, json, error) in
              completionHandler(JSON(json!), error)
          }
      }
  
  }
  </code></pre>
  
  <p>And when I call <code>fetchServiceInfo</code> function within a view controller, Xcode crashes (SourceKitService Crashed):</p>
  
  <pre><code>ClientManager.sharedInstance.fetchServiceInfo("default") { (json, error) in
      println(json)
  }
  </code></pre>
  
  <p>However, if I call the same function within the <code>init</code> method of <code>ClientManager</code> it works properly:</p>
  
  <pre><code>private init() {
      self.fetchServiceInfo("default") { (json, error) in
          println(json)
      }
  }
  </code></pre>
  
  <p>I am using <code>Alamofire</code> and <code>SwiftyJSON</code> libraries.</p>