Use of Codable and Coding Key with JSONEncoder and JSONDecoder in Swift 4

Codable is added with Xcode 9, iOS 11 and Swift 4. Codable is used to make your data types encodable and decodable for compatibility with external representations such as JSON.
Codable use to support both encoding and decoding, declare conformance to Codable, which combines the Encodable and Decodable protocols. This process is known as making your types codable.

Let’s Take an Example with Structure of Movie, here we have defined the structure as Codable. So, We can encode and decode it easily.

Read more

What's new in Xcode 8.3?

xcodeicon
Xcode 8.3

Swift 2.3 Deprecation

  • Xcode 8.3 beta 2 no longer supports Swift 2.3. Please migrate your projects containing Swift 2.3 code to Swift 3 syntax by opening the project and choosing Edit > Convert > To Current Swift Syntax.

Other Deprecations and Removal Notices

  • The Automation instrument has been removed from Instruments. Use Xcode’s UI Testing in its place.

Organizer

  • The Xcode Organizer now supports exporting tvOS apps for Enterprise distribution.

Testing

  • Added the XCUISiriService class to XCTest for writing tests which activate Siri with a voice recognition string, and queries for elements in the Siri UI. Use the class to write UI tests for Intents and Intents UI extensions.

Swift Compiler

  • The Swift compiler can now automatically precompile Objective-C bridging headers, which can speed up Debug configuration builds (or other non-WMO builds) of mixed-source projects with large bridging headers. This feature is still experimental, and is disabled by default but can be enabled with the “Precompile Bridging Header” (SWIFT_PRECOMPILE_BRIDGING_HEADER) build configuration setting within Xcode.

Provisioning

  • Changed the user interface for managing signing certificates and provisioning profiles. Certificates are managed from the Accounts preferences pane by selecting a team and clicking Manage Certificates. Automatically managing signing is recommended, however if your app requires manually signing provisioning profiles are managed in the General tab of the project editor. Use the Provisioning Profile dropdown to import or download profiles. In addition it displays profiles that match the current signing configuration of the target.

Simulator

  • You can invoke Siri using Hardware > Siri after enabling Siri in the Settings app on Simulator.

Others

  • Xcode 8.3 includes Swift 3.1 which is intended to be source compatible with Swift 3.0.
  • Constrained extensions allow same-type constraints between generic parameters and concrete types. For example, the following code defines an extension on Array with Int elements:
  • The Swift compiler now raises an error for modifications of a let property or variable of protocol type after initialization. For example, the following code that compiled in previous versions will now raise an error:

    Code that successfully compiled in previous releases may fail after upgrading.

Interface Builder

  • NSTextField objects created in Interface Builder now have allowsCharacterPickerTouchBarItem turned off by default.

Currently latest beta version is Xcode 8.3 Beta 3. I will update this blog as per versions of Beta.
Happy Coding 🙂

SwiftGoingFaster by Precompiled Bridging Headers

Faster Mix-and-Match Builds with Precompiled Bridging Headers

apple_swift_logo

PROBLEM :
Every time a Swift file in a mixed-language target is compiled, the Swift compiler parses the project’s bridging header in order to make Objective-C code visible to Swift code. When the bridging header is large and the Swift compiler runs many times – as in a debug configuration – the cost of repeatedly parsing the bridging header can be a substantial part of the overall build time.

In Swift 3.1, you can reduced debug build time by 30% by using the new -enable-bridging-pch Swift flag for this issue. This mode is still experimental and must be manually enabled, but it will be enabled by default if developer feedback indicates it’s working well and providing significant speedup… so try it out!

Build Settings
Build Settings

Related Link : Faster Mix-and-Match Builds with Precompiled Bridging Headers
Happy Coding 🙂