Skip Navigation

Limitations and best practices when using 
Swift

The 
BlackBerry Dynamics SDK for iOS
 is compatible with the 
Swift
 programming language. For supported versions, see the Software requirements
Note the following limitations and best practices:
Item
Description
Xcode
 template
The easiest way to use 
Swift
 with the 
BlackBerry Dynamics SDK
 is to create a new 
Xcode
 project with the Single View template that includes all necessary frameworks and compile-time directives. For more information about creating the template, see Create an Objective-C or Swift project with the Xcode template.
You can include your 
Swift
 source files into the project and build with 
Xcode
.
Sample apps
The 
BlackBerry Dynamics SDK
 includes the following sample apps in 
Swift
. The sample apps are stored in ~/Library/Application Support/BlackBerry/Good.platform/iOS/Examples/. The 
Swift
 3 versions are located in the "swift" folder, and the 
Swift
 4 versions are located in the "swift4" folder. 
iPhone
 X is the default device for the 
Swift
 4.0 sample applications.
  • RSSReaderSwift: This sample demonstrates how to use the 
    BlackBerry Dynamics
     Secure Communication APIs for basic networking. It shows how to use 
    GET
     with the 
    GDHttpRequest
     API (with and without authentication) and the 
    GDNSURLSesssion
     API. For session management, only 
    GDNSURLSesssion
     sharedSession is supported.
  • ServicesServerSwift and ServicesClientSwift: This sample provides a complete client/server app that demonstrates how to implement a service with the Shared Services Framework. The service enables secure communication between two apps. The ServicesServerSwift app provides the service and works in conjunction with the ServicesСlientSwift app, which calls the service. The samples also demonstrate how the file transfer service is used with the ServicesServeSwift app.