SDK for iOS Developer's Guide

Swift Support in HERE SDK

This section provides information on the ways that SDK for iOS supports development using Swift 3 or above. The Swift 4.2 is recommended for optimal operation.

Nullability Annotations

Where appropriate, properties, method parameters, and return types are marked with nullability annotations. This provides more clarity on the generated Swift types and avoids implicitly unwrapped optionals.

For more information on this read the blog post on "Nullability and Objective-C".

Designated Initializers

Where appropriate, class header files have annotatations to indicate the designated initializer method.

For more information see the documentation on initialization in Swift and initialization in Objective-C.

Suggested Names for Swift

HERE SDK contains suggested Swift method names to better align with standard Swift naming conventions. For example, createGeocodeRequestWithQuery:searchArea:locationContext: is create(query:searchArea:locationContext:) in Swift.

Attention: An API Reference containing Swift method names is not currently available. You can find Swift method names in header files.

For more information see the blog post on Swift API Design Guidelines.

Stronger Typing Using Lightweight Generics

Where appropriate, HERE SDK contains lightweight generics information for collection types. This provides stronger typing in the generated Swift code. For example, referenceIdentifiers(forSource:) method in NMAPlace returns [String] rather than an [AnyObject].

For more information see Importing Objective-C Lightweight Generics.