Monday, October 14, 2013

What's New in XCode 5 Part 2

What's New in XCode 5 Part 2

In Part 1 of this series we had discussed about:
  • Documentation
  • Performance
  • SourceControl
  • Automatic Configuration
in XCode 5. Today we will discuss about more in features of XCode 5.
  • Interface Design XCode 5 brings great new features in the Interface Design. 
    • AutoLayout Its not a new technology but it is really important. It allows your application to respond to the dynamic change in the layout constraints. Example is resolution in increase in iPhone 5 or in case of localization the strings change their size. Now in XCode 5 you can add new Constraint or Delete a constraint whenever you want it. XCode even add the constraints automatically to help you out.                 
    • Image Slicing Building on Asset Catalog this is a new feature. It make it easy for you to resize the images. 
  • Compiler and Language XCode 4 supported 2 different Compilers "Apple LLVM Compiler  and "llvm-gcc 4.2". XCode 5 focus on single Compilter Technology "Apple LLVM 5". So Whats new in Apple LLVM 5 Compiler
    • Modules Before explaining what is module. I would like to discuss why do we need module? So previously when we include header files in the .m file than all the translation code is combined in this one file, and my .m file have 100 lines of code but with these .h files it becomes 10s of thousands. 
We do have precompile headers but why do we need to handle all these when this should be handled by Compiler. This is where Module comes into picture. A Module is a single optimised database for system header files. So instead of going through tons of lines of code now code will do a query to the module. So this optimised database is shared across multiple .m files as shown.

How Modules help us?
- Reduced .pch management.
- Automatically link Frameworks.
- Faster Build, Analyze and index.

Modules can be easily enabled in the build settings.
    • C++ 11 XCode 5 supports all the c++ 11 language and Library features like
      • Generalized attributes
      • User Defined Literals
      • Inheriting Constructors
      • Alignment - alignas/alignof
      • Unrestricted Unions
      • UCNs in Literals.
  • Auto-Vectorizer  Auto-Vectorizer finds the code in your app where you are doing maybe 32 operations at a time. Auto-Vectorizer is all about performance. you can see massive increase in the speed. Auto-Vectorizer supports both ARM and Intel Chips and also include support to the new AVX 2 instruction set.  
  • Parsing the Comments Now the new compiler also parse the comments in your code.. hmmm.. Why would we do that. Now the XCode can extract documentation for your APIs from your code only... wow... So Now when you working with the third party APIs you would request them to comment the APIs.. :) The Documentation will just look like the XCode documetation.

So Keep visiting and commenting.....

Happy Coding..

No comments:

Post a Comment