iOS:管理REST端点的简单方法 [英] iOS: Simple way to manage REST end points
问题描述
我们基于REST的应用程序可用于在多个内部环境中进行测试,每个环境都具有不同的REST端点。有没有一种简单的方法在iOS(Swift 3)应用程序中设置环境级别配置?我已经看到了一些方法,但它们似乎都非常复杂。
Our REST based application can be used for testing on multiple internal environments each with a different REST end point. Is there a simple way to set up environment level configuration within an iOS (Swift 3) app? I've seen a few approaches but they all seem pretty involved.
推荐答案
我最终使用 https://github.com/theappbusiness/ConfigGenerator :
一个命令行工具,用于自动生成配置文件代码,在Xcode项目中使用
。 configen工具用于从属性列表中自动生成
配置代码。它旨在为您的应用
使用的外部URL或API密钥创建
类型的配置。目前支持Swift和Objective-C代码
代。
A command line tool to auto-generate configuration file code, for use in Xcode projects. The configen tool is used to auto-generate configuration code from a property list. It is intended to create the kind of configuration needed for external URLs or API keys used by your app. Currently supports both Swift and Objective-C code generation.
这篇关于iOS:管理REST端点的简单方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!