In this small article I will tell you about the changes in the UIKit framework, which seemed to me important and useful. Immediately make a reservation - I have not yet had the opportunity to try out the innovations described, so the article is mainly theoretical.
NSAttributedString and UIKit
For a start, what I personally expected back in iOS 5 was support for NSAttributedString in text components - UILabel, UITextView, UITextField, as well as support for drawing strings with attributes and various helper methods for this. Of course, all this functionality was available before using Core Text, but working with Core Foundation-style APIs is still more difficult, so you can safely expect improved text formatting support (Rich Text) in many third-party applications. As an example, you can see the standard Mail application.
Auto Layout in iOS
A very important innovation - in iOS 6 will appear Auto Layout from MacOS Lion. Now it becomes easier to set the position of the interface components relative to each other. In short, Auto Layout allows you to set a set of constraints (constraints) connecting components, for example, allows you to set the size limits, the dependencies between components. I hope this will make it easier to create an interface for several languages (now sometimes you have to create a separate nib / storyboard), including Arabic with right-to-left writing, and also simplify the interface setting depending on the orientation of the device. Currently, there is no documentation for iOS on Auto Layout yet, we are offered documentation from MacOS.
UITableView Changes
UITableView, of course, could not be ignored. Added class UITableViewHeaderFooterView for defining user views of headers and footers of sections (header / footer). Also, when creating this class, you can set reuseIdentifier, in which case the UITableView will put the header in the queue for reuse. A nice innovation is the possibility of registering a class or a nib, which will be used to create the next table cell. The table delegate's protocol has been updated, now it allows you to find out when a table stops using a cell or footer for drawing, additional methods have also appeared for controlling the highlighting of cells. UITableViewController has got the refreshControl property that allows you to set the UIRefreshControl to update the table. Perhaps this control is pull to refresh, maybe it will be different.
')
UITableView Successor - UICollectionView
There was an interesting development of UITableView - UICollectionView, which allows you to set the location of data in several columns, in a circle, and so on. In general, the internal device is very similar to the table - there is a data source (data source) with a similar protocol, there is a delegate and a controller. But there are serious differences - this class initially works with the latest changes in the TableView, i.e. requires the registration of a class or nib, which will be used to create new cells and additional view (Supplementary View and Decoration View). There was also a general class UICollectionReusableView, from which both the cell class UICollectionViewCell and the classes used as additional ones are inherited. An important difference from the table is the UICollectionViewLayout class, which actually allows you to specify the location of cells and their appearance using attributes that are combined into the UICollectionViewLayoutAttributes class. It is interesting that, among other things, there are transform3D and zIndex attributes, which will allow you to create interesting locations of cells in three-dimensional space. Developers will need to create their own implementations of the UICollectionViewLayout class, or use the concrete implementation provided, which is the layout of the elements by the grid - UICollectionViewFlowLayout. Examples of use can already be seen in the screenshots of iOS 6 beta, for example, the interface for choosing how to share any information (Facebook, Twitter, Print, etc.) is most likely implemented on the basis of UICollectionViewFlowLayout.
UIActivityViewController - ShareKit replacement
The next interesting innovation is UIActivityViewController, which allows to simplify the sharing of data and replace third-party ShareKit and other analogues. When creating a controller, an array of objects is transferred, on which actions can be performed and an array of actions themselves. Currently supported are Facebook, Twitter, Weibo (how quickly China fell in love!), Sending data by mail using the Messages application, printing an object, copying an object on the Pasteboard, and setting the object (image) to a contact. It is also possible to create your own services.
UI State Preservation
Well, the last thing - UI State Preservation allows you to save the state and restore it when you restart. During saving, the application indicates which views and controllers are to be saved plus saves additional data, and when restored, the specified views and controllers will be restored. With proper use, this will make it even easier for users to work with iOS applications - no need to save, export, synchronize, remember what you did, etc., iOS provides more and more solutions for developers to make the work of users / customers even more pleasant.
Conclusion?
Well, a brief conclusion. I described the major, in my opinion, changes in the UIKit framework, although the rest of the frameworks received substantial changes, new frameworks appeared (Social, Pass Kit). And although each new version of iOS seems to be less and less significant, I attribute this to the maturity of the platform itself, because the current version of iOS provides tremendous opportunities, and it becomes more and more difficult to surprise developers. The same changes that Apple introduced will make it even more enjoyable for the user to communicate with applications, and it is these qualitative changes in iOS 6 that are in my opinion the most interesting for developers. The appearance of the Auto Layout from the older brother once again shows the influence of iOS and MacOS on each other. How long is it left to wait for them to merge and how will this happen?