SuggestionsBox 1.5

SuggestionsBox 1.5

测试已测试
语言语言 SwiftSwift
许可 MIT
发布最后发布2016年10月
SPM支持 SPM

Manuel Escrig 管理。




SuggestionsBox

SuggestionsBox 是一个 iOS 库,用于聚合关于建议、功能或评论的用户反馈,以帮助您打造更好的产品。

为什么选择 SuggestionsBox?

  • [x] 聚合客户反馈
  • [x] 让您的客户决定
  • [x] 构建最多投票的建议
  • [x] 打造更好的产品

功能特点

  • [x] 列出并添加新的建议
  • [x] 评论并投票其他建议
  • [x] 在标题和描述中搜索
  • [x] 可自定义颜色和字符串
  • [x] 可本地化

示例应用

运行示例应用并体验它! 示例应用

示例项目

要运行示例项目,请克隆仓库,然后在 Example 目录中首先运行 pod install

开始使用

要求

需要 iOS SDK 版本 > 8.0

需要 Swift 3.0

Podfile

要在 Xcode 项目中使用 CocoaPods 集成 MEVHorizontalContacts,请在 Podfile 中指定它

source 'https://github.com/CocoaPods/Specs.git'
pod 'SuggestionsBox'

然后,运行以下命令

$ pod install

手动安装

要手动在 Xcode 项目中集成 SuggestionsBox,只需将 /Pod/Classes/ 文件夹中的文件包含到您的应用程序的 Xcode 项目中。

然后,在您的类中导入以下文件

import SuggestionsBox

快速指南

使用方法

1. 导入类
import SuggestionsBox
2. 添加委托协议。
class ViewController: UIViewController, SuggestionsBoxDelegate {
}
3. 创建、初始化并添加 SuggestionsBox。
let suggestionsBox = SuggestionsBox()
suggestionsBox.delegate = self
SuggestionsBoxTheme.user = "Manuel"
SuggestionsBoxTheme.appName = "SuggestionsBox"
SuggestionsBoxTheme.title = "SuggestionsBox"
SuggestionsBoxTheme.headerText = "Suggest a new feature, tweak, improvement... We'd love to hear your sugestions!"
SuggestionsBoxTheme.footerText = "Powered by SuggestionsBox"
SuggestionsBoxTheme.newSuggestionFooterText = "Powered by SuggestionsBox"
SuggestionsBoxTheme.newCommentFooterText = "Powered by SuggestionsBox"
SuggestionsBoxTheme.navigationBarHeartColor = UIColor.redColor()
SuggestionsBoxTheme.tableSeparatorColor = UIColor.groupTableViewBackgroundColor()
SuggestionsBoxTheme.tableCellBackgroundColor = UIColor.whiteColor()
SuggestionsBoxTheme.tableCellTitleTextColor = UIColor.blackColor()
SuggestionsBoxTheme.tableCellDescriptionTextColor = UIColor.lightGrayColor()

let navigationBar = UINavigationController.init(rootViewController: suggestionsBox)
self.presentViewController(navigationBar, animated: true, completion: nil)
4. 实现委托方法
// MARK : SuggestionsBoxDelegate Methods

func suggestions() -> Array<Suggestion> {
    return self.featureRequests
}

func commentsForSuggestion(suggestion: Suggestion) -> Array<Comment> {
    return self.comments.filter({ $0.suggestionId == suggestion.suggestionId })
}

func newSuggestionAdded(newSuggestion: Suggestion) {
    // Refresh online data
    self.featureRequests.append(newSuggestion)
}

func newCommentForSuggestionAdded(suggestion: Suggestion, newComment: Comment) {
    // Refresh online data
    self.comments.append(newComment)
}

func suggestionFavorited(suggestion: Suggestion) {
    // Refresh online data

    // Refresh local data
    let index = self.featureRequests.indexOf(suggestion)
    self.featureRequests[index!] = suggestion
}

func suggestionUnFavorited(suggestion: Suggestion) {
    // Refresh online data

    // Refresh local data
    let index = self.featureRequests.indexOf(suggestion)
    self.featureRequests[index!] = suggestion
}

路线图

  • [x] CocoaPods 支持
  • [x] Carthage 支持
  • [ ] 测试

使用此库的应用

作者

许可协议

SuggestionsBox 在 MIT 协议下可用。有关更多信息,请参阅 LICENSE.md 文件。