927
WWDC 2014. News Environment
On the third day of WWDC were more technical and less "intriguing» session (Integrating Swift with Objective-C, What's New in LLVM , Cross Platform Nearby Networking, Creating Custom iOS User Interfaces, etc.), master classes on the use of components and dive into the Swift.
Report Arthur mc_murphy Sakharov, Redmadrobot
Session Integrating Swift with Objective-C
B> Swift very cool integrated into current objC-projects. It can be seen that Apple this question very serious consideration - all to developers soon switched to Swift. The project can be written simultaneously in two languages. When objC-added to the project first .swift-file, Xcode creates a so-called Bridging Header - this is what will be seen from custom objC-classes in the Swift-code. Very similar to the precompiled header in objC-project. All frameworks can be seen without it. Well, of objC-code seen all Swift. Pretty simple and straightforward, and easy to manage all. When Swift call their own class method, no need to write self. That is self.view turns into a view. Well, finally. All syntax objC-class broadcast in Swift on the fly. Write files to the class MyClass on objC, switch to another window with the Swift-code and a hint class MyClass will immediately look as if it were written on Swift. Without recompiling, all on the fly. Comes to the fact that the translation on the fly gets up such things automatically: InitWithData: (NSData *) data type: (NSString *) type ⟷ init (data: NSData, type: String), that is automatically removed / substituted With init-in designs. Finally a general rule - of objC-code all Swift-code looks like objC. Of Swift-code all objC-code looks like Swift. Documentation, comments, syntax - all translated automatically. SESSION Building Adaptive Apps with UIKit
B> iOS 8 simplifies the layout of the sprawling family of devices (iphone 4/5, ipad, different orientations). All cases of imposition on all devices reduced to 4 varieties: Horizontal and vertically can be either Compact, Normal or layout (this parameter is called sizeClass). That is, for each twist can be separately provided in the form of these four cases: compact width, normal height
compact width, compact height
normal width, compact height
normal width, normal height
I> And that's enough for all devices and all orientations. And all this can be done in one mouse storyboards.
Navbary automatically hidden or reduced when there is insufficient space in the landscape status bar is hidden at all. In the simulator appeared resizable ipad and resizable iphone - that is, you can just set the screen size in pixels and all at once on the fly will pereverstyvatsya. Convenient to debug. Apple is clearly up to something with different screen sizes for iOS ... In the Asset UIImage added for this case special collections (TraitCollections), where a picture is selected according to the current size of the element on the screen. That is, forget about the @ 2x, now a dynamic layout, in addition to the retina / Neretina appeared aypad / neaypad and horizontal / vertical. And based on all this will be selected teksturka. In the IB added all sorts of things that let you create constraints separately for different sizes / orientations. Thus, the elements can now be positioned vertically in portrait and landscape orientations horizontally without adding a single line of code. In general, all this creation interface looks pretty clear and convenient. All of this is great, you can view in IB on the fly. Open just a lot of devices and observe how they behave when changing constraints, without compiling and running. SESSION Swift Playgrounds
Playgrounds - is generally a breakthrough in the development process. Playgrounds a lot of things collected in a convenient form.
We want to test something, some kind of feature. Instead of having to create an empty project and something in him to write, set up and run many times - it's like to open a notepad and interactively check everything.
What is Swift Playground?
Playground - this is a document format for Xcode. It includes code files and resources. Each time you change the code, it automatically starts up and immediately appears the result. And the code, and the result is displayed in a single window, side by side. < / Why Playgrounds?
Learn a new language To get acquainted with the online documentation Teach novice development in general Fast prototyping algorithms and test them write code that draws something, without its launch every time To visualize any code that calculates something For the experiments with the API and games frameworks What are able Playgrounds?
They can be in any line of code to see objects in QuickLook. They are rendered UITableView, and when the code is changed immediately visible changes. If there is something they do not render, you can write custom QuickLook for any in its class. You can debug asynchronous operations and watch the data from all of threads at once. It was a demo of how to develop algorithm insertSort in pleygraunde and illustrated for all steps of the algorithm. Impressive. What not to do in Playgrounds?
They do not support user interaction in any way, everything can be changed only through the code. It is only executed in the simulator, not on the device. You can not import their frameworks (but you can skopipastit code from them). WWDC 2014. First impressions witness a >
WWDC 2014. The cut of the second day
WWDC 2014. Report for Thursday
Source: habrahabr.ru/post/225369/
Report Arthur mc_murphy Sakharov, Redmadrobot
Session Integrating Swift with Objective-C
B> Swift very cool integrated into current objC-projects. It can be seen that Apple this question very serious consideration - all to developers soon switched to Swift. The project can be written simultaneously in two languages. When objC-added to the project first .swift-file, Xcode creates a so-called Bridging Header - this is what will be seen from custom objC-classes in the Swift-code. Very similar to the precompiled header in objC-project. All frameworks can be seen without it. Well, of objC-code seen all Swift. Pretty simple and straightforward, and easy to manage all. When Swift call their own class method, no need to write self. That is self.view turns into a view. Well, finally. All syntax objC-class broadcast in Swift on the fly. Write files to the class MyClass on objC, switch to another window with the Swift-code and a hint class MyClass will immediately look as if it were written on Swift. Without recompiling, all on the fly. Comes to the fact that the translation on the fly gets up such things automatically: InitWithData: (NSData *) data type: (NSString *) type ⟷ init (data: NSData, type: String), that is automatically removed / substituted With init-in designs. Finally a general rule - of objC-code all Swift-code looks like objC. Of Swift-code all objC-code looks like Swift. Documentation, comments, syntax - all translated automatically. SESSION Building Adaptive Apps with UIKit
B> iOS 8 simplifies the layout of the sprawling family of devices (iphone 4/5, ipad, different orientations). All cases of imposition on all devices reduced to 4 varieties: Horizontal and vertically can be either Compact, Normal or layout (this parameter is called sizeClass). That is, for each twist can be separately provided in the form of these four cases: compact width, normal height
compact width, compact height
normal width, compact height
normal width, normal height
I> And that's enough for all devices and all orientations. And all this can be done in one mouse storyboards.
Navbary automatically hidden or reduced when there is insufficient space in the landscape status bar is hidden at all. In the simulator appeared resizable ipad and resizable iphone - that is, you can just set the screen size in pixels and all at once on the fly will pereverstyvatsya. Convenient to debug. Apple is clearly up to something with different screen sizes for iOS ... In the Asset UIImage added for this case special collections (TraitCollections), where a picture is selected according to the current size of the element on the screen. That is, forget about the @ 2x, now a dynamic layout, in addition to the retina / Neretina appeared aypad / neaypad and horizontal / vertical. And based on all this will be selected teksturka. In the IB added all sorts of things that let you create constraints separately for different sizes / orientations. Thus, the elements can now be positioned vertically in portrait and landscape orientations horizontally without adding a single line of code. In general, all this creation interface looks pretty clear and convenient. All of this is great, you can view in IB on the fly. Open just a lot of devices and observe how they behave when changing constraints, without compiling and running. SESSION Swift Playgrounds
Playgrounds - is generally a breakthrough in the development process. Playgrounds a lot of things collected in a convenient form.
We want to test something, some kind of feature. Instead of having to create an empty project and something in him to write, set up and run many times - it's like to open a notepad and interactively check everything.
What is Swift Playground?
H5>
Playground - this is a document format for Xcode. It includes code files and resources. Each time you change the code, it automatically starts up and immediately appears the result. And the code, and the result is displayed in a single window, side by side. < / Why Playgrounds?
H5>
Learn a new language To get acquainted with the online documentation Teach novice development in general Fast prototyping algorithms and test them write code that draws something, without its launch every time To visualize any code that calculates something For the experiments with the API and games frameworks What are able Playgrounds?
H5>
They can be in any line of code to see objects in QuickLook. They are rendered UITableView, and when the code is changed immediately visible changes. If there is something they do not render, you can write custom QuickLook for any in its class. You can debug asynchronous operations and watch the data from all of threads at once. It was a demo of how to develop algorithm insertSort in pleygraunde and illustrated for all steps of the algorithm. Impressive. What not to do in Playgrounds?
H5>
They do not support user interaction in any way, everything can be changed only through the code. It is only executed in the simulator, not on the device. You can not import their frameworks (but you can skopipastit code from them). WWDC 2014. First impressions witness a > WWDC 2014. The cut of the second day
WWDC 2014. Report for Thursday
Source: habrahabr.ru/post/225369/
WWDC 2014. The cut of the second day
Modio: children's app for designing toys to print on a 3D printer