I am using Xcode 9.2 and trying to build a Swift Static Library of one .swift file but when I compile it does not produce the ProductName-swift.h file.

I am using Xcode 9.2 and trying to build a Swift Static Library of one .swift file but when I compile it does not produce the ProductName-swift.h file. I have added the @objc tag to the class and Yes to define modules. This worked once, but then it never updated the swift.h file when I made changes to the .swift file. Here is the simple swift code:


//

// UserWebViewController.swift

// CustomSwiftLibrary

//

// Created by David Smaltz on 1/11/19.

// Copyright © 2019 David Smaltz. All rights reserved.

//


import Foundation

import UIKit


@objc class UserWebViewController: UIViewController {

weak var webView: UIWebView!


//var webView: UIWebView!


override func viewDidLoad() {

super.viewDidLoad()

setupUI()

let url: URL = URL(string: "http://yahoo.com")!

webView.loadRequest(URLRequest(url: url))

}

}


extension UserWebViewController {


func setupUI() {

view.backgroundColor = .white

}


}

Replies

Sorry to respond to my own question but I have found something that might be the issue. i have found a file calle "all-product-headers.yaml" in the devrived data directory and it has the following values:


{

'version': 0,

'case-sensitive': 'false',

'roots': [

{

'type': 'directory',

'name': "/Users/david_smaltz/Documents/afsLibrary/CustomUserLibrary/CustomUserLibrary/DerivedData/CustomUserLibrary/Build/Products/Debug-iphoneos/Modules",

'contents': [

{

'type': 'file',

'name': "module.modulemap",

'external-contents': "/Users/david_smaltz/Documents/afsLibrary/CustomUserLibrary/CustomUserLibrary/DerivedData/CustomUserLibrary/Build/Intermediates.noindex/CustomUserLibrary.build/Debug-iphoneos/CustomUserLibrary.build/module.modulemap"

}

]

},

{

'type': 'directory',

'name': "/Users/david_smaltz/Documents/afsLibrary/CustomUserLibrary/CustomUserLibrary/DerivedData/CustomUserLibrary/Build/Products/Debug-iphoneos/include",

'contents': [

{

'type': 'file',

'name': "CustomUserLibrary-Swift.h",

'external-contents': "/Users/david_smaltz/Documents/afsLibrary/CustomUserLibrary/CustomUserLibrary/DerivedData/CustomUserLibrary/Build/Products/Debug-iphoneos/usr/local/include/CustomUserLibrary-Swift.h"

}

]

}

]

}


I can't get to the direcotry, so I am wondering if there is an issue with project settings or file system.

Problem solved. This was an iCloud issue and it has been resolved.