[...] Product Hunt 已经成为硅谷必读的网站。
[...] Product Hunt 是一个迎合技术产品爱好者的在线社区。
[Product Hunt] 自其卑微的开端以来,人气飙升,并已成为一个人们可以提交和投票选出他们最喜欢的科技产品的目的地网站。
[...] Product Hunt 已经从一个小型邮件列表发展成为科技和创业领域发现下一个伟大产品的必读之选。
UIApplicationDelegate
中导入 ProductHunt 框架import ProductHunt
application:didFinishLaunchingWithOptions:
方法中配置 PHManager
共享实例:PHButton
的帖子(由 slug 或 id 定义)PHManager.shared.configure(forPost: .slug("timizer"), token: "<YOUR_PRODUCT_HUNT_TOKEN>")
viewDidLoad
方法以设置 PHManager
对象的 presenting 视图控制器。PHManager.shared.presentingViewController = self
PHButton
添加到您的 storyboard、XIB 文件或以编程方式实例化它。 要将按钮添加到您的 storyboard 或 XIB 文件,请添加一个 View 并将其自定义类设置为 PHButton
。import ProductHunt
ProductHuntButton
添加到您的视图:ProductHuntButton(post: .slug("<YOUR_SLUG>"), token: "<YOUR_PRODUCT_HUNT_TOKEN>")
.frame(width: 260.0, height: 60.0, alignment: .center)
.padding(10.0)
您需要将类似于以下内容的 pod 'ProductHunt', '~> 1.0'
添加到您的 Podfile 中
target 'MyApp' do
pod 'ProductHunt', '~> 1.0'
end
然后在您的终端或从 CocoaPods.app 中运行 pod install
。
姓名 | GitHub | |
---|---|---|
François Boulais | frboulais | @frboulais |
Julien Lacroix | JulienLacr0ix | @JulienLacr0ix |
版权所有 © 2020 App Craft Studio。 保留所有权利。