title: iOS - Can't access Swift Singleton from Objective-C
body: <p>I can't access my <strong>Swift Singleton Class</strong> from my <strong>Objective-C</strong> ViewController.</p>
  
  <p>Xcode does recognize my Swift Class, it builds, so I don't think it is a bridging header issue.</p>
  
  <p>Here is my Swift Singleton Class :</p>
  
  <pre><code>@objc class MySingleton : NSObject {
  
      static let shared = MySingleton()
  
      private override init() {}
  }
  </code></pre>
  
  <p>And then in my <strong>.m</strong> file I import this header :</p>
  
  <pre><code>#import "myProject-Swift.h"
  </code></pre>
  
  <p>And use the Singleton this way :</p>
  
  <pre><code> MySingleton *testSingleton = [MySingleton shared];
  </code></pre>
  
  <p>or this way :</p>
  
  <pre><code>[MySingleton shared];
  </code></pre>
  
  <p>It does recognize the MySingleton class type, but I can't access any functions or properties of this class.</p>
  
  <p>What am I missing? All the similar posts didn't help.</p>
  
  <p><strong>EDIT:</strong> I made a test function</p>
  
  <pre><code>func testPrint() {
     print("Singleton worked")
  }
  </code></pre>
  
  <p>And called it this way in the objective-c file :</p>
  
  <pre><code>[[MySingleton shared] testPrint];
  </code></pre>
  
  <blockquote>
    <p>No known instance for selector 'testPrint'</p>
  </blockquote>