-
Notifications
You must be signed in to change notification settings - Fork 157
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
Prevent complete animators from causing drawing #505
Conversation
Could we run device tests before merging this PR? You can use |
internal protocol MapViewDependencyProviderProtocol { | ||
func makeMetalView(frame: CGRect, device: MTLDevice?) -> MTKView | ||
func makeDisplayLink(window: UIWindow, target: Any, selector: Selector) -> DisplayLinkProtocol? | ||
} | ||
|
||
internal final class MapViewDependencyProvider: MapViewDependencyProviderProtocol { | ||
func makeMetalView(frame: CGRect, device: MTLDevice?) -> MTKView { | ||
MTKView(frame: frame, device: device) | ||
} | ||
|
||
func makeDisplayLink(window: UIWindow, target: Any, selector: Selector) -> DisplayLinkProtocol? { | ||
window.screen.displayLink(withTarget: target, selector: selector) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇🏾 this is awesome.. We've needed to do this for a long time!
let makeMetalViewStub = Stub<MakeMetalViewParams, MockMetalView?>(defaultReturnValue: nil) | ||
func makeMetalView(frame: CGRect, device: MTLDevice?) -> MTKView { | ||
makeMetalViewStub.returnValueQueue.append(MockMetalView(frame: frame, device: device)) | ||
return makeMetalViewStub.call(with: MakeMetalViewParams(frame: frame, device: device))! | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add return value generator block
Fixes: #469
Pull request checklist:
Summary of changes