📜 ⬆️ ⬇️

WWDC15. Second day. Details

After the surface announcements of the first day, it is time for full-fledged sessions for developers in which Apple engineers talk about new features, frameworks and technologies. The second day is almost entirely devoted to the announced features of the main platforms and development tools.



The material will be interesting first of all to developers for iOS and Mac OS platforms, but perhaps everyone will like something here.

watchOS 2


The Watch App and the WatchKit Extension code set now live in the same place on the clock (before the extension was on the phone and created a mountain of problems with it). And this is not an option, but an obligation. Such native applications for watches have solid advantages: access to hardware (Digital Crown, microphone, speaker, accelerometer, etc.), autonomous operation, the absence of brakes and the "eternal spinner", real-time operation. Nevertheless, the application for watches is still obliged to be part of a full-fledged application for the phone, it cannot be separately distributed.
')
The connection between the phone and the clock is now implemented using the WatchConnectivity Framework . In fact, this is a bus to which you can send messages back and forth with text or files. In addition to this method of receiving information, the watch can use all the functions of the NSURLSession, that is, independently get on the Internet and download data. Even in the absence of a phone, this happens via WiFi.

Added setters for all settings (properties) of all interface elements of the clock. This means that you can now manage the interface from the code and change it “on the fly”, and not only during the development of the design in the interface builder, as it was before. The WatchKit also now adds animations using the animateWithDuration tool . You can animate all the settings that appeared in the system. Compared to image sequencing animation from watch OS 1, this is already something.



Our applications can duplicate interface events using the taptic engine . A whole set of various “start-ups” is available: Notification, Start, Stop, DirectionUp, DirectionDown, Click, Failure, Success.
Watch can now play video . The Coub watch prototype, which was announced six months ago, can now become true, not just a fairy tale.
The openSystemURL methods have been added to the watchKit SDK. Using them, third-party applications can make calls, send messages, etc., and all this, without leaving the clock interface.

Watch Keychain , which stores all the same passwords as on the phone, is automatically unlocked when the watch is on hand, and is locked when it is removed. This solves a whole heap of problems that we encountered when developing the application of My Beeline, you can sympathize .

The new ClockKit framework is made for the development of Complications - gadgets on the clock face, displaying any data. Interestingly, the data from our complications is not requested one by one, but by the timeline vector. Due to this, TimeTravel appears - an opportunity to turn the wheel and see what happened 3 hours ago or will be in 10 hours. Pretty cool feature.

Objective C and Swift


For the announced Swift 2, the migrator is already ready, which will gently and accurately adjust the projects for new designs. They promise that everything will happen automatically, but you can hardly trust such a Swift compiler developer:



Playgrounds Swift Playgrounds have many opportunities that will allow you to create programming tutorials directly in them. This support for markdown markup in the comments (with pictures, selection and layout), multi-page projects, the ability to connect external libraries (which are even precompiled so that the playground does not slow down). The error handling mechanisms have been reworked, the autocomplete has been improved, and the API has been added to conveniently invoke new methods so that it will in no way break on the old OS. In general, the language is developing quite actively, and so much the better, that it will soon be laid out in openSource.

At the same time, a lot of things were added in objectiveC so that it could be better combined with the swift and was convenient in itself.

For example, directives have been added to combine swift optionals with traditional nil objects: nonnull (a property can never become nil'om), nullable (can), null_resettable (this property can be set to nil, but it will never return it, but return default value instead).

Added generics to all ObjC collections:
NSArray <NSString *> *array 

There is even a special __kindof keyword to refer to collections that can store not only objects of a class, but also its subclasses (especially convenient for interface frameworks):
 NSArray <__kindof NSView*> *array 

iOS 9 and Xcode


In iOS, added the things that many have waited (or did not really expect):

Many announcements at the conference have not yet been fully disclosed, but we will keep you posted. Stay tuned!

See also the overview report from the first day of the conference: WWDC15. The first day. Keynote

Source: https://habr.com/ru/post/259975/


All Articles