title: How to include header file only if framework is added/linked in Xcode?
body: <p>I'm working on a Xcode project with Objective C that has optional frameworks which means that some code is executed from that particular framework only if it is linked/exists in project. The current framework that I'm using is PassKit. How can I achieve this? Is there some macro that can tell is framework linked or it is not? Something like this, but it doesn't work:</p>
  
  <pre><code>#if __has_include("PassKit.h") &amp;&amp; __has_include(&lt;PassKit.h&gt;)
  #import &lt;PassKit/PassKit.h&gt;
  #endif
  
  - (void)viewDidAppear:(BOOL)animated {
       if ([PKPassLibrary class]) {
           UIAlertController *alert = [UIAlertController
                                  alertControllerWithTitle:@"PassKit Test"
                                  message:@"PassKit is linked."
                                  preferredStyle:UIAlertControllerStyleAlert];
  
        UIAlertAction* okButton = [UIAlertAction
                                 actionWithTitle:@"Ok"
                                 style:UIAlertActionStyleDefault
                                 handler:^(UIAlertAction * action) {
                                     NSLog(@"Ok pressed...");
                                 }];
  
         [alert addAction:okButton];
  
         [self presentViewController:alert animated:YES completion:nil];
     }}
  </code></pre>
  
  <p>Also I have set <strong>Link Frameworks Automatically</strong> to <strong>NO</strong> in my target. Thanks for your answers and help.</p>