Latest 1.2.3
Homepage https://github.com/onesky/onesky-for-ios
License MIT
Platforms ios 9.0
Dependencies Siesta, Ably
Authors

OneSky SDK

Online localization resolver.

One Sky manager implement online localization for iOS application. SDK simply create .strings files in your application.

You can watch video here:

Watch the video

Features

  • Swift 3+
  • iOS 9.0+
  • Xcode 9.0+
  • Cocoapods

Installation

Refer to https://developers.onesky.app/docs/ios-installation

Usage example

To get the full benefits import OneSky

import OneSky

There are two ways of using framework. For both you need to implement:

fileprivate var localizationManager: OneSkyManager? = OneSkySource()

You should implement localization in override func viewWillAppear(animated:) function, like:

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        firstLabel.text = "top".localized
        secondLabel.text = "ask".localized
        ...
    }

where .localized extension is our framework feauture.

Then:

  • With UI

    If you are going to use framework custom Settings UI then you need to implement the code below in your button handler.

    // your Button handler
    func buttonPressed() {
    localizationManager?.open(from: self, style: .push)
    }

    This code implement delegate method ehich open OneSky custom UI. Available styles:

    • .push – Implement push presentation style (your viewController should have navigationController in stack)
    • .present – Implement simple present presentation style
    If you want to use userId then write this code below:
    // your Button handler
    func buttonPressed() {
    localizationManager?.open(from: self, style: .push, userId: userId) // where userId: Int value of your user id 
    }

    There is no need to do smth else. Framework will make everything by his own.

  • Endpoints only

If you want to use endpoint only, there is a short guide of available delegate methods.

  • weak var delegate: OneSkyDelegate? { get set } – Implement delegate, which implements the methods that the SDK returns. More details can be found in the documentation in the code.
  • var currentLanguageCode: String? { get } – Returns current device language locale code

  • func getAvailableLocales() – Makes a request for a common application configuration. For now using hardcode AppId.
  • func getUserPreferences(with userId: Int) – Makes a request for a specific user preference.
  • func sendUserSettings(with userId: Int, preferences: UserSettings) – Makes a POST request to upload specific user preference. Also use it to create a new user!
  • func translate(locale: Locales) – Translate text and save new .strings file in the new Bundle. You must pass Locales structure in the parameters of function. Structure should implement the language you want TO translate.

Latest podspec

{
    "name": "OneSky",
    "version": "1.2.3",
    "summary": "The OneSky iOS SDK, for integrating OneSky into your iOS application.",
    "description": "OneSky for iOS helps developers actualize cross-platform localization experience quickly with out-of-box solutions. Save hundreds of hours in finding and trying out best practices. You can mix-and-match building blocks with your own implementations if needed.",
    "homepage": "https://github.com/onesky/onesky-for-ios",
    "license": {
        "type": "MIT",
        "file": "OneSky/license"
    },
    "platforms": {
        "ios": "9.0"
    },
    "authors": {
        "OneSky": "[email protected]"
    },
    "source": {
        "git": "https://github.com/onesky/onesky-for-ios.git",
        "tag": "1.2.3"
    },
    "source_files": [
        "OneSky/*.swift",
        "OneSky/API/*.swift",
        "OneSky/API/Delegates/*.swift",
        "OneSky/API/Manager/*.swift",
        "OneSky/API/Services/*.swift",
        "OneSky/API/Structures/*.swift",
        "OneSky/API/Manager/ResponseTransformers/*.swift",
        "OneSky/API/Controller/*.swift",
        "OneSky/API/Controller/SelectCell/*.swift"
    ],
    "dependencies": {
        "Siesta": [
            "~> 1.3.0"
        ],
        "Ably": []
    }
}

Pin It on Pinterest

Share This