ProductHunt 1.0.3

ProductHunt 1.0.3

François Boulais 维护。



Swift

Product Hunt 的 iOS 徽章。

Product Hunt 每天呈现最佳新产品。这是一个热爱产品的爱好者分享和探索最新移动应用、网站、硬件项目和科技创造成就的地方。

[...] Product Hunt 已经成为硅谷必读的网站。

[...] Product Hunt 是一个面向科技产品粉丝的在线社区。

[Product Hunt] 自从其起始点的简陋发展起来后,已经成为了人们提交和投票选择他们最喜欢的科技产品的目的地网站。

[...] Product Hunt 已经从一个小的电子邮件列表发展成为一个科技和创业领域必须阅读的网站,以发现下一个伟大的产品。

特性

  • 支持暗黑模式
  • 数据持久性
  • 每 5 分钟自动刷新

主要要求:

  • Swift 5.0
  • Xcode 11.x

实现 Product Hunt - UIKit:

  1. 在您的 UIApplicationDelegate 中导入 ProductHunt 框架。
import ProductHunt
  1. 在您的应用的 application:didFinishLaunchingWithOptions: 方法中配置 PHManager 实例,使用以下参数:
PHManager.shared.configure(forPost: .slug("timizer"), token: "<YOUR_PRODUCT_HUNT_TOKEN>")
  1. 在视图控制器中,覆盖 viewDidLoad 方法来设置 PHManager 对象的呈现视图控制器。
PHManager.shared.presentingViewController = self
  1. 将一个 PHButton 添加到您的Storyboard、XIB文件中,或者通过编程方式实例化。要将按钮添加到Storyboard或XIB文件,请添加一个View,并将它的自定义类设置为PHButton


实现 Product Hunt - SwiftUI:

  1. 在您的视图结构体中导入 ProductHunt 框架。
import ProductHunt
  1. 使用以下参数将 ProductHuntButton 添加到您的视图中:
ProductHuntButton(post: .slug("<YOUR_SLUG>"), token: "<YOUR_PRODUCT_HUNT_TOKEN>")
  .frame(width: 260.0, height: 60.0, alignment: .center)
  .padding(10.0)


安装:

CocoaPods

您需要将类似于以下指令的 pod 'ProductHunt', '~> 1.0' 添加到您的 Podfile 中:

target 'MyApp' do
  pod 'ProductHunt', '~> 1.0'
end

然后在您的终端或从 CocoaPods.app 运行 pub install

Swift包管理器

  1. 使用Xcode 11或以上版本,前往:文件 > Swift包 > 添加包依赖
  2. 粘贴项目URL: https://github.com/appcraftstudio/producthunt.git
  3. 点击“下一步”并选择项目目标

贡献者

姓名 GitHub Twitter
François Boulais frboulais @frboulais
Julien Lacroix JulienLacr0ix @JulienLacr0ix

Product Hunt badge for iOS - Swift framework to add Product Hunt badge in your iOS apps! | Product Hunt Embed

Buy Me A Coffee

版权所有 © 2020 App Craft Studio。保留所有权利。