searchBar.rx.textDidBeginEditing does not working when im trying to edit text
up vote
-3
down vote
favorite
searchBar.rx.textDidBeginEditing
.subscribe { [unowned self] in
print("im begining diting")
self.searchBar.setShowsCancelButton(true, animated: true)
}
.disposed(by: disposeBag)
It does not working, maybe I have wrong method? but I have method
searchBar.rx.text
.asObservable()
.bind(to: directoryViewModel.searchTextObservable)
.disposed(by: disposeBag)
Its working properly
ios swift rx-swift rx-cocoa
|
show 1 more comment
up vote
-3
down vote
favorite
searchBar.rx.textDidBeginEditing
.subscribe { [unowned self] in
print("im begining diting")
self.searchBar.setShowsCancelButton(true, animated: true)
}
.disposed(by: disposeBag)
It does not working, maybe I have wrong method? but I have method
searchBar.rx.text
.asObservable()
.bind(to: directoryViewModel.searchTextObservable)
.disposed(by: disposeBag)
Its working properly
ios swift rx-swift rx-cocoa
You haven't shown enough code to reproduce the problem. If I put those two blocks of code in a viewDidLoad, they work exactly as expected.
– Daniel T.
Nov 17 at 20:37
what should I show? cause the second block works fine, but the first one doesn't want to call.
– Serj Semenov
Nov 17 at 23:25
Are you getting any runtime warnings from the console? Have you assigned a delegate to the searchBar? You show a minimum compilable example that exhibits the problem. Write a small project the the least code possible that still has the problem you are seeing.
– Daniel T.
Nov 17 at 23:26
I don't get no runtime warnings and no I didn't assigned to delegate. I wrote a small project but the same problem, probably I just don't know how to use this
– Serj Semenov
Nov 18 at 0:02
I'd love to see the project. Maybe I can figure out what's going on.
– Daniel T.
Nov 18 at 0:06
|
show 1 more comment
up vote
-3
down vote
favorite
up vote
-3
down vote
favorite
searchBar.rx.textDidBeginEditing
.subscribe { [unowned self] in
print("im begining diting")
self.searchBar.setShowsCancelButton(true, animated: true)
}
.disposed(by: disposeBag)
It does not working, maybe I have wrong method? but I have method
searchBar.rx.text
.asObservable()
.bind(to: directoryViewModel.searchTextObservable)
.disposed(by: disposeBag)
Its working properly
ios swift rx-swift rx-cocoa
searchBar.rx.textDidBeginEditing
.subscribe { [unowned self] in
print("im begining diting")
self.searchBar.setShowsCancelButton(true, animated: true)
}
.disposed(by: disposeBag)
It does not working, maybe I have wrong method? but I have method
searchBar.rx.text
.asObservable()
.bind(to: directoryViewModel.searchTextObservable)
.disposed(by: disposeBag)
Its working properly
ios swift rx-swift rx-cocoa
ios swift rx-swift rx-cocoa
asked Nov 17 at 15:13
Serj Semenov
236
236
You haven't shown enough code to reproduce the problem. If I put those two blocks of code in a viewDidLoad, they work exactly as expected.
– Daniel T.
Nov 17 at 20:37
what should I show? cause the second block works fine, but the first one doesn't want to call.
– Serj Semenov
Nov 17 at 23:25
Are you getting any runtime warnings from the console? Have you assigned a delegate to the searchBar? You show a minimum compilable example that exhibits the problem. Write a small project the the least code possible that still has the problem you are seeing.
– Daniel T.
Nov 17 at 23:26
I don't get no runtime warnings and no I didn't assigned to delegate. I wrote a small project but the same problem, probably I just don't know how to use this
– Serj Semenov
Nov 18 at 0:02
I'd love to see the project. Maybe I can figure out what's going on.
– Daniel T.
Nov 18 at 0:06
|
show 1 more comment
You haven't shown enough code to reproduce the problem. If I put those two blocks of code in a viewDidLoad, they work exactly as expected.
– Daniel T.
Nov 17 at 20:37
what should I show? cause the second block works fine, but the first one doesn't want to call.
– Serj Semenov
Nov 17 at 23:25
Are you getting any runtime warnings from the console? Have you assigned a delegate to the searchBar? You show a minimum compilable example that exhibits the problem. Write a small project the the least code possible that still has the problem you are seeing.
– Daniel T.
Nov 17 at 23:26
I don't get no runtime warnings and no I didn't assigned to delegate. I wrote a small project but the same problem, probably I just don't know how to use this
– Serj Semenov
Nov 18 at 0:02
I'd love to see the project. Maybe I can figure out what's going on.
– Daniel T.
Nov 18 at 0:06
You haven't shown enough code to reproduce the problem. If I put those two blocks of code in a viewDidLoad, they work exactly as expected.
– Daniel T.
Nov 17 at 20:37
You haven't shown enough code to reproduce the problem. If I put those two blocks of code in a viewDidLoad, they work exactly as expected.
– Daniel T.
Nov 17 at 20:37
what should I show? cause the second block works fine, but the first one doesn't want to call.
– Serj Semenov
Nov 17 at 23:25
what should I show? cause the second block works fine, but the first one doesn't want to call.
– Serj Semenov
Nov 17 at 23:25
Are you getting any runtime warnings from the console? Have you assigned a delegate to the searchBar? You show a minimum compilable example that exhibits the problem. Write a small project the the least code possible that still has the problem you are seeing.
– Daniel T.
Nov 17 at 23:26
Are you getting any runtime warnings from the console? Have you assigned a delegate to the searchBar? You show a minimum compilable example that exhibits the problem. Write a small project the the least code possible that still has the problem you are seeing.
– Daniel T.
Nov 17 at 23:26
I don't get no runtime warnings and no I didn't assigned to delegate. I wrote a small project but the same problem, probably I just don't know how to use this
– Serj Semenov
Nov 18 at 0:02
I don't get no runtime warnings and no I didn't assigned to delegate. I wrote a small project but the same problem, probably I just don't know how to use this
– Serj Semenov
Nov 18 at 0:02
I'd love to see the project. Maybe I can figure out what's going on.
– Daniel T.
Nov 18 at 0:06
I'd love to see the project. Maybe I can figure out what's going on.
– Daniel T.
Nov 18 at 0:06
|
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
-1
down vote
accepted
I forgot to put onNext:
searchBar.rx.textDidBeginEditing
.subscribe(onNext: { [unowned self] in
self.searchBar.setShowsCancelButton(true, animated: true)
}).disposed(by: disposeBag)
That's not the reason it was failing. There was something else wrong.
– Daniel T.
Nov 18 at 0:40
Why not? It works fine now, just set asObservable() and subscribe(onNext:)
– Serj Semenov
Nov 18 at 10:51
Because ifasObservable()
was necessary, then the code wouldn't have even compiled without it.
– Daniel T.
Nov 18 at 14:25
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
-1
down vote
accepted
I forgot to put onNext:
searchBar.rx.textDidBeginEditing
.subscribe(onNext: { [unowned self] in
self.searchBar.setShowsCancelButton(true, animated: true)
}).disposed(by: disposeBag)
That's not the reason it was failing. There was something else wrong.
– Daniel T.
Nov 18 at 0:40
Why not? It works fine now, just set asObservable() and subscribe(onNext:)
– Serj Semenov
Nov 18 at 10:51
Because ifasObservable()
was necessary, then the code wouldn't have even compiled without it.
– Daniel T.
Nov 18 at 14:25
add a comment |
up vote
-1
down vote
accepted
I forgot to put onNext:
searchBar.rx.textDidBeginEditing
.subscribe(onNext: { [unowned self] in
self.searchBar.setShowsCancelButton(true, animated: true)
}).disposed(by: disposeBag)
That's not the reason it was failing. There was something else wrong.
– Daniel T.
Nov 18 at 0:40
Why not? It works fine now, just set asObservable() and subscribe(onNext:)
– Serj Semenov
Nov 18 at 10:51
Because ifasObservable()
was necessary, then the code wouldn't have even compiled without it.
– Daniel T.
Nov 18 at 14:25
add a comment |
up vote
-1
down vote
accepted
up vote
-1
down vote
accepted
I forgot to put onNext:
searchBar.rx.textDidBeginEditing
.subscribe(onNext: { [unowned self] in
self.searchBar.setShowsCancelButton(true, animated: true)
}).disposed(by: disposeBag)
I forgot to put onNext:
searchBar.rx.textDidBeginEditing
.subscribe(onNext: { [unowned self] in
self.searchBar.setShowsCancelButton(true, animated: true)
}).disposed(by: disposeBag)
edited yesterday
answered Nov 18 at 0:16
Serj Semenov
236
236
That's not the reason it was failing. There was something else wrong.
– Daniel T.
Nov 18 at 0:40
Why not? It works fine now, just set asObservable() and subscribe(onNext:)
– Serj Semenov
Nov 18 at 10:51
Because ifasObservable()
was necessary, then the code wouldn't have even compiled without it.
– Daniel T.
Nov 18 at 14:25
add a comment |
That's not the reason it was failing. There was something else wrong.
– Daniel T.
Nov 18 at 0:40
Why not? It works fine now, just set asObservable() and subscribe(onNext:)
– Serj Semenov
Nov 18 at 10:51
Because ifasObservable()
was necessary, then the code wouldn't have even compiled without it.
– Daniel T.
Nov 18 at 14:25
That's not the reason it was failing. There was something else wrong.
– Daniel T.
Nov 18 at 0:40
That's not the reason it was failing. There was something else wrong.
– Daniel T.
Nov 18 at 0:40
Why not? It works fine now, just set asObservable() and subscribe(onNext:)
– Serj Semenov
Nov 18 at 10:51
Why not? It works fine now, just set asObservable() and subscribe(onNext:)
– Serj Semenov
Nov 18 at 10:51
Because if
asObservable()
was necessary, then the code wouldn't have even compiled without it.– Daniel T.
Nov 18 at 14:25
Because if
asObservable()
was necessary, then the code wouldn't have even compiled without it.– Daniel T.
Nov 18 at 14:25
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53352519%2fsearchbar-rx-textdidbeginediting-does-not-working-when-im-trying-to-edit-text%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You haven't shown enough code to reproduce the problem. If I put those two blocks of code in a viewDidLoad, they work exactly as expected.
– Daniel T.
Nov 17 at 20:37
what should I show? cause the second block works fine, but the first one doesn't want to call.
– Serj Semenov
Nov 17 at 23:25
Are you getting any runtime warnings from the console? Have you assigned a delegate to the searchBar? You show a minimum compilable example that exhibits the problem. Write a small project the the least code possible that still has the problem you are seeing.
– Daniel T.
Nov 17 at 23:26
I don't get no runtime warnings and no I didn't assigned to delegate. I wrote a small project but the same problem, probably I just don't know how to use this
– Serj Semenov
Nov 18 at 0:02
I'd love to see the project. Maybe I can figure out what's going on.
– Daniel T.
Nov 18 at 0:06