Ceddl4Swift 3.0.0

Ceddl4Swift 3.0.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布上次发布2016年12月
SwiftSwift 版本3.0.1
SPM支持 SPM

Sachin Vas 维护。



  • Sachin Vas

Ceddl4swift - 一个从 Swift 出来的 CEDDL 数据层

Ceddl4swift 简介

Ceddl4swift 是一个 Swift 框架,用于符合 CEDDL 规范 的网站数据层。

客户体验数字数据层 (CEDDL) 规范

“描述了一种将客户体验数字数据以 JavaScript 对象形式呈现的方法,该对象可用于将此数据传输到数字分析和报告服务器。”

代码设计遵循自 Ceddl4j: A Java component for a website data layer compliant with the CEDDL specification,以便于在多个平台上集成。

更多背景信息,请参阅文章 Ceddl4j: What & why?

示例

为了构建以下数据层:

        digitalData = {
            pageInstanceID: "MyHomePage-Production",
            page:{
                pageInfo:{
                    pageID: "Home Page",
                    destinationURL: "http://mysite.com/index.html"
                },
                category:{
                    primaryCategory: "FAQ Pages",
                    subCategory1: "ProductInfo",
                    pageType: "FAQ"
                },
                attributes:{
                    country: "US",
                    language: "en-US"
                }
            }
        };

您可以使用以下代码:

        let digitalData = DigitalData.create("MyHomePage-Production")
                                     .page()
                                     .pageInfo()
                                     .pageID("Home Page")
                                     .destinationURL("http://mysite.com/index.html")
                                     .endPageInfo()
                                     .addPrimaryCategory("FAQ Pages")
                                     .addCategory("subCategory1", "ProductInfo")
                                     .addCategory("pageType", "FAQ")
                                     .addAttribute("country", "US")
                                     .addAttribute("language", "en-US")
                                     .endPage()

贡献指南

  • 英文中的注释、方法和变量。
  • 尽可能创建单元测试。
  • 尽量遵循现有的编码风格。
  • 在拉取请求中简短说明您正在做什么以及为什么。

安装

该项目托管在 Cocoa Pods 上,您可以使用以下命令将其包括到项目中:

pod 'Ceddl4Swift'

更多相关信息见 Cocoa Pods。

许可证信息

Copyright (c) 2016, Datalicious.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
    * Neither the name of Datalicious nor the
    names of its contributors may be used to endorse or promote products
    derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.