Swift framework to embed native Product Button button.
We love using Product Hunt since it’s a really performing way to introduce our new projects. That’s why we’ve developed this little framework to embed Product Hunt badge. It’s a
UIButton subclass that uses Product Hunt API to synchronize the given votes count every 5 minutes.
Here is the introducing tweet:
PHManagershared instance in your app’s
PHButton(either defined by slug or id)
PHManager.shared.configure(forPost: .slug("timizer"), token: "Ou0qvqpdX7dT1Y4h4CSK3aKMW6-BaxzE6MxDNeop1Zk")
viewDidLoadmethod to set the presenting view controller of the
PHManager.shared.presentingViewController = self
PHButtonto your storyboard, XIB file, or instantiate it programmatically. To add the button to your storyboard or XIB file, add a View and set its custom class to
You want to add pod
'ProductHunt', '~> 1.0' similar to the following to your Podfile:
target 'MyApp' do pod 'ProductHunt', '~> 1.0' end
Then run a
pod install inside your terminal, or from CocoaPods.app.