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

Adds rex_date to UIDatePicker. #87

Merged
merged 1 commit into from
Apr 1, 2016
Merged

Conversation

guidomb
Copy link
Contributor

@guidomb guidomb commented Mar 26, 2016

This PR adds a rex_date mutable property to UIDatePicker that sends a value every time the picker is updates through a UI event and also updates the picker's date property when the mutable property is updated (this does not cause an infinite loop because I am using target/action which doesn't get called when a property is changed programmatically).

I know this works because I testes it on a project but one of the tests are not passing and I am doing exactly the same you are doing in the UIButton tests. Maybe you can help me there.


func testUpdatePropertyFromPicker() {
let expectation = self.expectationWithDescription("Expected rex_date to send an event when picker's date value is changed by a UI event")
defer { self.waitForExpectationsWithTimeout(2, handler: nil) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is that this blocks the test "UI thread" preventing the action event from being delivered and the expectation from being fulfilled. I'm not at all familiar with the threading of XCTest so not sure what can be done to make this work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the UITextField test does look similar but the events are delivered via NSNotificationCenter which probably does something different under the hood than target/action.

@neilpa neilpa merged commit ea3b58b into RACCommunity:master Apr 1, 2016
@neilpa
Copy link
Member

neilpa commented Apr 1, 2016

I disabled the test and merged this in. Thanks for the PR!

@guidomb guidomb deleted the uidatepicker branch April 2, 2016 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants