This repository will not be updated. The repository will be kept available in read-only mode.
In this code pattern, you will create an iOS weather forecasting app using Apple Maps and the Weather Company Data service. Use this service to consume current conditions or hourly, daily, and intraday forecasts based on Apple Maps geolocation coordinations of your user's device. Use this pattern to solve real business problems where weather has a significant impact on the outcome.
When you have completed this code pattern, you will understand how to:
- Provision and integrate the Weather Company Data service
- Use Geolocation information integrated with Apple Maps
- Connect to additional IBM Cloud services
As an alternative to the steps below, you can create this project as a starter kit on IBM Cloud, which automatically provisions required services, and injects service credentials into a custom fork of this pattern. Then, you can skip directly to step 4 below.
Ensure you have the required developer tools installed from Apple:
- iOS 8.0+
- Xcode 8.0
- Swift 3.0
This starter uses the IBM Cloud Mobile services SDKs to use the functionality of the Mobile Analytics, Push Notifications, and Weather services.
The IBM Cloud Mobile services SDK uses CocoaPods to manage and configure dependencies. To use our latest SDKs, you need version 1.1.0.rc.2.
Install CocoaPods using the following command:
$ sudo gem install cocoapods --pre
If the CocoaPods repository is not configured, run the following command:
$ pod setup
For this starter, a pre-configured Podfile
is included in this repository. To download and install the required dependencies, run the following command in this repository:
$ pod install
Open the Xcode workspace: {APP_Name}.xcworkspace
. Continue to open the .xcworkspace
file as it contains all the dependencies and configurations.
If you run into any issues during the pod install, it is recommended to run a pod update by using the following commands:
$ pod update
$ pod install
Use the IBM Cloud Catalog and create a Weather Company Data service instance.
A WeatherCredentials.plist
configuration file is included in the Xcode project that includes credential configurations for Weather service. Find the credentials for your WeatherCredentials.plist
file by clicking the Service Credentials button:
Click Product > Run to start the app in Xcode.
The application allows you determine the forecast of any location using your Weather instance on IBM Cloud. Long click to view the forecast.
This code pattern is licensed under the Apache License, Version 2. Separate third-party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 and the Apache License, Version 2.