question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to export MyLibrary-Swift.h header from apple_library()

See original GitHub issue

I have a library that has Swift and Objective-C code. Some Swift classes I want to export to Objective-C, I see that buck correctly generates MyLibrary-Swift.h for all classes marked as @objc, however I don’t see a way export this header from my library, so that I can used it in my dependencies. Is this possible?

@nguyentruongtho

apple_library(
    name = 'MyLibrary',
    srcs = [
        'ObjC.m',
        'SwiftKit1.swift',
        'SwiftKit2.swift'
    ],
    exported_headers = [
        'ObjC.h',
        'MyLibrary-Swift.h' <---------------------------------------- this doesn't work
    ],
    visibility = ['PUBLIC']
)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gontovnikcommented, Jul 7, 2017

@nguyentruongtho, could you please let me know what is the latest status on that? I’d love if you could ping me on Messenger: http://m.me/gontovnik

Thanks!

1reaction
nguyentruongthocommented, Nov 10, 2016

This is part of the ongoing work for creating module from a target, but I guess it can solve your problem already: https://github.com/nguyentruongtho/buck/tree/tho/swift_exported_header

You can find very dummy poc sample here: https://github.com/nguyentruongtho/buck_swift_test/tree/master/swift_export_headers

Run: rm -rf buck-out && buck run :parent#macosx-x86_64

Let me know if you find any edge cases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importing Project-Swift.h into a Objective-C class...file not found
I found a new way to find the correct generated header file name: go to your target -> Build Settings -> Search keywords...
Read more >
Importing Swift into Objective-C - Apple Developer
Overview. You can work with types declared in Swift from within the Objective-C code in your project by importing an Xcode-generated header file....
Read more >
Framework header file not found error in Xcode 8 editor
So in my case, everything is Swift. Swift app using a Swift framework. The Swift framework generates the .framework file and sticks it...
Read more >
Xcode12: Application Target's "Module-Swift.h" File Not Found
I went through and commented out all of our ObjC code that references our Swift code and commented out all imports of the...
Read more >
umbrella header not found | Apple Developer Forums
I fixed this by deleting my Project.h using Xcode (with move to trash) and then recreating it. Posted 7 years ago by. bartleby....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found