Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Tests directory structure #135

Merged
merged 1 commit into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Documentation/CONTRIBUTING.md

This file was deleted.

192 changes: 81 additions & 111 deletions Example/Shuffle.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable implicitly_unwrapped_optional
class CardStackAnimationOptionsSpec: QuickSpec {
class CardStackAnimationOptionsTest: QuickSpec {

override func spec() {
var subject: CardStackAnimationOptions!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable implicitly_unwrapped_optional
class CardStackLayoutProviderSpec: QuickSpec {
class CardStackLayoutProviderTest: QuickSpec {

override func spec() {
let insets = UIEdgeInsets(top: -1, left: 2, bottom: 3, right: -4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable function_body_length closure_body_length implicitly_unwrapped_optional
class CardStackStateManagerSpec: QuickSpec {
class CardStackStateManagerTest: QuickSpec {

override func spec() {
var subject: TestableCardStackStateManager!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable closure_body_length function_body_length implicitly_unwrapped_optional
class SwipeCardStackSpec_Base: QuickSpec {
class SwipeCardStackTest_Base: QuickSpec {

typealias Card = SwipeCardStack.Card

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable closure_body_length implicitly_unwrapped_optional
class SwipeCardStackSpec_StateManager: QuickSpec {
class SwipeCardStackTest_StateManager: QuickSpec {

typealias Card = SwipeCardStack.Card

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable function_body_length implicitly_unwrapped_optional
class SwipeCardStackSpec_SwipeCardDelegate: QuickSpec {
class SwipeCardStackTest_SwipeCardDelegate: QuickSpec {

override func spec() {
var mockAnimator: MockCardStackAnimator!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Shuffle_iOS
import UIKit

// swiftlint:disable function_body_length implicitly_unwrapped_optional
class CardAnimationOptionsSpec: QuickSpec {
class CardAnimationOptionsTest: QuickSpec {

override func spec() {
var subject: CardAnimationOptions!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable closure_body_length function_body_length implicitly_unwrapped_optional
class CardAnimatorSpec: QuickSpec {
class CardAnimatorTest: QuickSpec {

override func spec() {
let cardWidth: CGFloat = 100
Expand Down Expand Up @@ -426,8 +426,7 @@ class CardAnimatorSpec: QuickSpec {
let direction: SwipeDirection = .left
let actualTranslation = subject.swipeTranslation(card,
direction: direction,
directionVector:
direction.vector)
directionVector: direction.vector)
let translatedCardBounds = CGRect(x: actualTranslation.dx,
y: actualTranslation.dy,
width: cardWidth,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable closure_body_length function_body_length implicitly_unwrapped_optional
class CardLayoutProviderSpec: QuickSpec {
class CardLayoutProviderTest: QuickSpec {

override func spec() {
let cardWidth: CGFloat = 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable closure_body_length function_body_length implicitly_unwrapped_optional
class CardTransformProviderSpec: QuickSpec {
class CardTransformProviderTest: QuickSpec {

override func spec() {
let cardWidth: CGFloat = 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable closure_body_length function_body_length implicitly_unwrapped_optional
class SwipeCardSpec_Base: QuickSpec {
class SwipeCardTest_Base: QuickSpec {

override func spec() {
var mockCardAnimator: MockCardAnimator!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable function_body_length implicitly_unwrapped_optional
class SwipeCardSpec_MainMethods: QuickSpec {
class SwipeCardTest_MainMethods: QuickSpec {

override func spec() {
var mockCardAnimator: MockCardAnimator!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Quick
import UIKit

// swiftlint:disable closure_body_length function_body_length implicitly_unwrapped_optional
class SwipeViewSpec: QuickSpec {
class SwipeViewTest: QuickSpec {

override func spec() {
var subject: TestableSwipeView!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import Foundation
import UIKit

class TestableNotificationCenter: NotificationCenter {

Expand Down
2 changes: 1 addition & 1 deletion Sources/Shuffle/Classes/Internal/Array+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import Foundation
import UIKit

extension Array {

Expand Down
2 changes: 1 addition & 1 deletion Sources/Shuffle/Classes/Internal/CGPoint+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import CoreGraphics
import UIKit

extension CGPoint {

Expand Down
2 changes: 1 addition & 1 deletion Sources/Shuffle/Classes/Internal/CGVector+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import CoreGraphics
import UIKit

extension CGVector {

Expand Down
2 changes: 1 addition & 1 deletion Sources/Shuffle/Classes/Internal/StringUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import Foundation
import UIKit

//swiftlint:disable line_length
enum StringUtils {
Expand Down
8 changes: 4 additions & 4 deletions Sources/Shuffle/Classes/SwipeCard/CardAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ class CardAnimator: CardAnimatable {
options: [.curveLinear, .allowUserInteraction],
animations: {
if let direction = card.activeDirection(),
let overlay = card.overlay(forDirection: direction) {
let overlay = card.overlay(forDirection: direction) {
overlay.alpha = 0
}
card.transform = .identity
})
})
}

func animateReverseSwipe(on card: SwipeCard,
Expand All @@ -88,7 +88,7 @@ class CardAnimator: CardAnimatable {
self?.addSwipeAnimationKeyFrames(card,
direction: direction,
forced: true)
})
})

// reverse swipe
Animator.animateKeyFrames(withDuration: card.animationOptions.totalReverseSwipeDuration,
Expand Down Expand Up @@ -217,7 +217,7 @@ class CardAnimator: CardAnimatable {
}

if (direction == .left && touchPoint.y < card.bounds.height / 2)
|| (direction == .right && touchPoint.y >= card.bounds.height / 2) {
|| (direction == .right && touchPoint.y >= card.bounds.height / 2) {
return -2 * card.animationOptions.maximumRotationAngle
}

Expand Down
6 changes: 3 additions & 3 deletions Sources/Shuffle/Classes/SwipeCard/SwipeCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ open class SwipeCard: SwipeView {
animator.animateSwipe(on: self,
direction: direction,
forced: forced) { [weak self] finished in
if finished {
self?.swipeCompletionBlock()
}
if finished {
self?.swipeCompletionBlock()
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Shuffle/Classes/SwipeCard/SwipeCardDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import Foundation
import UIKit

protocol SwipeCardDelegate: AnyObject {
func card(didBeginSwipe card: SwipeCard)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Shuffle/Classes/SwipeCard/SwipeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ open class SwipeView: UIView {
open func endSwiping(_ recognizer: UIPanGestureRecognizer) {
if let direction = activeDirection() {
if dragSpeed(on: direction) >= minimumSwipeSpeed(on: direction)
|| dragPercentage(on: direction) >= 1 {
|| dragPercentage(on: direction) >= 1 {
didSwipe(recognizer, with: direction)
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import Foundation
import UIKit

public protocol CardStackAnimatableOptions {
var resetDuration: TimeInterval? { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import Foundation
import UIKit

protocol CardStackAnimatable {
func animateReset(_ cardStack: SwipeCardStack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import Foundation
import UIKit

struct Swipe: Equatable {
var index: Int
Expand Down
18 changes: 9 additions & 9 deletions Sources/Shuffle/Classes/SwipeCardStack/SwipeCardStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ open class SwipeCardStack: UIView, SwipeCardDelegate, UIGestureRecognizerDelegat
direction: direction,
forced: forced,
animated: animated) { [weak self] finished in
if finished {
self?.isAnimating = false
}
if finished {
self?.isAnimating = false
}
}
}

Expand All @@ -245,9 +245,9 @@ open class SwipeCardStack: UIView, SwipeCardDelegate, UIGestureRecognizerDelegat
animator.animateUndo(self,
topCard: topCard,
animated: animated) { [weak self] finished in
if finished {
self?.isAnimating = false
}
if finished {
self?.isAnimating = false
}
}
}
}
Expand All @@ -266,9 +266,9 @@ open class SwipeCardStack: UIView, SwipeCardDelegate, UIGestureRecognizerDelegat
animator.animateShift(self,
withDistance: distance,
animated: animated) { [weak self] finished in
if finished {
self?.isAnimating = false
}
if finished {
self?.isAnimating = false
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import Foundation
import UIKit

public protocol SwipeCardStackDataSource: AnyObject {
func cardStack(_ cardStack: SwipeCardStack, cardForIndexAt index: Int) -> SwipeCard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// SOFTWARE.
///

import Foundation
import UIKit

@objc public protocol SwipeCardStackDelegate: AnyObject {

Expand Down