Rules of Golf SDK allows you to display some elements from the Rules of Golf official app.
For now the only way to integrate the framework is by using CocoaPods.
You should first be invited to the Private Podspecs repo for the Rules of Golf Framework.
Add the repo to your podspecs repositories using the following:
pod repo add RANDA-RulesOfGolf-iOS-PodRepo [email protected]:FutureWorkshops/RANDA-RulesOfGolf-iOS-PodRepo.git
At the top of your Podfile
you should have least those sources:
source '[email protected]:FutureWorkshops/RANDA-RulesOfGolf-iOS-PodRepo.git'
source 'https://cdn.cocoapods.org/'
Add the following to your Podfile
:
pod 'RANDARulesOfGolf'
Add the following post install script, else the framework won't build. More info here.
post_install do | installer |
installer.pods_project.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
Finally run the following command:
pod install
Rules of Golf framework is a private framework. In order to use it, you need to obtain a license.
To obtain a license, please provide the bundle identifiers of the apps that will use the framework.
This license file randa-rog.license
needs to be added to the main bundle of your app.
Add the following at the top your view controller.
Swift:
import RANDARulesOfGolf
Objective-C:
#import “RANDARulesOfGolf/RANDARulesOfGolf.h”
The ROG Framework will attempt to choose the language based on the supported languages of your app and the user preferences. If that doesn't work you have the option of setting the language yourself.
Swift:
ROGSDK.setLanguage(language: .french)
Objective-C:
[ROGSDK setLanguageWithLanguage:AppLanguageFrench];
Swift:
let rogBrowserNavigationController = ROGBrowserNavigationController()
self.present(rogBrowserNavigationController, animated: true)
Objective-C:
ROGBrowserNavigationController *rogBrowserNavigationController = [[ROGBrowserNavigationController alloc] init];
[self presentViewController:rogBrowserNavigationController animated:YES completion:nil];
Swift:
let searchNavigationController = ROGSearchNavigationController()
self.present(searchNavigationController, animated: true)
Objective-C:
ROGSearchNavigationController *searchNavigationController = [[ROGSearchNavigationController alloc] init];
[self presentViewController: searchNavigationController animated:YES completion:nil];
Swift:
let learnNavigationController = ROGLearnNavigationController()
self.present(learnNavigationController, animated: true)
Objective-C:
ROGLearnNavigationController * learnNavigationController = [[ROGLearnNavigationController alloc] init];
[self presentViewController: learnNavigationController animated:YES completion:nil];