From e54fa1f2070cc820fac8c1492a7b6e4b6ec80c10 Mon Sep 17 00:00:00 2001 From: Fernando Paredes Date: Fri, 18 Dec 2015 08:29:02 -0800 Subject: [PATCH] [GettingStarted] Use canonical way of checking a string for a string --- Documentation/GettingStarted.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/GettingStarted.md b/Documentation/GettingStarted.md index ee7a1a7b..19be7e45 100644 --- a/Documentation/GettingStarted.md +++ b/Documentation/GettingStarted.md @@ -764,7 +764,7 @@ When writing elegant RxSwift/RxCocoa code, you are probably relying heavily on c ```swift images = word - .filter { $0.rangeOfString("important") != nil } + .filter { $0.containsString("important") } .flatMap { word in return self.api.loadFlickrFeed("karate") .catchError { error in @@ -777,7 +777,7 @@ If compiler reports that there is an error somewhere in this expression, I would ```swift images = word - .filter { s -> Bool in s.rangeOfString("important") != nil } + .filter { s -> Bool in s.containsString("important") } .flatMap { word -> Observable in return self.api.loadFlickrFeed("karate") .catchError { error -> Observable in @@ -790,7 +790,7 @@ If that doesn't work, you can continue adding more type annotations until you've ```swift images = word - .filter { (s: String) -> Bool in s.rangeOfString("important") != nil } + .filter { (s: String) -> Bool in s.containsString("important") } .flatMap { (word: String) -> Observable in return self.api.loadFlickrFeed("karate") .catchError { (error: NSError) -> Observable in