title: Create and use swift static library in Xcode 10.1
body: <p>I plan to create swift static library and use in ios swift app.  I create a swift static libraryn call SimpleLib and it include a public class Greeting which return Hello World string:</p>
  
  <pre><code>//
  //  Greeting.swift
  //  SimpleLib
  //
  
  import Foundation
  
  public class Greeting {
     public func Hello() -&gt; String {
       return "Hello World";
     }
     public init() {
  
     }
  
     public static func SayMorning() -&gt; String{
        return "Hi, Morning";
     }
  }
  </code></pre>
  
  <p>The swift static library project look like:</p>
  
  <p><a href="https://i.stack.imgur.com/px8c1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/px8c1.png" alt="enter image description here"></a></p>
  
  <p>And the module.modulemap is defined as following:</p>
  
  <pre><code>module SimpleLib {
    header "SimpleLib-Swift.h"
    export *
  }
  </code></pre>
  
  <p>I build and produce a libSimpleLib.a file, I place the .a and other files (referred by other posts in internet to mention need put in app folder) in app folder:</p>
  
  <p><a href="https://i.stack.imgur.com/fDSXb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fDSXb.png" alt="enter image description here"></a></p>
  
  <p>In the app project, I include the Libs path in FREAMEWORK_SEARCH_PATHS, LIBRARY_SEARCH_PATHS and HEADER_SEARCH_PATHS and include .a file in Linked Framework</p>
  
  <p><a href="https://i.stack.imgur.com/sNn6E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sNn6E.png" alt="enter image description here"></a></p>
  
  <p>However, when I attempt to refer the Greeting class in the AppDelegate, I got the error - Use of unresolved identifier 'Greeting'</p>
  
  <pre><code>//
  //  AppDelegate.swift
  //  testStatic
  //
  
  import UIKit
  import SimpleLib
  
  
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate {
  
     var window: UIWindow?
  
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
        // Override point for customization after application launch.
        var s = Greeting
        return true
     }
   ......
   }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/HO41p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HO41p.png" alt="enter image description here"></a></p>
  
  <p>How to make Swift objects in static library can be referred in the App.    What is the proper steps to export the class/functions in swift static library? 
  Anyone success to build and use swift static library in iOS app?</p>