Latest 0.1.1
Homepage https://github.com/NomadeSolutions/DevOptions
License MIT
Platforms ios 9.0
Dependencies TRZSlideLicenseViewController, Toast-Swift, SnapKit
Frameworks UIKit, SafariServices
Authors

Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 9.0+
  • File "Pods-acknowledgement.plist" located in Target’s Pods directory.

Installation

DevOptions is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'DevOptions'

Usage

  1. Add the "Pods-acknowledgement.plist" file to your project. You can find this file in the Pods directory of your target (Pods -> Target Support Files -> Pods-YourTarget). Ensure that the file is in the "Copy Bundle Resources" of your target project.
    Note: Until a future version, you’ll need to do this manually each time you update your Pods.

  2. Configure the Pod in AppDelegate’s didFinishLaunchingWithOptions:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.

    let configurations = DevOptionsConfigurations()
    configurations.companyLogo = UIImage(named: "company_logo")
    configurations.companyWebsite = "https://www.nomadesolutions.com/"
    configurations.password = "1234"
    //configurations.mainStoryboardName = "Main" //In case you use storyboards
    //Other configurations are already set, but available for customization

    DevOptions.configure(configurations, baseUrls: [UIApplication.serverBaseUrl(), UIApplication.otherBaseUrl()]) {
        /* 
            What you want to do when the Developper Mode is activated or deactivated
        */

        // To update DevOptions view controller.
        DevOptions.baseUrls = [UIApplication.serverBaseUrl(), UIApplication.otherBaseUrl()]
    }
    return true
}
  1. Add the EndorsementView to your UI:

Programmatically:

let endorsementView = EndorsementView()
view.addSubview(endorsementView)

endorsementView.snp.makeConstraints { (make) in
    make.left.equalTo(view.snp.left)
    make.right.equalTo(view.snp.right)
    make.bottom.equalTo(view.snp.bottom)
}

or:

let endorsementView = EndorsementView(CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 60))
view.addSubview(endorsementView)

From Storyboard:
Set a custom class for your view (Class: EndorsementView, Module: DevOptions). XCode should select the module automatically.

  1. Access the DevOptions by long pressing both company and licenses logos.

Author

Nomade Solutions Mobiles, [email protected]

License

DevOptions is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "DevOptions",
    "version": "0.1.1",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "Allows you to activate developper options.",
    "swift_version": "4.2",
    "description": "Allows you to activate developper options such as: Changing the application language at runtime or letting you see your non localized key; Changing the server base url, allowing you to switch from the development environment to the production environment in a simple click; Showing a tag for the UIViewController you are currently looking at.",
    "homepage": "https://github.com/NomadeSolutions/DevOptions",
    "authors": {
        "Nomade Solutions Mobiles": "[email protected]"
    },
    "source": {
        "git": "https://github.com/NomadeSolutions/DevOptions.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "DevOptions/Classes/**/*.{h,m,swift,modulemap}",
    "pod_target_xcconfig": {
        "SWIFT_INCLUDE_PATHS": "$(PODS_TARGET_SRCROOT)/DevOptions/Classes/Module"
    },
    "resource_bundles": {
        "DevOptions": [
            "DevOptions/Assets/**/*.{xcassets,strings}"
        ]
    },
    "frameworks": [
        "UIKit",
        "SafariServices"
    ],
    "dependencies": {
        "TRZSlideLicenseViewController": [],
        "Toast-Swift": [],
        "SnapKit": []
    }
}

Pin It on Pinterest

Share This