Latest 0.0.4
Homepage https://github.com/OneKnife/YSNetwork
License MIT
Platforms ios 8.0
Dependencies Alamofire
Authors

CI Status
Version
License
Platform

基于Alamofire的再封装,将每个网络请求封装成对象,提供更方便的网络请求配置

主要实现的功能:

  • 更方便的网络请求超时时间设置
  • 添加网络请求的公用参数
  • 支持缓存,可自定义缓存时间,是否支持缓存、先使用缓存后请求数据等功能
  • 统一设置服务器地址
  • 更方便的自定义 requset headerFields

所有功能都可设置默认设置和单条独立配置。

之后根据需求会添加其他功能。

安装

YSNetwork 可通过 CocoaPods. 安装
只需要在Podfile中加入下面的代码:

pod 'YSNetwork'

作者

OneKnife, [email protected]

协议

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

Latest podspec

{
    "name": "YSNetwork",
    "version": "0.0.4",
    "summary": "u57fau4e8eAlamofireu7684u518du5c01u88c5",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/OneKnife/YSNetwork",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "OneKnife": "[email protected]"
    },
    "source": {
        "git": "https://github.com/OneKnife/YSNetwork.git",
        "tag": "0.0.4"
    },
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.0",
    "source_files": "YSNetwork/Classes/*",
    "dependencies": {
        "Alamofire": [
            "~> 4.7"
        ]
    },
    "script_phases": {
        "name": "CommonCrypto",
        "script": "COMMON_CRYPTO_DIR="${SDKROOT}/usr/include/CommonCrypto"n    if [ -f "${COMMON_CRYPTO_DIR}/module.modulemap" ]n      thenn      echo "CommonCrypto already exists, skipping"n      elsen      # This if-statement means we will only run the main script if then      # CommonCrypto.framework directory doesn not exist because otherwisen      # the rest of the script causes a full recompile for anythingn      # where CommonCrypto is a dependencyn      # Do a "Clean Build Folder" to remove this directory and triggern      # the rest of the script to runn      FRAMEWORK_DIR="${BUILT_PRODUCTS_DIR}/CommonCrypto.framework"n      if [ -d "${FRAMEWORK_DIR}" ]; thenn        echo "${FRAMEWORK_DIR} already exists, so skipping the rest of the script."n        exit 0n      fin      mkdir -p "${FRAMEWORK_DIR}/Modules"n      echo "module CommonCrypto [system] {n        header \"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\"n        export *n      }" >> "${FRAMEWORK_DIR}/Modules/module.modulemap"n      ln -sf "${SDKROOT}/usr/include/CommonCrypto" "${FRAMEWORK_DIR}/Headers"n    fi",
        "execution_position": "before_compile"
    }
}

Pin It on Pinterest

Share This