Saturday, 15 September 2012

ios - Why does Selector exist in swift -


Why did Apple choose to continue using the selector type, fully enabled of Swift Instead of doing this:

  UILongPressGestureRecognizer (target: auto, verb: "showSomething:")  

Anyone can do this:

  UILAnotherGetter Detector (Show Some)  

And if you have a representative:

  UILongPressGestureRecognizer (Delegate.showSomething)  

Does Apple Have More of Swift? In sorrow implementation of a string to indicate the function instead of using the capabilities have decided to choose?

This is a legacy compatibility

The API, which you use as an example As it was, it was written in Objective-C, and even then. It is entirely possible to take advantage of the ability of Apple Swift to create a more accessible API, but they need to be rewritten by default in Swift, which is for the vast array of existing frameworks, Amp; Coco Touch will have to make huge amounts of time and effort.

It is possible that the apple can add the features of C-C, which improves the compatibility between languages ​​by availing the benefits of new swift facilities, while restricting its requirement to rewrite the framework, for example, In Xcode 6.3 Beta, they added the concept of "futility" for objective-c (see release notes), which influences the purpose-API API used in Swift code . Where Swift can improve the existing API, another example is with the default parameter ... maybe this purpose-c API can be described in some way?

I have non-objective-C (original swift) frameworks released by Apple in the future, but so far we are a little far away.


No comments:

Post a Comment