title: Is there a way to add `if (iOSApplicationExtension)` condition for `UIApplication.shared`
body: <p>I'm trying to find a way of adding a condition for checking <em>is an extension target</em> <strong>in Framework</strong> (not main app). Is it possible relying on  <code>#available(iOSApplicationExtension, *)</code> with some parameters adjustments?</p>
  
  <pre><code>@objc public extension UIView {
      var isAccessibilityCategory: Bool {
          if #available(iOSApplicationExtension, *) {
              return self.traitCollection.preferredContentSizeCategory.isAccessibilityCategory
          } else {
              return UIApplication.shared.preferredContentSizeCategory.isAccessibilityCategory
          }
      }
  }
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/25048026/how-to-detect-if-code-is-running-in-main-app-or-app-extension-target">How to detect if code is running in Main App or App Extension Target?</a> - doesn't work, because the framework doesn't know about extension targets</p>