{"id":15561314,"url":"https://github.com/mahmudahsan/simplestoreui","last_synced_at":"2025-04-23T22:29:36.979Z","repository":{"id":62455493,"uuid":"114446575","full_name":"mahmudahsan/SimpleStoreUI","owner":"mahmudahsan","description":"A table view based view controller to show in app purchase items and functionality quickly within app based on SwiftStoreKit library.","archived":false,"fork":false,"pushed_at":"2019-06-27T02:53:00.000Z","size":447,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-22T19:05:38.391Z","etag":null,"topics":["ios-swift","ios-ui","simple","store","swift","swift-library","swift4","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mahmudahsan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-16T08:45:01.000Z","updated_at":"2024-11-04T06:55:16.000Z","dependencies_parsed_at":"2022-11-02T00:00:51.392Z","dependency_job_id":null,"html_url":"https://github.com/mahmudahsan/SimpleStoreUI","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmudahsan%2FSimpleStoreUI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmudahsan%2FSimpleStoreUI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmudahsan%2FSimpleStoreUI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmudahsan%2FSimpleStoreUI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mahmudahsan","download_url":"https://codeload.github.com/mahmudahsan/SimpleStoreUI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250526048,"owners_count":21445122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios-swift","ios-ui","simple","store","swift","swift-library","swift4","xcode"],"created_at":"2024-10-02T16:07:23.691Z","updated_at":"2025-04-23T22:29:36.962Z","avatar_url":"https://github.com/mahmudahsan.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleStoreUI\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://cocoapods.org/pods/SimpleStoreUI\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/p/SimpleStore.svg?style=flat\" alt=\"CocoaPods\" /\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Swift-5.0-orange.svg\" alt=\"swift 5.0\" /\u003e\n    \u003ca href=\"https://cocoapods.org/pods/SimpleStoreUI\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/pods-v2.0.0-orange.svg\" alt=\"CocoaPods\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://swift.org/package-manager\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat\" alt=\"Swift Package Manager\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://twitter.com/mahmudahsan\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/contact%40-mahmudahsan-green.svg\" alt=\"Twitter: @mahmudahsan\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003cp\u003e\nA table view based view controller to show in app purchase items and functionality quickly within app based on \u003ca href=\"https://github.com/bizz84/SwiftyStoreKit\"\u003eSwiftStoreKit\u003c/a\u003e library. I created this UI based library so that in all my apps I can quickly integrate in app purchase store. \n\u003c/p\u003e\n\u003cp\u003e\n\u003ca href=\"https://github.com/bizz84/SwiftyStoreKit\"\u003eSwiftStoreKit\u003c/a\u003e did the heavy tasks based on StoreKit APIs. My UI based library just use some of those functions and a quick and simple UI to integrate faster.\n\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"preview.gif\" width=\"375\" max-width=\"50%\" alt=\"SimpleStore\" /\u003e\n\u003c/p\u003e\t\n\n## Features\n\n- [X] List in app purchase items within app in table style\n- [X] Each item has image, title and price \n- [X] Currently the UI only supports non-consumable item.\n- [X] Based on \u003ca href=\"https://github.com/bizz84/SwiftyStoreKit\"\u003eSwiftStoreKit\u003c/a\u003e library\n\n \n## Example How to implement\n\n### Step 1: Add the following code in AppDelegate.swift\n\n```swift\nlet iAP_RemoveAd = \"net.yourcompany.product\"\n\nfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n        loadStore()\n        return true\n  }\n  \n  func loadStore(){\n    StoreManager.shared.completeTransactionAtAppLaunch()\n    StoreManager.shared.shouldAddStorePaymentHandling(true)\n    StoreManager.shared.storeItems = [\n        Product(name: \"Restore\", productId: StoreManager.RestoreAll, price: \"\", purchased: false, image: \"iap_restore\"),\n        Product(name: \"Remove Ads\", productId: iAP_RemoveAd, price: \"\", purchased: false, image: \"iap_remove_ads\"),\n    ]\n    StoreManager.shared.loadStoreProducts()\n  }\n```\n\n* In this example we define only one in app purchase item named iAP_RemoveAd. If you have many in app purchase items, you can define all here or some where else.\n* Fill StoreManager.shared.storeItems with your in app purchase items. If you don't want to show Restore feature, you can remove the first line. Also you may or may not fill the price argument as it will auto fill later by the Store Manager.\n* purchased: false is the default value. When the store load, StoreManager will check and updated price and purchased fields.\n\n### Step 2: In your main view controller write the following codes\n\n```swift\nimport UIKit\nimport MBProgressHUD\nimport SimpleStoreUI\n\nextension UIViewController {\n    //MARK: - Top View Controller\n    static func topViewController()-\u003e UIViewController{\n        var topViewController:UIViewController = UIApplication.shared.keyWindow!.rootViewController!\n        \n        while ((topViewController.presentedViewController) != nil) {\n            topViewController = topViewController.presentedViewController!;\n        }\n        \n        return topViewController\n    }\n}\n\nclass ViewController: UIViewController {\n    @IBAction func showStore(_ sender: Any) {\n    //Main code to add the Store UI within app\n        let bundle  = Bundle(for: StoreViewController.self)\n        let storeVC = StoreViewController(nibName: \"StoreViewController\", bundle: bundle)\n        StoreManager.shared.storeManagerDelegate = self\n        \n        storeVC.title     = \"Store\"\n        self.navigationController?.pushViewController(storeVC, animated: true)\n    }\n}\n\nextension ViewController : StoreManagerDelegate {\n    //MARK:- HudDelegate\n    public func showHud() {\n        print(\"Show HUD\")\n        MBProgressHUD.showAdded(to: UIViewController.topViewController().view, animated: true)\n    }\n    \n    public func hideHud() {\n        MBProgressHUD.hide(for: UIViewController.topViewController().view, animated: true)\n    }\n    \n    public func purchaseSuccess(productId: String) {\n        if productId == iAP_RemoveAd {\n            // TODO: DO SOMETHING\n            print(\"Remove Ads Purchase Success. Do Something!\")\n            \n        }\n    }\n}\n```\n\n* showStore() function demonstrate how to show the UI.\n* StoreManagerDelegate has 3 functions. You can modify all of this\n* purchaseSuccess() with productId will be called every time user purchase any non-consumable item or restore any of them. It's your job to define how to give the feature to your user based on productId.\n\n\n### Step 3: To know whether user purchase any item or not use the following function\n\n```swift\nStoreManager.shared.isProductPurchased(Constants.kIAPRemoveAds)\n```\n\n## Usage in an iOS application\n\nEither\n\n- Drag the folders SimpleStore/Sources folder into your application's Xcode project. \n\nor\n\n- Use CocoaPods or the Swift Package manager to include SimpleStore as a dependency in your project.\n\n```Ruby\npod 'SimpleStoreUI'\n```\nor\n```Ruby\npod 'SimpleStoreUI', :git =\u003e 'https://github.com/mahmudahsan/SimpleStoreUI'\n```\n\n* In your project add the icons of your in app purchase items. Better use StoreIcons.assets to add icons. You will find this StoreIcons.assets in the demo folder\n\n\n## Questions or feedback?\n\nFeel free to [open an issue](https://github.com/mahmudahsan/SimpleStoreUI/issues/new), or find me [@mahmudahsan on Twitter](https://twitter.com/mahmudahsan).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmudahsan%2Fsimplestoreui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahmudahsan%2Fsimplestoreui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmudahsan%2Fsimplestoreui/lists"}