• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: exposing only what you want - headers and Swift?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exposing only what you want - headers and Swift?


  • Subject: Re: exposing only what you want - headers and Swift?
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 25 Jun 2016 12:57:28 -0700
  • Feedback-id: 167118m:167118agrif8a:167118s2x54ZF2sB:SMTPCORP

On Jun 25, 2016, at 12:48 , William Squires <email@hidden> wrote:

how would I give them to someone else once I was done, without exposing everything in the swift implementation? Is there some magic tool that'll make a swift file that has only (public) interface information? My guess is yes, since I occasionally run into these when using the assistant editor pane

The answer comes in two parts:

1. For a library of “stuff”, you do the same with Obj-C: provide a framework. Like modern Obj-C frameworks, this is a module with the object code and “header” declarations.

AFAIK, there’s no Swift equivalent of a static library (.a) or of handing over a bunch of raw object files (.o). If nothing else, these have always had an inferior Xcode experience.

The only thing to keep in mind is that different versions of Swift are not ABI compatible. Whatever form you supply your stuff to someone else, they must be using the same version of Swift. 2.2, 2.3 and 3.0 are all different versions in ABI terms.

2. The code you see in the assistant editor is a “generated header”. That is, it doesn’t really exist, but is reconstructed by Xcode as pseudo-source code from the information in the module file.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: exposing only what you want - headers and Swift?
      • From: Quincey Morris <email@hidden>
References: 
 >exposing only what you want - headers and Swift? (From: William Squires <email@hidden>)

  • Prev by Date: exposing only what you want - headers and Swift?
  • Next by Date: Re: exposing only what you want - headers and Swift?
  • Previous by thread: exposing only what you want - headers and Swift?
  • Next by thread: Re: exposing only what you want - headers and Swift?
  • Index(es):
    • Date
    • Thread