-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # SwiftFortuneWheel.podspec
- Loading branch information
Showing
238 changed files
with
36,592 additions
and
1,084 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# references: | ||
# * https://www.objc.io/issues/6-build-tools/travis-ci/ | ||
# * https://github.com/supermarin/xcpretty#usage | ||
|
||
osx_image: xcode11.2 | ||
language: swift | ||
xcode_project: SwiftFortuneWheel.xcodeproj # path to your xcodeproj folder | ||
xcode_scheme: SwiftFortuneWheelTests | ||
xcode_destination: platform=iOS Simulator,OS=13.2.2,name=iPhone 11 | ||
|
||
# cache: cocoapods | ||
# podfile: Example/Podfile | ||
# before_install: | ||
# - gem install cocoapods # Since Travis is not always on latest version | ||
# - pod install --project-directory=Example | ||
|
||
# script: | ||
# - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/RESegmentedControl.xcworkspace -scheme RESegmentedControl-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty | ||
# - pod lib lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## Migration | ||
|
||
### from 1.1.x to 1.2.x | ||
|
||
- Fix the warning messages | ||
|
||
Animation API was changed: | ||
|
||
- `startAnimating` was renamed to `startRotationAnimation`; | ||
- `stopAnimating` was renamed to `stopRotation`; | ||
- `startAnimating(rotationTime: CFTimeInterval = 5.000, fullRotationCountInRotationTime: CGFloat = 7000)` was deprecated, use `startContinuousRotationAnimation(with: speed)` instead; | ||
- `startAnimating(indefiniteRotationTimeInSeconds: Int, finishIndex: Int, _ completion: ((Bool) -> Void)?)` was deprecated, use `startRotationAnimation(finishIndex:continuousRotationTime:completion:)` instead; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
## Sound Effects and Impact Feedback | ||
|
||
**`SwiftFortuneWheel`** can play sounds when the edge or the center of a slice moves during the rotation. Optionally, it’s possible to turn on the haptic feedback while playing sound. Or use the impact callback and implement your own effect. | ||
|
||
|
||
### Edge Collision Sound Effect Example | ||
|
||
``` Swift | ||
@IBOutlet weak var fortuneWheel: SwiftFortuneWheel! | ||
// after SwiftFortuneWheel init and configuration… | ||
|
||
// add Click.mp3 to your project, create AudioFile, and set to edgeCollisionSound | ||
fortuneWheel.edgeCollisionSound = AudioFile(filename: "Click", extensionName: "mp3") | ||
|
||
// optionally, turn on the haptic feedback for each impact | ||
fortuneWheel.impactFeedbackOn = true | ||
|
||
// turn on the edge collision detection | ||
fortuneWheel.edgeCollisionDetectionOn = true | ||
|
||
``` | ||
|
||
### Example to use callback for Edge Collision | ||
|
||
``` Swift | ||
@IBOutlet weak var fortuneWheel: SwiftFortuneWheel! | ||
// after SwiftFortuneWheel init and configuration… | ||
|
||
// edge collision callback with progress, if rotation is continuous, progress is equal to nil | ||
fortuneWheel.onEdgeCollision = { progress in | ||
print("edge collision progress: \(String(describing: progress))") | ||
} | ||
|
||
// turn on the center collision detection | ||
fortuneWheel.edgeCollisionDetectionOn = true | ||
|
||
``` | ||
|
||
### Center Collision Sound Effect Example | ||
|
||
``` Swift | ||
@IBOutlet weak var fortuneWheel: SwiftFortuneWheel! | ||
// after SwiftFortuneWheel init and configuration… | ||
|
||
// add Click.mp3 to your project, create AudioFile, and set to centerCollisionSound | ||
fortuneWheel.centerCollisionSound = AudioFile(filename: "Click", extensionName: "mp3") | ||
|
||
// optionally, turn on the haptic feedback for each impact | ||
fortuneWheel.impactFeedbackOn = true | ||
|
||
// turn on the center collision detection | ||
fortuneWheel.centerCollisionDetectionOn = true | ||
|
||
``` | ||
|
||
### Example to use callback for Center Collision | ||
|
||
``` Swift | ||
@IBOutlet weak var fortuneWheel: SwiftFortuneWheel! | ||
// after SwiftFortuneWheel init and configuration… | ||
|
||
// center collision callback with progress, if rotation is continuous, progress is equal to nil | ||
fortuneWheel.onCenterCollision = { progress in | ||
print("center collision progress: \(String(describing: progress))") | ||
} | ||
|
||
// turn on the center collision detection | ||
fortuneWheel.centerCollisionDetectionOn = true | ||
|
||
``` | ||
|
||
> _**`impactFeedbackOn`** is only available on iOS 10 and above, not available on other platforms_ | ||
> **For more information, see [example projects](../Examples)** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+31.2 KB
...ssets.xcassets/Colorful-Plait-Background.imageset/Colorful-Plait-Background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
...wiftFortuneWheelDemo-iOS/Assets.xcassets/Colorful-Plait-Background.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Colorful-Plait-Background.jpg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...WheelDemo-iOS/Assets.xcassets/Geometric-Background-Colorful-Vector.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Geometric-Background-Colorful-Vector.jpg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+99 KB
...ic-Background-Colorful-Vector.imageset/Geometric-Background-Colorful-Vector.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.