{"id":16584064,"url":"https://github.com/sameersyd/fortunewheel","last_synced_at":"2025-03-16T21:30:26.916Z","repository":{"id":40632423,"uuid":"355575797","full_name":"sameersyd/FortuneWheel","owner":"sameersyd","description":"Fortune spinning wheel library built using SwiftUI, supports dynamic content.","archived":false,"fork":false,"pushed_at":"2022-10-26T18:58:51.000Z","size":6547,"stargazers_count":84,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-24T01:02:17.668Z","etag":null,"topics":["cocoapods","cocoapods-library","custom-animation","figma","fortune-wheel","hacktoberfest","ios","ios-app","ios14","material-design","sameersyd","spin-wheel","spinner","spm","swift","swift-package-manager","swiftui","ui-design","wheel","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sameersyd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://paypal.me/sameernwaz"]}},"created_at":"2021-04-07T14:30:12.000Z","updated_at":"2024-03-25T03:07:43.000Z","dependencies_parsed_at":"2022-08-20T20:20:39.088Z","dependency_job_id":null,"html_url":"https://github.com/sameersyd/FortuneWheel","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersyd%2FFortuneWheel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersyd%2FFortuneWheel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersyd%2FFortuneWheel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersyd%2FFortuneWheel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sameersyd","download_url":"https://codeload.github.com/sameersyd/FortuneWheel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830915,"owners_count":20354850,"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":["cocoapods","cocoapods-library","custom-animation","figma","fortune-wheel","hacktoberfest","ios","ios-app","ios14","material-design","sameersyd","spin-wheel","spinner","spm","swift","swift-package-manager","swiftui","ui-design","wheel","xcode"],"created_at":"2024-10-11T22:43:50.085Z","updated_at":"2025-03-16T21:30:26.108Z","avatar_url":"https://github.com/sameersyd.png","language":"Swift","funding_links":["https://paypal.me/sameernwaz","https://www.buymeacoffee.com/sameersyd"],"categories":[],"sub_categories":[],"readme":"[![CI Status](https://img.shields.io/travis/sameersyd/FortuneWheel.svg?style=flat)](https://travis-ci.org/sameersyd/FortuneWheel)\n[![Version](https://img.shields.io/cocoapods/v/FortuneWheel.svg?style=flat)](https://cocoapods.org/pods/FortuneWheel)\n[![License](https://img.shields.io/cocoapods/l/FortuneWheel.svg?style=flat)](https://cocoapods.org/pods/FortuneWheel)\n[![Platform](https://img.shields.io/cocoapods/p/FortuneWheel.svg?style=flat)](https://cocoapods.org/pods/FortuneWheel)\n\n![GitHub Cards Preview](https://github.com/sameersyd/FortuneWheel/blob/master/art/GITHUB-COVER-SPM.png?raw=true)\n\n# Fortune Wheel\nFortune spinning wheel 🎡 library built using SwiftUI, supports dynamic content.\n\n\u003cbr /\u003e\n\n## Preview - Spin Wheel ⚙️\n![gif](https://github.com/sameersyd/FortuneWheel/blob/master/art/preview-wheel.gif)\n\n\u003cbr /\u003e\n\n## CocoaPods Installation\n\nFortuneWheel is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'FortuneWheel'\n```\n\n\u003cbr /\u003e\n\n## Swift Package Manager\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/sameersyd/FortuneWheel.git\", .upToNextMajor(from: \"0.1.5\"))\n]\n```\n\n\u003cbr /\u003e\n\n## Sample Code 🌟 \n\nImport Fortune Wheel in your file.\n```ruby\nimport FortuneWheel\n```\n\nCreate a `FortuneWheelModel` and pass it to the view.\n```swift\nstruct ContentView: View {\n\n    private var players = [\"Sameer\", \"Spikey\", \"Amelia\", \"Danny\", \"Karen\", \"Kathy\"]\n    \n    var body: some View {\n        let model = FortuneWheelModel(\n            titles: players, size: 320,\n            onSpinEnd: onSpinEnd,\n            getWheelItemIndex: getWheelItemIndex\n        )\n        ZStack {\n            FortuneWheel(model: model)\n        }\n    }\n\n    private func onSpinEnd(index: Int) {\n        // your action here - based on index\n    }\n\n    private func getWheelItemIndex() -\u003e Int {\n        return getIndexFromAPI()\n    }\n}\n```\n\n\u003cbr /\u003e\n\n## Note:\n#### When custom animation is used, provide it's duration in `animDuration` parameter\n#### Change the `animDuration` only if custom animation is used, or it may cause delay in pointer result.\n#### Function `getWheelItemIndex` will be called everytime wheel is spinned. If it's nil or provides invalid index, random element will be selected.\n\n\u003cbr /\u003e\n\n## Fortune Wheel properties\n\u003ctable style=\"width:100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eParameter\u003c/th\u003e\n    \u003cth\u003eOptional\u003c/th\u003e \n    \u003cth\u003eType\u003c/th\u003e\n    \u003cth\u003eDefault Value\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003etitles\u003c/td\u003e\n    \u003ctd\u003efalse\u003c/td\u003e\n    \u003ctd\u003e[String]\u003c/td\u003e\n    \u003ctd\u003enil\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003esize\u003c/td\u003e\n    \u003ctd\u003efalse\u003c/td\u003e\n    \u003ctd\u003eCGFloat\u003c/td\u003e\n    \u003ctd\u003enil\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eonSpinEnd\u003c/td\u003e\n    \u003ctd\u003efalse\u003c/td\u003e\n    \u003ctd\u003e(Int) -\u003e ()\u003c/td\u003e\n    \u003ctd\u003enil\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecolors\u003c/td\u003e\n    \u003ctd\u003etrue\u003c/td\u003e\n    \u003ctd\u003e[Color]\u003c/td\u003e\n    \u003ctd\u003eColor hex [\"FBE488\", \"75AB53\", \"D1DC59\", \"EC9D42\", \"DE6037\", \"DA4533\", \"992C4D\", \"433589\", \"4660A8\", \"4291C8\"]\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003epointerColor\u003c/td\u003e\n    \u003ctd\u003etrue\u003c/td\u003e\n    \u003ctd\u003eColor\u003c/td\u003e\n    \u003ctd\u003eColor(hex: \"DA4533\")\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003estrokeWidth\u003c/td\u003e\n    \u003ctd\u003etrue\u003c/td\u003e\n    \u003ctd\u003eCGFloat\u003c/td\u003e\n    \u003ctd\u003e15\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003estrokeColor\u003c/td\u003e\n    \u003ctd\u003etrue\u003c/td\u003e\n    \u003ctd\u003eColor\u003c/td\u003e\n    \u003ctd\u003eColor(hex: \"252D4F\")\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eanimDuration\u003c/td\u003e\n    \u003ctd\u003etrue\u003c/td\u003e\n    \u003ctd\u003eDouble\u003c/td\u003e\n    \u003ctd\u003e6\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eanimation\u003c/td\u003e\n    \u003ctd\u003etrue\u003c/td\u003e\n    \u003ctd\u003eAnimation\u003c/td\u003e\n    \u003ctd\u003eAnimation.timingCurve(0.51, 0.97, 0.56, 0.99, duration: 6)\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003egetWheelItemIndex\u003c/td\u003e\n    \u003ctd\u003etrue\u003c/td\u003e\n    \u003ctd\u003e() -\u003e (Int)\u003c/td\u003e\n    \u003ctd\u003enil\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cbr /\u003e\n\n## UI Design 🎨\nThe UI for this Fortune Wheel library was designed by \u003ca href=\"https://github.com/Spikeysanju\"\u003e@Spikeysanju\u003c/a\u003e\n\n\u003cbr /\u003e\n\n## Contribute\nIf you want to contribute to this app, you're always welcome!\nSee [Contributing Guidelines](https://github.com/sameersyd/FortuneWheel/blob/master/CONTRIBUTION.md).\n\n\u003cbr /\u003e\n\n## Donation\nIf this project helped you reduce time to develop, you can buy me a cup of coffee :) \n\n\u003ca href=\"https://www.buymeacoffee.com/sameersyd\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n\n\u003cbr /\u003e\n\n## Author\nSameer Nawaz, sameer.nwaz@gmail.com\n\n\u003cbr /\u003e\n\n## License\n```\n    Apache 2.0 License\n\n\n    Copyright 2021 Sameer Nawaz\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameersyd%2Ffortunewheel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsameersyd%2Ffortunewheel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameersyd%2Ffortunewheel/lists"}