Fortune spinning wheel library built using SwiftUI, supports dynamic content.

Overview

CI Status Version License Platform

GitHub Cards Preview

Fortune Wheel

Fortune spinning wheel 🎡 library built using SwiftUI, supports dynamic content.


Preview - Spin Wheel ⚙️

gif


CocoaPods Installation

FortuneWheel is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'FortuneWheel'

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/sameersyd/FortuneWheel.git", .upToNextMajor(from: "0.1.4"))
]

Sample Code 🌟

Import Fortune Wheel in your file

import FortuneWheel
struct ContentView: View {
	var players = ["Sameer", "Spikey", "Amelia", "Joan", "Karen", "Natalie"]
	var body: some View {
		ZStack {
			FortuneWheel(titles: players, size: 320, onSpinEnd: { index in
				// your action here - based on index
			})
		}
	}
}

Note:

When custom animation is used, provide it's duration in animDuration parameter

Change the animDuration only if custom animation is used, or it may cause delay in pointer result.


Fortune Wheel properties

Parameter Optional Type Default Value
titles false [String] nil
size false CGFloat nil
onSpinEnd false (Int) -> () nil
colors true [Color] Color hex ["FBE488", "75AB53", "D1DC59", "EC9D42", "DE6037", "DA4533", "992C4D", "433589", "4660A8", "4291C8"]
pointerColor true Color Color(hex: "DA4533")
strokeWidth true CGFloat 15
strokeColor true Color Color(hex: "252D4F")
animDuration true Double 6
animation true Animation Animation.timingCurve(0.51, 0.97, 0.56, 0.99, duration: 6)

UI Design 🎨

The UI for this Fortune Wheel library was designed by @Spikeysanju


Contribute

If you want to contribute to this app, you're always welcome! See Contributing Guidelines.


Donation

If this project helped you reduce time to develop, you can buy me a cup of coffee :)

Buy Me A Coffee


Author

Sameer Nawaz, [email protected]


License

    Apache 2.0 License


    Copyright 2021 Sameer Nawaz

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

You might also like...
Flip is a book tracking app built for iOS and iPadOS. Coming soon to watchOS and macOS.
Flip is a book tracking app built for iOS and iPadOS. Coming soon to watchOS and macOS.

Flip Flip is a project aimed at helping users manage their library of books. It has a clean user interface, allows users to sort and filter their libr

An experiment for using SwiftUI's custom timing Animation to create an orbital-like animation.
An experiment for using SwiftUI's custom timing Animation to create an orbital-like animation.

Orbital-SwiftUI-Animation An experiment for using SwiftUI's custom timing curve to create an orbital-like animation. How it looks: How it works: Apply

Foursquare application replica using SwiftUi
Foursquare application replica using SwiftUi

FOURSQUARE_SWIFTUI This is the replica of Foursquare application, created using

MediaSearchApp - SwiftUI App using the iTunes Search API

Description iOS App for searching ebooks, movies, and TV shows with the iTunes S

Fluid - Use a declarative syntax to build your user interface using UIKit like SwiftUI
Fluid - Use a declarative syntax to build your user interface using UIKit like SwiftUI

Fluid Fluid is powered by ResultBuilder and a custom layout engine. You can uses

MobilePillowTalkLite - An iOS & SwiftUI server monitor tool for linux based machines using remote proc file system with script execution Wallet App UI with custom Animation using SwiftUI 3.0 🤪
Wallet App UI with custom Animation using SwiftUI 3.0 🤪

iOS Wallet App UI Wallet App UI with custom Animation using SwiftUI 3.0 for educational purposes. Video Preview Screenshots Features SwiftUI Animation

Animated Minimal Podcast App UI using SwiftUi 3.0 🤓
Animated Minimal Podcast App UI using SwiftUi 3.0 🤓

Minimal Podcast App UI Animated Minimal Podcast App UI using SwiftUi 3.0 🤓 Video Preview Screenshots Features SwiftUI 3D Card Animation SwiftUI Delay

Library for creating swipe actions for any SwiftUI View

SwipeActions Library for creating swipe actions for any SwiftUI View, similar to

Comments
  • Cocoapods.org page redirecting to GitHub

    Cocoapods.org page redirecting to GitHub

    You seem to have the same problem as I do, my library PermissionsSwiftUI is pushed to Cocoapod's server, but the page on their website is redirecting to my GitHub repo page instead of a parsed README.md on Cocoapods.org. Any clues?

    opened by jevonmao 1
  • End wheel on predefined slice

    End wheel on predefined slice

    is it possible to predefine which slice the wheel will stop at? For real-world implementations, we would want to get a predefined prize from an API and show it on the fortune wheel.

    enhancement 
    opened by bjornkoemans 0
Releases(0.1.5)
Owner
Sameer Nawaz
iOS Engineer  | Open Source Contributor ✨
Sameer Nawaz
jasu 29 Dec 20, 2022
LottieUI - A library developed to make Lottie easy to implement. It supports iOS and macOS

LottieUI It is a library developed to make Lottie easy to implement. It supports

jasu 51 Dec 24, 2022
Widgets iOS 14 animation with 3D and dynamic shadow. Customisable transform and duration.

SPPerspective About Animatable widgets from iOS 14. Same animation for transform and shadow. Customisable duration, perspective and shadow also. For v

Ivan Vorobei 290 Dec 29, 2022
DynamicBlurView is a dynamic and high performance UIView subclass for Blur.

DynamicBlurView DynamicBlurView is a dynamic and high performance UIView subclass for Blur. Appetize's Demo Since using the CADisplayLink, it is a hig

Kyohei Ito 929 Jan 5, 2023
A port of SwiftUILab's Advanced Animations that also supports macOS

SwiftUILab Advanced Animations on the Mac as well A port of SwiftUILab's Advanced Animations that also supports macOS Here's the Ghist of the original

Mihaela Mihaljevic Jakic 10 Jan 2, 2023
BWMCoverView is a very easy to use advertising the carousel view, supports circular scrolling functions such as switching, asynchronous loading of images, animation, custom is very high.

BWMCoverView BWMCoverView is a very easy to use advertising the carousel view, supports circular scrolling functions such as switching, asynchronous l

Bi Weiming 31 Mar 10, 2021
Garland View seamlessly transitions between multiple lists of content.

Garland View seamlessly transitions between multiple lists of content. We specialize in the designing and coding of custom UI for Mobile

Ramotion 504 Jul 31, 2022
SwiftUI-Text-Animation-Library - Text animation library for SwiftUI

⚠️ This repository is under construction. SwiftUI Text Animation Library Make yo

null 28 Jan 8, 2023
A rapid prototype of UISwitch built with Swift and PaintCode.

LTJelloSwitch A cute UISwitch prototype built in about 8 hours. One of my co-worker gave me this concept last year. It was written in Objective-C and

Lex Tang 366 Aug 5, 2022