├── .gitignore ├── PropertyFinder.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── PropertyFinder.xcscheme ├── PropertyView.js ├── README.md ├── SearchPage.js ├── SearchResults.js ├── iOS ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── LaunchScreen.xib ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── house.imageset │ │ ├── Contents.json │ │ ├── house.png │ │ ├── house@2x.png │ │ └── house@3x.png ├── Info.plist └── main.m ├── index.ios.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | ######################### 2 | # .gitignore file for Xcode4 and Xcode5 Source projects 3 | # 4 | # Apple bugs, waiting for Apple to fix/respond: 5 | # 6 | # 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? 7 | # 8 | # Version 2.3 9 | # For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects 10 | # 11 | # 2014 updates: 12 | # - appended non-standard items DISABLED by default (uncomment if you use those tools) 13 | # - removed the edit that an SO.com moderator made without bothering to ask me 14 | # - researched CocoaPods .lock more carefully, thanks to Gokhan Celiker 15 | # 2013 updates: 16 | # - fixed the broken "save personal Schemes" 17 | # - added line-by-line explanations for EVERYTHING (some were missing) 18 | # 19 | # NB: if you are storing "built" products, this WILL NOT WORK, 20 | # and you should use a different .gitignore (or none at all) 21 | # This file is for SOURCE projects, where there are many extra 22 | # files that we want to exclude 23 | # 24 | ######################### 25 | 26 | ##### 27 | # OS X temporary files that should never be committed 28 | # 29 | # c.f. http://www.westwind.com/reference/os-x/invisibles.html 30 | 31 | .DS_Store 32 | 33 | # c.f. http://www.westwind.com/reference/os-x/invisibles.html 34 | 35 | .Trashes 36 | 37 | # c.f. http://www.westwind.com/reference/os-x/invisibles.html 38 | 39 | *.swp 40 | 41 | # 42 | # *.lock - this is used and abused by many editors for many different things. 43 | # For the main ones I use (e.g. Eclipse), it should be excluded 44 | # from source-control, but YMMV. 45 | # (lock files are usually local-only file-synchronization on the local FS that should NOT go in git) 46 | # c.f. the "OPTIONAL" section at bottom though, for tool-specific variations! 47 | 48 | *.lock 49 | 50 | 51 | # 52 | # profile - REMOVED temporarily (on double-checking, I can't find it in OS X docs?) 53 | #profile 54 | 55 | 56 | #### 57 | # Xcode temporary files that should never be committed 58 | # 59 | # NB: NIB/XIB files still exist even on Storyboard projects, so we want this... 60 | 61 | *~.nib 62 | 63 | 64 | #### 65 | # Xcode build files - 66 | # 67 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData" 68 | 69 | DerivedData/ 70 | 71 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build" 72 | 73 | build/ 74 | 75 | 76 | ##### 77 | # Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups) 78 | # 79 | # This is complicated: 80 | # 81 | # SOMETIMES you need to put this file in version control. 82 | # Apple designed it poorly - if you use "custom executables", they are 83 | # saved in this file. 84 | # 99% of projects do NOT use those, so they do NOT want to version control this file. 85 | # ..but if you're in the 1%, comment out the line "*.pbxuser" 86 | 87 | # .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html 88 | 89 | *.pbxuser 90 | 91 | # .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html 92 | 93 | *.mode1v3 94 | 95 | # .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html 96 | 97 | *.mode2v3 98 | 99 | # .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file 100 | 101 | *.perspectivev3 102 | 103 | # NB: also, whitelist the default ones, some projects need to use these 104 | !default.pbxuser 105 | !default.mode1v3 106 | !default.mode2v3 107 | !default.perspectivev3 108 | 109 | 110 | #### 111 | # Xcode 4 - semi-personal settings 112 | # 113 | # 114 | # OPTION 1: --------------------------------- 115 | # throw away ALL personal settings (including custom schemes! 116 | # - unless they are "shared") 117 | # 118 | # NB: this is exclusive with OPTION 2 below 119 | xcuserdata 120 | 121 | # OPTION 2: --------------------------------- 122 | # get rid of ALL personal settings, but KEEP SOME OF THEM 123 | # - NB: you must manually uncomment the bits you want to keep 124 | # 125 | # NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X, 126 | # or manually install git over the top of the OS X version 127 | # NB: this is exclusive with OPTION 1 above 128 | # 129 | #xcuserdata/**/* 130 | 131 | # (requires option 2 above): Personal Schemes 132 | # 133 | #!xcuserdata/**/xcschemes/* 134 | 135 | #### 136 | # XCode 4 workspaces - more detailed 137 | # 138 | # Workspaces are important! They are a core feature of Xcode - don't exclude them :) 139 | # 140 | # Workspace layout is quite spammy. For reference: 141 | # 142 | # /(root)/ 143 | # /(project-name).xcodeproj/ 144 | # project.pbxproj 145 | # /project.xcworkspace/ 146 | # contents.xcworkspacedata 147 | # /xcuserdata/ 148 | # /(your name)/xcuserdatad/ 149 | # UserInterfaceState.xcuserstate 150 | # /xcsshareddata/ 151 | # /xcschemes/ 152 | # (shared scheme name).xcscheme 153 | # /xcuserdata/ 154 | # /(your name)/xcuserdatad/ 155 | # (private scheme).xcscheme 156 | # xcschememanagement.plist 157 | # 158 | # 159 | 160 | #### 161 | # Xcode 4 - Deprecated classes 162 | # 163 | # Allegedly, if you manually "deprecate" your classes, they get moved here. 164 | # 165 | # We're using source-control, so this is a "feature" that we do not want! 166 | 167 | *.moved-aside 168 | 169 | #### 170 | # OPTIONAL: Some well-known tools that people use side-by-side with Xcode / iOS development 171 | # 172 | # NB: I'd rather not include these here, but gitignore's design is weak and doesn't allow 173 | # modular gitignore: you have to put EVERYTHING in one file. 174 | # 175 | # COCOAPODS: 176 | # 177 | # c.f. http://guides.cocoapods.org/using/using-cocoapods.html#what-is-a-podfilelock 178 | # c.f. http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 179 | # 180 | #!Podfile.lock 181 | # 182 | # RUBY: 183 | # 184 | # c.f. http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/ 185 | # 186 | #!Gemfile.lock 187 | # 188 | # IDEA: 189 | # 190 | #.idea 191 | # 192 | # TEXTMATE: 193 | # 194 | # -- UNVERIFIED: c.f. http://stackoverflow.com/a/50283/153422 195 | # 196 | #tm_build_errors 197 | 198 | #### 199 | # UNKNOWN: recommended by others, but I can't discover what these files are 200 | # 201 | # Community suggestions (unverified, no evidence available - DISABLED by default) 202 | # 203 | # 1. Xcode 5 - VCS file 204 | # 205 | # "The data in this file not represent state of your project. 206 | # If you'll leave this file in git - you will have merge conflicts during 207 | # pull your cahnges to other's repo" 208 | # 209 | #*.xccheckout 210 | 211 | # React-Native specific stuff 212 | node_modules -------------------------------------------------------------------------------- /PropertyFinder.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00481BEA1AC0C89D00671115 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 00481BE91AC0C89D00671115 /* libicucore.dylib */; }; 11 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 12 | 00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */; }; 13 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 14 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 15 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 16 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 17 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 18 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 19 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 20 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 21 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 22 | 72D8295F1C902D3B00BF3B32 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 72D8295D1C902D1D00BF3B32 /* libRCTWebSocket.a */; }; 23 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 30 | proxyType = 2; 31 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 32 | remoteInfo = RCTActionSheet; 33 | }; 34 | 00C302B31ABCB8E700DB3ED1 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */; 37 | proxyType = 2; 38 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 39 | remoteInfo = RCTAdSupport; 40 | }; 41 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 44 | proxyType = 2; 45 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 46 | remoteInfo = RCTGeolocation; 47 | }; 48 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 49 | isa = PBXContainerItemProxy; 50 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 51 | proxyType = 2; 52 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 53 | remoteInfo = RCTImage; 54 | }; 55 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 56 | isa = PBXContainerItemProxy; 57 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 58 | proxyType = 2; 59 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 60 | remoteInfo = RCTNetwork; 61 | }; 62 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 63 | isa = PBXContainerItemProxy; 64 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 65 | proxyType = 2; 66 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 67 | remoteInfo = RCTVibration; 68 | }; 69 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 70 | isa = PBXContainerItemProxy; 71 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 72 | proxyType = 2; 73 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 74 | remoteInfo = React; 75 | }; 76 | 72D8295C1C902D1D00BF3B32 /* PBXContainerItemProxy */ = { 77 | isa = PBXContainerItemProxy; 78 | containerPortal = 72D829511C902D1C00BF3B32 /* RCTWebSocket.xcodeproj */; 79 | proxyType = 2; 80 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 81 | remoteInfo = RCTWebSocket; 82 | }; 83 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 84 | isa = PBXContainerItemProxy; 85 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 86 | proxyType = 2; 87 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 88 | remoteInfo = RCTText; 89 | }; 90 | /* End PBXContainerItemProxy section */ 91 | 92 | /* Begin PBXFileReference section */ 93 | 00481BE91AC0C89D00671115 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; }; 94 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 95 | 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = "node_modules/react-native/Libraries/AdSupport/RCTAdSupport.xcodeproj"; sourceTree = ""; }; 96 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 97 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 98 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 99 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 100 | 13B07F961A680F5B00A75B9A /* PropertyFinder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PropertyFinder.app; sourceTree = BUILT_PRODUCTS_DIR; }; 101 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = ""; }; 102 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = ""; }; 103 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 104 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iOS/Images.xcassets; sourceTree = ""; }; 105 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = ""; }; 106 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = ""; }; 107 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 108 | 72D829511C902D1C00BF3B32 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 109 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 110 | /* End PBXFileReference section */ 111 | 112 | /* Begin PBXFrameworksBuildPhase section */ 113 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 114 | isa = PBXFrameworksBuildPhase; 115 | buildActionMask = 2147483647; 116 | files = ( 117 | 72D8295F1C902D3B00BF3B32 /* libRCTWebSocket.a in Frameworks */, 118 | 00481BEA1AC0C89D00671115 /* libicucore.dylib in Frameworks */, 119 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 120 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 121 | 00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */, 122 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 123 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 124 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 125 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 126 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 127 | ); 128 | runOnlyForDeploymentPostprocessing = 0; 129 | }; 130 | /* End PBXFrameworksBuildPhase section */ 131 | 132 | /* Begin PBXGroup section */ 133 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 137 | ); 138 | name = Products; 139 | sourceTree = ""; 140 | }; 141 | 00C302B01ABCB8E700DB3ED1 /* Products */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */, 145 | ); 146 | name = Products; 147 | sourceTree = ""; 148 | }; 149 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 153 | ); 154 | name = Products; 155 | sourceTree = ""; 156 | }; 157 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 161 | ); 162 | name = Products; 163 | sourceTree = ""; 164 | }; 165 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 169 | ); 170 | name = Products; 171 | sourceTree = ""; 172 | }; 173 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 177 | ); 178 | name = Products; 179 | sourceTree = ""; 180 | }; 181 | 13B07FAE1A68108700A75B9A /* PropertyFinder */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 185 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 186 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 187 | 13B07FB61A68108700A75B9A /* Info.plist */, 188 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 189 | 13B07FB71A68108700A75B9A /* main.m */, 190 | ); 191 | name = PropertyFinder; 192 | sourceTree = ""; 193 | }; 194 | 146834001AC3E56700842450 /* Products */ = { 195 | isa = PBXGroup; 196 | children = ( 197 | 146834041AC3E56700842450 /* libReact.a */, 198 | ); 199 | name = Products; 200 | sourceTree = ""; 201 | }; 202 | 72D829521C902D1C00BF3B32 /* Products */ = { 203 | isa = PBXGroup; 204 | children = ( 205 | 72D8295D1C902D1D00BF3B32 /* libRCTWebSocket.a */, 206 | ); 207 | name = Products; 208 | sourceTree = ""; 209 | }; 210 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 211 | isa = PBXGroup; 212 | children = ( 213 | 72D829511C902D1C00BF3B32 /* RCTWebSocket.xcodeproj */, 214 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 215 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 216 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 217 | 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */, 218 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 219 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 220 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 221 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 222 | 00481BE91AC0C89D00671115 /* libicucore.dylib */, 223 | ); 224 | name = Libraries; 225 | sourceTree = ""; 226 | }; 227 | 832341B11AAA6A8300B99B32 /* Products */ = { 228 | isa = PBXGroup; 229 | children = ( 230 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 231 | ); 232 | name = Products; 233 | sourceTree = ""; 234 | }; 235 | 83CBB9F61A601CBA00E9B192 = { 236 | isa = PBXGroup; 237 | children = ( 238 | 13B07FAE1A68108700A75B9A /* PropertyFinder */, 239 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 240 | 83CBBA001A601CBA00E9B192 /* Products */, 241 | ); 242 | sourceTree = ""; 243 | }; 244 | 83CBBA001A601CBA00E9B192 /* Products */ = { 245 | isa = PBXGroup; 246 | children = ( 247 | 13B07F961A680F5B00A75B9A /* PropertyFinder.app */, 248 | ); 249 | name = Products; 250 | sourceTree = ""; 251 | }; 252 | /* End PBXGroup section */ 253 | 254 | /* Begin PBXNativeTarget section */ 255 | 13B07F861A680F5B00A75B9A /* PropertyFinder */ = { 256 | isa = PBXNativeTarget; 257 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "PropertyFinder" */; 258 | buildPhases = ( 259 | 13B07F871A680F5B00A75B9A /* Sources */, 260 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 261 | 13B07F8E1A680F5B00A75B9A /* Resources */, 262 | ); 263 | buildRules = ( 264 | ); 265 | dependencies = ( 266 | ); 267 | name = PropertyFinder; 268 | productName = "Hello World"; 269 | productReference = 13B07F961A680F5B00A75B9A /* PropertyFinder.app */; 270 | productType = "com.apple.product-type.application"; 271 | }; 272 | /* End PBXNativeTarget section */ 273 | 274 | /* Begin PBXProject section */ 275 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 276 | isa = PBXProject; 277 | attributes = { 278 | LastUpgradeCheck = 0610; 279 | ORGANIZATIONNAME = Facebook; 280 | }; 281 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PropertyFinder" */; 282 | compatibilityVersion = "Xcode 3.2"; 283 | developmentRegion = English; 284 | hasScannedForEncodings = 0; 285 | knownRegions = ( 286 | en, 287 | Base, 288 | ); 289 | mainGroup = 83CBB9F61A601CBA00E9B192; 290 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 291 | projectDirPath = ""; 292 | projectReferences = ( 293 | { 294 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 295 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 296 | }, 297 | { 298 | ProductGroup = 00C302B01ABCB8E700DB3ED1 /* Products */; 299 | ProjectRef = 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */; 300 | }, 301 | { 302 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 303 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 304 | }, 305 | { 306 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 307 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 308 | }, 309 | { 310 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 311 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 312 | }, 313 | { 314 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 315 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 316 | }, 317 | { 318 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 319 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 320 | }, 321 | { 322 | ProductGroup = 72D829521C902D1C00BF3B32 /* Products */; 323 | ProjectRef = 72D829511C902D1C00BF3B32 /* RCTWebSocket.xcodeproj */; 324 | }, 325 | { 326 | ProductGroup = 146834001AC3E56700842450 /* Products */; 327 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 328 | }, 329 | ); 330 | projectRoot = ""; 331 | targets = ( 332 | 13B07F861A680F5B00A75B9A /* PropertyFinder */, 333 | ); 334 | }; 335 | /* End PBXProject section */ 336 | 337 | /* Begin PBXReferenceProxy section */ 338 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 339 | isa = PBXReferenceProxy; 340 | fileType = archive.ar; 341 | path = libRCTActionSheet.a; 342 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 343 | sourceTree = BUILT_PRODUCTS_DIR; 344 | }; 345 | 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */ = { 346 | isa = PBXReferenceProxy; 347 | fileType = archive.ar; 348 | path = libRCTAdSupport.a; 349 | remoteRef = 00C302B31ABCB8E700DB3ED1 /* PBXContainerItemProxy */; 350 | sourceTree = BUILT_PRODUCTS_DIR; 351 | }; 352 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 353 | isa = PBXReferenceProxy; 354 | fileType = archive.ar; 355 | path = libRCTGeolocation.a; 356 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 357 | sourceTree = BUILT_PRODUCTS_DIR; 358 | }; 359 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 360 | isa = PBXReferenceProxy; 361 | fileType = archive.ar; 362 | path = libRCTImage.a; 363 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 364 | sourceTree = BUILT_PRODUCTS_DIR; 365 | }; 366 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 367 | isa = PBXReferenceProxy; 368 | fileType = archive.ar; 369 | path = libRCTNetwork.a; 370 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 371 | sourceTree = BUILT_PRODUCTS_DIR; 372 | }; 373 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 374 | isa = PBXReferenceProxy; 375 | fileType = archive.ar; 376 | path = libRCTVibration.a; 377 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 378 | sourceTree = BUILT_PRODUCTS_DIR; 379 | }; 380 | 146834041AC3E56700842450 /* libReact.a */ = { 381 | isa = PBXReferenceProxy; 382 | fileType = archive.ar; 383 | path = libReact.a; 384 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 385 | sourceTree = BUILT_PRODUCTS_DIR; 386 | }; 387 | 72D8295D1C902D1D00BF3B32 /* libRCTWebSocket.a */ = { 388 | isa = PBXReferenceProxy; 389 | fileType = archive.ar; 390 | path = libRCTWebSocket.a; 391 | remoteRef = 72D8295C1C902D1D00BF3B32 /* PBXContainerItemProxy */; 392 | sourceTree = BUILT_PRODUCTS_DIR; 393 | }; 394 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 395 | isa = PBXReferenceProxy; 396 | fileType = archive.ar; 397 | path = libRCTText.a; 398 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 399 | sourceTree = BUILT_PRODUCTS_DIR; 400 | }; 401 | /* End PBXReferenceProxy section */ 402 | 403 | /* Begin PBXResourcesBuildPhase section */ 404 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 405 | isa = PBXResourcesBuildPhase; 406 | buildActionMask = 2147483647; 407 | files = ( 408 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 409 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 410 | ); 411 | runOnlyForDeploymentPostprocessing = 0; 412 | }; 413 | /* End PBXResourcesBuildPhase section */ 414 | 415 | /* Begin PBXSourcesBuildPhase section */ 416 | 13B07F871A680F5B00A75B9A /* Sources */ = { 417 | isa = PBXSourcesBuildPhase; 418 | buildActionMask = 2147483647; 419 | files = ( 420 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 421 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 422 | ); 423 | runOnlyForDeploymentPostprocessing = 0; 424 | }; 425 | /* End PBXSourcesBuildPhase section */ 426 | 427 | /* Begin PBXVariantGroup section */ 428 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 429 | isa = PBXVariantGroup; 430 | children = ( 431 | 13B07FB21A68108700A75B9A /* Base */, 432 | ); 433 | name = LaunchScreen.xib; 434 | path = iOS; 435 | sourceTree = ""; 436 | }; 437 | /* End PBXVariantGroup section */ 438 | 439 | /* Begin XCBuildConfiguration section */ 440 | 13B07F941A680F5B00A75B9A /* Debug */ = { 441 | isa = XCBuildConfiguration; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | HEADER_SEARCH_PATHS = ( 445 | "$(inherited)", 446 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 447 | "$(SRCROOT)/node_modules/react-native/React/**", 448 | ); 449 | INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; 450 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 451 | OTHER_LDFLAGS = "-ObjC"; 452 | PRODUCT_NAME = PropertyFinder; 453 | }; 454 | name = Debug; 455 | }; 456 | 13B07F951A680F5B00A75B9A /* Release */ = { 457 | isa = XCBuildConfiguration; 458 | buildSettings = { 459 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 460 | HEADER_SEARCH_PATHS = ( 461 | "$(inherited)", 462 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 463 | "$(SRCROOT)/node_modules/react-native/React/**", 464 | ); 465 | INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; 466 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 467 | OTHER_LDFLAGS = "-ObjC"; 468 | PRODUCT_NAME = PropertyFinder; 469 | }; 470 | name = Release; 471 | }; 472 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 473 | isa = XCBuildConfiguration; 474 | buildSettings = { 475 | ALWAYS_SEARCH_USER_PATHS = NO; 476 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 477 | CLANG_CXX_LIBRARY = "libc++"; 478 | CLANG_ENABLE_MODULES = YES; 479 | CLANG_ENABLE_OBJC_ARC = YES; 480 | CLANG_WARN_BOOL_CONVERSION = YES; 481 | CLANG_WARN_CONSTANT_CONVERSION = YES; 482 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 483 | CLANG_WARN_EMPTY_BODY = YES; 484 | CLANG_WARN_ENUM_CONVERSION = YES; 485 | CLANG_WARN_INT_CONVERSION = YES; 486 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 487 | CLANG_WARN_UNREACHABLE_CODE = YES; 488 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 489 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 490 | COPY_PHASE_STRIP = NO; 491 | ENABLE_STRICT_OBJC_MSGSEND = YES; 492 | GCC_C_LANGUAGE_STANDARD = gnu99; 493 | GCC_DYNAMIC_NO_PIC = NO; 494 | GCC_OPTIMIZATION_LEVEL = 0; 495 | GCC_PREPROCESSOR_DEFINITIONS = ( 496 | "DEBUG=1", 497 | "$(inherited)", 498 | ); 499 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 500 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 501 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 502 | GCC_WARN_UNDECLARED_SELECTOR = YES; 503 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 504 | GCC_WARN_UNUSED_FUNCTION = YES; 505 | GCC_WARN_UNUSED_VARIABLE = YES; 506 | HEADER_SEARCH_PATHS = ( 507 | "$(inherited)", 508 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 509 | "$(SRCROOT)/node_modules/react-native/React/**", 510 | ); 511 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 512 | MTL_ENABLE_DEBUG_INFO = YES; 513 | ONLY_ACTIVE_ARCH = YES; 514 | SDKROOT = iphoneos; 515 | }; 516 | name = Debug; 517 | }; 518 | 83CBBA211A601CBA00E9B192 /* Release */ = { 519 | isa = XCBuildConfiguration; 520 | buildSettings = { 521 | ALWAYS_SEARCH_USER_PATHS = NO; 522 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 523 | CLANG_CXX_LIBRARY = "libc++"; 524 | CLANG_ENABLE_MODULES = YES; 525 | CLANG_ENABLE_OBJC_ARC = YES; 526 | CLANG_WARN_BOOL_CONVERSION = YES; 527 | CLANG_WARN_CONSTANT_CONVERSION = YES; 528 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 529 | CLANG_WARN_EMPTY_BODY = YES; 530 | CLANG_WARN_ENUM_CONVERSION = YES; 531 | CLANG_WARN_INT_CONVERSION = YES; 532 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 533 | CLANG_WARN_UNREACHABLE_CODE = YES; 534 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 535 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 536 | COPY_PHASE_STRIP = YES; 537 | ENABLE_NS_ASSERTIONS = NO; 538 | ENABLE_STRICT_OBJC_MSGSEND = YES; 539 | GCC_C_LANGUAGE_STANDARD = gnu99; 540 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 541 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 542 | GCC_WARN_UNDECLARED_SELECTOR = YES; 543 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 544 | GCC_WARN_UNUSED_FUNCTION = YES; 545 | GCC_WARN_UNUSED_VARIABLE = YES; 546 | HEADER_SEARCH_PATHS = ( 547 | "$(inherited)", 548 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 549 | "$(SRCROOT)/node_modules/react-native/React/**", 550 | ); 551 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 552 | MTL_ENABLE_DEBUG_INFO = NO; 553 | SDKROOT = iphoneos; 554 | VALIDATE_PRODUCT = YES; 555 | }; 556 | name = Release; 557 | }; 558 | /* End XCBuildConfiguration section */ 559 | 560 | /* Begin XCConfigurationList section */ 561 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "PropertyFinder" */ = { 562 | isa = XCConfigurationList; 563 | buildConfigurations = ( 564 | 13B07F941A680F5B00A75B9A /* Debug */, 565 | 13B07F951A680F5B00A75B9A /* Release */, 566 | ); 567 | defaultConfigurationIsVisible = 0; 568 | defaultConfigurationName = Release; 569 | }; 570 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PropertyFinder" */ = { 571 | isa = XCConfigurationList; 572 | buildConfigurations = ( 573 | 83CBBA201A601CBA00E9B192 /* Debug */, 574 | 83CBBA211A601CBA00E9B192 /* Release */, 575 | ); 576 | defaultConfigurationIsVisible = 0; 577 | defaultConfigurationName = Release; 578 | }; 579 | /* End XCConfigurationList section */ 580 | }; 581 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 582 | } 583 | -------------------------------------------------------------------------------- /PropertyFinder.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PropertyFinder.xcodeproj/xcshareddata/xcschemes/PropertyFinder.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /PropertyView.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var React = require('react-native'); 4 | var { 5 | StyleSheet, 6 | Image, 7 | View, 8 | Text, 9 | Component 10 | } = React; 11 | 12 | var styles = StyleSheet.create({ 13 | container: { 14 | marginTop: 65 15 | }, 16 | heading: { 17 | backgroundColor: '#F8F8F8', 18 | }, 19 | separator: { 20 | height: 1, 21 | backgroundColor: '#DDDDDD' 22 | }, 23 | image: { 24 | width: 400, 25 | height: 300 26 | }, 27 | price: { 28 | fontSize: 25, 29 | fontWeight: 'bold', 30 | margin: 5, 31 | color: '#48BBEC' 32 | }, 33 | title: { 34 | fontSize: 20, 35 | margin: 5, 36 | color: '#656565' 37 | }, 38 | description: { 39 | fontSize: 18, 40 | margin: 5, 41 | color: '#656565' 42 | } 43 | }); 44 | 45 | class PropertyView extends Component { 46 | 47 | render() { 48 | var property = this.props.property; 49 | var stats = property.bedroom_number + ' bed ' + property.property_type; 50 | if (property.bathroom_number) { 51 | stats += ', ' + property.bathroom_number + ' ' + (property.bathroom_number > 1 52 | ? 'bathrooms' : 'bathroom'); 53 | } 54 | 55 | var price = property.price_formatted.split(' ')[0]; 56 | 57 | return ( 58 | 59 | 61 | 62 | £{price} 63 | {property.title} 64 | 65 | 66 | {stats} 67 | {property.summary} 68 | 69 | ); 70 | } 71 | }; 72 | 73 | module.exports = PropertyView; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native PropertyFinder App 2 | 3 | This repository accompanies the [tutorial I published on Ray Wenderlich's website](http://www.raywenderlich.com/99473/introducing-react-native-building-apps-javascript), which describes the process of building a simple property search application using React Native. 4 | 5 | The project was created using the `react-native-cli` tool: 6 | 7 | react-native init PropertyFinder 8 | 9 | To run this project you need to fetch the node dependencies using the following command: 10 | 11 | npm install 12 | -------------------------------------------------------------------------------- /SearchPage.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var React = require('react-native'); 4 | var SearchResults = require('./SearchResults'); 5 | var { 6 | StyleSheet, 7 | Text, 8 | TextInput, 9 | View, 10 | TouchableHighlight, 11 | ActivityIndicatorIOS, 12 | Image, 13 | Component 14 | } = React; 15 | 16 | var styles = StyleSheet.create({ 17 | description: { 18 | marginBottom: 20, 19 | fontSize: 18, 20 | textAlign: 'center', 21 | color: '#656565' 22 | }, 23 | container: { 24 | padding: 30, 25 | marginTop: 65, 26 | alignItems: 'center' 27 | }, 28 | flowRight: { 29 | flexDirection: 'row', 30 | alignItems: 'center', 31 | alignSelf: 'stretch' 32 | }, 33 | buttonText: { 34 | fontSize: 18, 35 | color: 'white', 36 | alignSelf: 'center' 37 | }, 38 | button: { 39 | height: 36, 40 | flex: 1, 41 | flexDirection: 'row', 42 | backgroundColor: '#48BBEC', 43 | borderColor: '#48BBEC', 44 | borderWidth: 1, 45 | borderRadius: 8, 46 | marginBottom: 10, 47 | alignSelf: 'stretch', 48 | justifyContent: 'center' 49 | }, 50 | searchInput: { 51 | height: 36, 52 | padding: 4, 53 | marginRight: 5, 54 | flex: 4, 55 | fontSize: 18, 56 | borderWidth: 1, 57 | borderColor: '#48BBEC', 58 | borderRadius: 8, 59 | color: '#48BBEC' 60 | }, 61 | image: { 62 | width: 217, 63 | height: 138 64 | } 65 | }); 66 | 67 | function urlForQueryAndPage(key, value, pageNumber) { 68 | var data = { 69 | country: 'uk', 70 | pretty: '1', 71 | encoding: 'json', 72 | listing_type: 'buy', 73 | action: 'search_listings', 74 | page: pageNumber 75 | }; 76 | data[key] = value; 77 | 78 | var querystring = Object.keys(data) 79 | .map(key => key + '=' + encodeURIComponent(data[key])) 80 | .join('&'); 81 | 82 | return 'http://api.nestoria.co.uk/api?' + querystring; 83 | }; 84 | 85 | class SearchPage extends Component { 86 | 87 | constructor(props) { 88 | super(props); 89 | this.state = { 90 | searchString: 'london', 91 | isLoading: false, 92 | message: '' 93 | }; 94 | } 95 | 96 | _handleResponse(response) { 97 | this.setState({ isLoading: false }); 98 | if (response.application_response_code.substr(0, 1) === '1') { 99 | this.props.navigator.push({ 100 | title: 'Results', 101 | component: SearchResults, 102 | passProps: {listings: response.listings} 103 | }); 104 | } else { 105 | this.setState({ message: 'Location not recognized please try again.'}); 106 | } 107 | } 108 | 109 | _executeQuery(query) { 110 | this.setState({ isLoading: true, message: '' }); 111 | fetch(query) 112 | .then(response => response.json()) 113 | .then(json => this._handleResponse(json.response)) 114 | .catch(error => { 115 | this.setState({ 116 | isLoading: false, 117 | message: 'Something bad happened ' + error 118 | }); 119 | }); 120 | } 121 | 122 | onSearchPressed() { 123 | var query = urlForQueryAndPage('place_name', this.state.searchString, 1); 124 | this._executeQuery(query); 125 | } 126 | 127 | onLocationPressed() { 128 | navigator.geolocation.getCurrentPosition( 129 | location => { 130 | var search = location.coords.latitude + ',' + location.coords.longitude; 131 | this.setState({ searchString: search }); 132 | var query = urlForQueryAndPage('centre_point', search, 1); 133 | this._executeQuery(query); 134 | }, 135 | error => { 136 | this.setState({ 137 | message: 'There was a problem with obtaining your locaton: ' + error 138 | }); 139 | }); 140 | } 141 | 142 | onSearchTextChanged(event) { 143 | this.setState({ searchString: event.nativeEvent.text }); 144 | } 145 | 146 | render() { 147 | var spinner = this.state.isLoading ? 148 | (