iOS Native Template Apps
Mobile SDK 9.0
updates its default Swift template to iOS 14 standards and maintains its Objective-C template
from the previous release.
Here’s a comparison summary of the forceios default templates.
- Swift Template
-
- iOSNativeSwiftTemplate
- Demonstrates two levels of master-detail navigation.
- Uses SwiftUI for all views
- Demonstrates model-view architecture
- Distributes management of app life-cycle events between AppDelegate and SceneDelegate
- Handles asynchronous REST responses with various Combine Publisher objects
- Demonstrates offline features using SmartStore and Mobile Sync
- Objective-C Template
-
- iOSNativeTemplate
- Displays a single list of contacts
- Manages app life-cycle events through AppDelegate
- Handles asynchronous REST responses in SFRestDelegate
You can find both templates in the github.com/forcedotcom/SalesforceMobileSDK-Templates repo. How you use them with
forceios is slightly different.
- To select the native Swift application type, press Return or type
native_swift:
1$ forceios create 2Enter your application type (native_swift or native, leave empty for native_swift): <Press Return> 3... - To select the Objective-C application type, type native:
1$ forceios create 2Enter your application type (native_swift or native, leave empty for native_swift): native 3...
Using Other Templates
Mobile SDK also
offers the following specialized iOS templates.
You use these templates with the forceios
createwithtemplate command. For example, to create an app with the Swift encrypted
notifications template:- MobileSyncExplorerSwift
- A more extended example of Mobile Sync technology. Includes a Recent Contacts widget implementation. Also demonstrates iPad features, including multiple windows and landscape orientation support.
- iOSIDPTemplate
- For creating identity provider apps with Mobile SDK.
- iOSNativeSwiftEncryptedNotificationTemplate
- Demonstrates how to process encrypted notifications.
-
1$ forceios createwithtemplate 2Enter URI of repo containing template application: iOSNativeSwiftEncryptedNotificationTemplate 3...