Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

FutureWorkshops/RANDA-RulesOfGolf-iOS-SDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RANDA-RulesOfGolf-iOS-SDK

Rules of Golf SDK allows you to display some elements from the Rules of Golf official app.

Import using Cocoapods

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

Adding the license

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.

Screenshot 2023-01-25 at 14 46 52

Using the Rules of Golf framework

Import the framework

Add the following at the top your view controller.

Swift:

import RANDARulesOfGolf

Objective-C:

#import “RANDARulesOfGolf/RANDARulesOfGolf.h”

Changing the language

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];

Showing the Rules of Golf Browser Screen

screenshot

Swift:

let rogBrowserNavigationController = ROGBrowserNavigationController()  
self.present(rogBrowserNavigationController, animated: true)

Objective-C:

ROGBrowserNavigationController *rogBrowserNavigationController = [[ROGBrowserNavigationController alloc] init];  
[self presentViewController:rogBrowserNavigationController animated:YES completion:nil];

Showing the Rules of Golf Search Screen

screenshot

Swift:

let searchNavigationController = ROGSearchNavigationController()  
self.present(searchNavigationController, animated: true)

Objective-C:

ROGSearchNavigationController *searchNavigationController = [[ROGSearchNavigationController alloc] init];  
[self presentViewController: searchNavigationController animated:YES completion:nil];

Showing the Rules of Golf Learn Screen

screenshot

Swift:

let learnNavigationController = ROGLearnNavigationController()  
self.present(learnNavigationController, animated: true)

Objective-C:

ROGLearnNavigationController * learnNavigationController = [[ROGLearnNavigationController alloc] init];  
[self presentViewController: learnNavigationController animated:YES completion:nil];