Swift framework

Good, a few months ago I had started learning Swift, but since I did not understand where the NSString classes came from, NSArray, for example, I stopped learning. Nowhere did I find the answer to my doubt, that's why I come here to ask them and ask if they would explain the following (I'm going to buy it with Java, because that's what I know):

1.What framework does Swift use?Which of all frameworks is like Java with the Standart Edition (SE)?. On the page Apple put the following: enter the description of the image here

As far as I understand the frameworks are 5... but inside each of them there are more or what are they?

enter the description of the image here

Another question, related to the same, I when using print ()...what object am I using??? The method of which instance or object is it?

 1
Author: MatiEzelQ, 2016-03-18

1 answers

You're confusing yourself with concepts. I will try to explain it to you in the simplest possible way:

For starters, Swift is not a framework but is a programming language, just like Objective-C, Java, or C++. Well, having this clear, a framework is nothing more than a series of methods/functions written in a specific language to simplify tasks, either because they are repeated often or because it would be complex to implement them.

A example of complex framework is CoreBluetooth. If you had to program on your own each of the functions carried by the framework, you would go crazy as it is low level hardware and it would be unfeasible. Instead, thanks to having a framework, just typing a few methods you can find iBeacons and interact with them, for example.

Well, what you show us in the images, are nothing more than all the frameworks that iOS incorporates for you to develop applications for Platform iOS. That is, MapKit allows you to interact with Apple Maps, HealthKit allows you to view mobile health data, UIKit interfaces, etc.

About the classes you mentioned, NSString or NSArray are part of the framework Foundation which is the basic framework you will need to be able to do basic operations with strings, for example.

And finally, because you do not understand that it is a class, do not be discouraged, go ahead and try to learn that in Internet you have it all!

 3
Author: mhergon, 2016-03-18 20:01:37