Re: [swift-evolution] #available has a huge anti-pattern.
Re: [swift-evolution] #available has a huge anti-pattern.
- Subject: Re: [swift-evolution] #available has a huge anti-pattern.
- From: Charles Srstka <email@hidden>
- Date: Wed, 03 Feb 2016 19:27:51 -0600
On Feb 3, 2016, at 3:29 PM, James Campbell <email@hidden> wrote:
>
> We could only allow objective c methods to be queried by responds to
But then the check is faulty, because it can find private methods.
> But how do we handle Linux or any of the other platforms are you saying we need to annotate with a million OS version specifies
If you’re checking to see whether a library contains an API or not, you probably only care about the library version rather than the OS itself.
Charles
> Sent from Outlook Mobile <https://aka.ms/qtex0l>
>
>
>
> On Wed, Feb 3, 2016 at 1:18 PM -0800, "Charles Srstka" <email@hidden <mailto:email@hidden>> wrote:
>
>> On Feb 3, 2016, at 3:07 PM, James Campbell via swift-evolution <email@hidden <mailto:email@hidden>> wrote:
>>
>> I think if we did feature detection it should ignore private methods not accessible by the code querying its accesbility. Additionally we really do need proper support across platforms.
>
> How is that going to work, though? Most of the system APIs are in Objective-C, which has no distinction between private and public methods at runtime.
>
> I think #available is fine as-is, especially since the compiler is able to detect if you’re using an API that’s not appropriate for the OS X version you’re specifying.
>
> Charles
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden