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
struct PagingContentView: View { | |
@State var currentPage: Int = 0 | |
let config: PagingViewConfig | |
init() { | |
var config = PagingViewConfig() | |
config.direction = .horizontal | |
config.size = 100 | |
config.margin = 0 | |
config.spacing = 0 |
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
public struct _ScrollViewProxy : Equatable { | |
public var config: _ScrollViewConfig { get } | |
public var contentOffset: CGPoint { get set } | |
public var minContentOffset: CGPoint { get } | |
public var maxContentOffset: CGPoint { get } | |
public var contentSize: CGSize { get } | |
public var pageSize: CGSize { get } | |
public var visibleRect: CGRect { get } | |
public var isDragging: Bool { get } | |
public var isDecelerating: Bool { get } |
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
struct ContentView: View { | |
var config = ScrollViewConfig() | |
@State var scrollViewProxy: SolidScrollViewProxy? | |
var body: some View { | |
VStack(spacing: 0) { | |
SolidScrollView(config) { | |
VStack(spacing: 0) { | |
Color.red.frame(height: 200) | |
Color.green.frame(height: 200) |
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
// func test() { | |
// viewTest?.loop() | |
// } |
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
final class SheeTestCase: ViewTestCase { | |
... | |
func testItemChangedThriceDismissedOnce() { | |
guard let viewTest = viewTest else { | |
XCTFail("No view to test.") | |
return | |
} | |
let bounds = UIScreen.main.bounds |
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
final class SheeTestCase: ViewTestCase { | |
... | |
func testItemChangedThriceDismissedTwice() { | |
guard let viewTest = viewTest else { | |
XCTFail("No view to test.") | |
return | |
} | |
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
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) | |
extension SwiftUI._ViewTest { | |
public typealias Touch = (location: CoreGraphics.CGPoint, globalLocation: CoreGraphics.CGPoint?, timestamp: Foundation.Date) | |
public func sendTouchSequence(_ touches: [Self.Touch]) | |
... | |
} |
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
final class SheeTestCase: ViewTestCase { | |
var dismissCounter: Int = 0 | |
@ViewBuilder | |
override func initRootView() -> AnyView { | |
AnyView(ShowPartDetail { [weak self] in | |
guard let self = self else { return } | |
self.dismissCounter += 1 | |
}) | |
} |
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
import SwiftUI | |
@testable import SheeKit | |
import XCTest | |
enum ID: String { | |
case showPartDetailButton | |
case changePartDetailButton | |
} | |
struct ShowPartDetail: View { |
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
import SwiftUI | |
import XCTest | |
extension UIHostingController: _Test where Content == AnyView {} | |
extension UIHostingController: _ViewTest where Content == AnyView { | |
public func initRootView() -> AnyView { | |
return rootView | |
} | |
public func initSize() -> CGSize { | |
sizeThatFits(in: UIScreen.main.bounds.size) |
NewerOlder