Pushwoosh Inbox UI
如何开始
沟通
- 如果您 需要帮助,请联系 Stack Overflow。(标签 'pushwoosh')
- 如果您想 提出一般性问题,请使用 Stack Overflow。
- 如果您 发现了错误,并且可以提供可靠地重现问题的步骤,请提交一个 issues。
- 如果您 有功能需求,请提交一个 issues。
- 如果您 希望贡献,提交一个 pull request。
安装
PushwooshInboxUI支持多种方法在项目中安装库。
使用CocoaPods安装
CocoaPods是一个Objective-C的依赖关系管理器,它自动化并简化了在项目中使用PushwooshInboxUI等第三方库的过程。更多信息请查看"入门"指南。您可以使用以下命令安装它:
$ gem install cocoapods
至少需要CocoaPods 0.39.0+来构建PushwooshInboxUI 5.5.0+。
Podfile
要使用CocoaPods将PushwooshInboxUI集成到您的Xcode项目中,请在您的Podfile
中指定它。
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'TargetName' do
pod 'PushwooshInboxUI', '~> 5.5'
pod 'Pushwoosh', '~> 5.5'
end
然后,运行以下命令:
$ pod install
使用Carthage安装
Carthage是一个分布式依赖关系管理器,它构建您的依赖关系并为您提供二进制框架。
您可以使用以下命令使用Homebrew安装Carthage:
$ brew update
$ brew install carthage
要使用Carthage将PushwooshInboxUI集成到您的Xcode项目中,请在您的Cartfile
中指定它。
github "Pushwoosh/pushwoosh-inbox-ui-ios-sdk" ~> 5.5
运行carthage
构建框架,并将构建好的PushwooshInboxUI.framework
拖放到您的Xcode项目中。
实现
要显示您的应用中的收件箱UI,您可以只需添加收件箱视图控制器
Swift
self.navigationController?.pushViewController(PWIInboxUI.createInboxController(with: PWIInboxStyle.default()), animated: true)
Objective-C
[self.navigationController pushViewController:[PWIInboxUI createInboxControllerWithStyle:[PWIInboxStyle defaultStyle]] animated:YES];
为了使收件箱与您应用的界面一致,可以更改 PWIInboxStyle
的参数。您可以自定义字体、背景颜色等参数。
Swift
//creating a new Inbox style
let inboxStyle = PWIInboxStyle.customStyle(withDefaultImageIcon: UIImage.init(named: "custom_image"),
textColor: UIColor.darkText,
accentColor: UIColor.blue,
font: UIFont.systemFont(ofSize: 17))
inboxStyle?.backgroundColor = UIColor.init(white: 1, alpha: 1)
inboxStyle?.listErrorMessage = NSLocalizedString("Custom error message", comment: "Custom error message")
inboxStyle?.listEmptyMessage = NSLocalizedString("Custom empty message", comment: "Custom empty message")
PWIInboxStyle.setupDefaultStyle(inboxStyle)
Objective-C
//creating a new Inbox style
PWIInboxStyle *inboxStyle = [PWIInboxStyle customStyleWithDefaultImageIcon:[UIImage imageNamed:@"custom_image"]
textColor:UIColor.darkTextColor
accentColor:UIColor.blueColor
font:[UIFont systemFontOfSize:17]];
inboxStyle.backgroundColor = [UIColor colorWithWhite:1 alpha:1];
inboxStyle.listErrorMessage = NSLocalizedString(@"Custom error message", @"Custom error message");
inboxStyle.listEmptyMessage = NSLocalizedString(@"Custom empty message", @"Custom empty message");
[PWIInboxStyle setupDefaultStyle:inboxStyle];
自定义
要自定义收件箱UI样式,请参阅
PWIInboxStyle.h
和
PWIInboxUI.h
有关更多详情,请查看收件箱示例。
变更日志
查看此存储库的发布标签,以获取每个发布版本的完整变更日志。
许可证
PushwooshInboxUI遵循MIT许可证发布。查阅LICENSE获取详情。