title: Xcode 6 + iOS 8 SDK but deploy on iOS 7 (UIWebKit & WKWebKit)
body: <p>We are creating an app using Xcode 6 beta 5 + Swift on iOS 8 SDK. We'd like to deploy to iOS 7 as well. Is that possible? When we set the deployment target of the project to 7.0, we get compile time errors like this:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "_OBJC_CLASS_$_WKPreferences", referenced from:
        __TMaCSo13WKPreferences in WebViewController.o
    "_OBJC_CLASS_$_WKWebView", referenced from:
        __TMaCSo9WKWebView in WebViewController.o
    "_OBJC_CLASS_$_WKWebViewConfiguration", referenced from:
        __TMaCSo22WKWebViewConfiguration in WebViewController.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>I believe that's because we are using <code>WKWebKit</code>, which is supported by iOS 8+ only. We are ok with using <code>UIWebKit</code> for iOS 7 but <code>WKWebKit</code> for iOS 8. How do we define that?</p>
  
  <p>Our class definition looks like this...</p>
  
  <pre><code>import WebKit
  
  class WebViewController: UIViewController, WKNavigationDelegate {
     ...
  }
  </code></pre>
  
  <p>and it's called by:</p>
  
  <pre><code>        let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
          let destinationVC = mainStoryboard.instantiateViewControllerWithIdentifier("WebViewController") as WebViewController
          presentViewController(destinationVC, animated: true, completion: nil)
  </code></pre>
  
  <p>I was thinking about using this fragment to call <code>presentViewController</code> but that doesn't solve the compile time issues. (<code>NSFoundationVersionNumber</code> doesn't solve compile time issues either)</p>
  
  <pre><code>    if ((UIDevice.currentDevice().systemVersion as NSString).floatValue &gt;= 8.0) {
  
      } else {
  
      }
  </code></pre>
  
  <p><strong>UPDATE: kkoltzau has the correct answer. I'm adding some more info for others.</strong></p>
  
  <p>First, go to your <code>Project</code>, click on <code>General</code>, scroll down to <code>Linked Frameworks and Libraries</code>, and add <code>WebKit.framework</code> as Optional. (I also did it for <code>UIKit.framework</code>) See screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/LWAGj.png" alt="enter image description here"></p>
  
  <p>As for my <code>WebViewController</code> class. It still imports <code>UIKit</code> and <code>WebKit</code>. but the <code>viewDidLoad()</code> sets the view based on kkoltzau's example. Then whenever I need to load/reload the web page, it checks for existence of <code>wkWebView</code>.</p>