├── .gitignore ├── README.md ├── Simple Universal Webview App.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── nfrmn.xcuserdatad │ └── xcschemes │ ├── Simple Universal Webview App.xcscheme │ └── xcschememanagement.plist ├── Simple Universal Webview App ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── ViewController.swift └── web_content ├── Simple Universal Webview AppTests └── Info.plist └── www └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | **/*.DS_Store 2 | xcuserdata -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Simple Universal Webview App 2 | 3 | This is an Xcode 6 Universal project that allows you to wrap your website or web app in a super simple iOS app. 4 | 5 | # Setup 6 | - Clone this repo, or hit "Download ZIP" in the Github sidebar. 7 | 8 | ### Local mode (recommended) 9 | - Replace the stuff in `www` with your own mobile website. 10 | - Hit Run! 11 | 12 | ### Internet mode 13 | - In `ViewController.swift`, switch around the commented out URL lines. 14 | - Set your URL... 15 | - Hit Run! 16 | 17 | # Why? 18 | 19 | So you can build an iOS app in HTML/CSS/JS without using Cordova. 20 | 21 | HTML web apps are totally awesome for layout content and typography. Tons of big apps like Instagram use HTML layouts and CSS styling for parts of their apps. 22 | 23 | If you are a web developer who wants to release an iOS app, this should help you cut some corners when it comes to learning Swift. 24 | 25 | # Ideal use 26 | 27 | Single page web app with on-screen/no navigation. For example, a game, interactive page, web based slideshow, etc. 28 | -------------------------------------------------------------------------------- /Simple Universal Webview App.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3F9696E91B3455A200CDD77A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F9696E81B3455A200CDD77A /* AppDelegate.swift */; }; 11 | 3F9696EB1B3455A200CDD77A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F9696EA1B3455A200CDD77A /* ViewController.swift */; }; 12 | 3F9696EE1B3455A200CDD77A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3F9696EC1B3455A200CDD77A /* Main.storyboard */; }; 13 | 3F9696F01B3455A200CDD77A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F9696EF1B3455A200CDD77A /* Images.xcassets */; }; 14 | 3F9696F31B3455A200CDD77A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3F9696F11B3455A200CDD77A /* LaunchScreen.xib */; }; 15 | 3F9697091B34835200CDD77A /* web_content in Resources */ = {isa = PBXBuildFile; fileRef = 3F9697081B34835200CDD77A /* web_content */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXContainerItemProxy section */ 19 | 3F9696F91B3455A200CDD77A /* PBXContainerItemProxy */ = { 20 | isa = PBXContainerItemProxy; 21 | containerPortal = 3F9696DB1B3455A200CDD77A /* Project object */; 22 | proxyType = 1; 23 | remoteGlobalIDString = 3F9696E21B3455A200CDD77A; 24 | remoteInfo = "Simple Universal Webview App"; 25 | }; 26 | /* End PBXContainerItemProxy section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | 3F9696E31B3455A200CDD77A /* Simple Universal Webview App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Simple Universal Webview App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 3F9696E71B3455A200CDD77A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 3F9696E81B3455A200CDD77A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 32 | 3F9696EA1B3455A200CDD77A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 33 | 3F9696ED1B3455A200CDD77A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 34 | 3F9696EF1B3455A200CDD77A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 35 | 3F9696F21B3455A200CDD77A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 36 | 3F9696F81B3455A200CDD77A /* Simple Universal Webview AppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Simple Universal Webview AppTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 3F9696FD1B3455A200CDD77A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 3F9697081B34835200CDD77A /* web_content */ = {isa = PBXFileReference; lastKnownFileType = folder; path = web_content; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 3F9696E01B3455A200CDD77A /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | 3F9696F51B3455A200CDD77A /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | 3F9696DA1B3455A200CDD77A = { 60 | isa = PBXGroup; 61 | children = ( 62 | 3F9696E51B3455A200CDD77A /* Simple Universal Webview App */, 63 | 3F9696FB1B3455A200CDD77A /* Simple Universal Webview AppTests */, 64 | 3F9696E41B3455A200CDD77A /* Products */, 65 | ); 66 | sourceTree = ""; 67 | }; 68 | 3F9696E41B3455A200CDD77A /* Products */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 3F9696E31B3455A200CDD77A /* Simple Universal Webview App.app */, 72 | 3F9696F81B3455A200CDD77A /* Simple Universal Webview AppTests.xctest */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | 3F9696E51B3455A200CDD77A /* Simple Universal Webview App */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 3F9697081B34835200CDD77A /* web_content */, 81 | 3F9696E81B3455A200CDD77A /* AppDelegate.swift */, 82 | 3F9696EA1B3455A200CDD77A /* ViewController.swift */, 83 | 3F9696EC1B3455A200CDD77A /* Main.storyboard */, 84 | 3F9696EF1B3455A200CDD77A /* Images.xcassets */, 85 | 3F9696F11B3455A200CDD77A /* LaunchScreen.xib */, 86 | 3F9696E61B3455A200CDD77A /* Supporting Files */, 87 | ); 88 | path = "Simple Universal Webview App"; 89 | sourceTree = ""; 90 | }; 91 | 3F9696E61B3455A200CDD77A /* Supporting Files */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 3F9696E71B3455A200CDD77A /* Info.plist */, 95 | ); 96 | name = "Supporting Files"; 97 | sourceTree = ""; 98 | }; 99 | 3F9696FB1B3455A200CDD77A /* Simple Universal Webview AppTests */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 3F9696FC1B3455A200CDD77A /* Supporting Files */, 103 | ); 104 | path = "Simple Universal Webview AppTests"; 105 | sourceTree = ""; 106 | }; 107 | 3F9696FC1B3455A200CDD77A /* Supporting Files */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 3F9696FD1B3455A200CDD77A /* Info.plist */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | /* End PBXGroup section */ 116 | 117 | /* Begin PBXNativeTarget section */ 118 | 3F9696E21B3455A200CDD77A /* Simple Universal Webview App */ = { 119 | isa = PBXNativeTarget; 120 | buildConfigurationList = 3F9697021B3455A200CDD77A /* Build configuration list for PBXNativeTarget "Simple Universal Webview App" */; 121 | buildPhases = ( 122 | 3F9696DF1B3455A200CDD77A /* Sources */, 123 | 3F9696E01B3455A200CDD77A /* Frameworks */, 124 | 3F9696E11B3455A200CDD77A /* Resources */, 125 | ); 126 | buildRules = ( 127 | ); 128 | dependencies = ( 129 | ); 130 | name = "Simple Universal Webview App"; 131 | productName = "Simple Universal Webview App"; 132 | productReference = 3F9696E31B3455A200CDD77A /* Simple Universal Webview App.app */; 133 | productType = "com.apple.product-type.application"; 134 | }; 135 | 3F9696F71B3455A200CDD77A /* Simple Universal Webview AppTests */ = { 136 | isa = PBXNativeTarget; 137 | buildConfigurationList = 3F9697051B3455A200CDD77A /* Build configuration list for PBXNativeTarget "Simple Universal Webview AppTests" */; 138 | buildPhases = ( 139 | 3F9696F41B3455A200CDD77A /* Sources */, 140 | 3F9696F51B3455A200CDD77A /* Frameworks */, 141 | 3F9696F61B3455A200CDD77A /* Resources */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | 3F9696FA1B3455A200CDD77A /* PBXTargetDependency */, 147 | ); 148 | name = "Simple Universal Webview AppTests"; 149 | productName = "Simple Universal Webview AppTests"; 150 | productReference = 3F9696F81B3455A200CDD77A /* Simple Universal Webview AppTests.xctest */; 151 | productType = "com.apple.product-type.bundle.unit-test"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 3F9696DB1B3455A200CDD77A /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 0630; 160 | ORGANIZATIONNAME = "Freeman Industries"; 161 | TargetAttributes = { 162 | 3F9696E21B3455A200CDD77A = { 163 | CreatedOnToolsVersion = 6.3.2; 164 | }; 165 | 3F9696F71B3455A200CDD77A = { 166 | CreatedOnToolsVersion = 6.3.2; 167 | TestTargetID = 3F9696E21B3455A200CDD77A; 168 | }; 169 | }; 170 | }; 171 | buildConfigurationList = 3F9696DE1B3455A200CDD77A /* Build configuration list for PBXProject "Simple Universal Webview App" */; 172 | compatibilityVersion = "Xcode 3.2"; 173 | developmentRegion = English; 174 | hasScannedForEncodings = 0; 175 | knownRegions = ( 176 | en, 177 | Base, 178 | ); 179 | mainGroup = 3F9696DA1B3455A200CDD77A; 180 | productRefGroup = 3F9696E41B3455A200CDD77A /* Products */; 181 | projectDirPath = ""; 182 | projectRoot = ""; 183 | targets = ( 184 | 3F9696E21B3455A200CDD77A /* Simple Universal Webview App */, 185 | 3F9696F71B3455A200CDD77A /* Simple Universal Webview AppTests */, 186 | ); 187 | }; 188 | /* End PBXProject section */ 189 | 190 | /* Begin PBXResourcesBuildPhase section */ 191 | 3F9696E11B3455A200CDD77A /* Resources */ = { 192 | isa = PBXResourcesBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | 3F9696EE1B3455A200CDD77A /* Main.storyboard in Resources */, 196 | 3F9696F31B3455A200CDD77A /* LaunchScreen.xib in Resources */, 197 | 3F9696F01B3455A200CDD77A /* Images.xcassets in Resources */, 198 | 3F9697091B34835200CDD77A /* web_content in Resources */, 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | 3F9696F61B3455A200CDD77A /* Resources */ = { 203 | isa = PBXResourcesBuildPhase; 204 | buildActionMask = 2147483647; 205 | files = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | }; 209 | /* End PBXResourcesBuildPhase section */ 210 | 211 | /* Begin PBXSourcesBuildPhase section */ 212 | 3F9696DF1B3455A200CDD77A /* Sources */ = { 213 | isa = PBXSourcesBuildPhase; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | 3F9696EB1B3455A200CDD77A /* ViewController.swift in Sources */, 217 | 3F9696E91B3455A200CDD77A /* AppDelegate.swift in Sources */, 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | }; 221 | 3F9696F41B3455A200CDD77A /* Sources */ = { 222 | isa = PBXSourcesBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXSourcesBuildPhase section */ 229 | 230 | /* Begin PBXTargetDependency section */ 231 | 3F9696FA1B3455A200CDD77A /* PBXTargetDependency */ = { 232 | isa = PBXTargetDependency; 233 | target = 3F9696E21B3455A200CDD77A /* Simple Universal Webview App */; 234 | targetProxy = 3F9696F91B3455A200CDD77A /* PBXContainerItemProxy */; 235 | }; 236 | /* End PBXTargetDependency section */ 237 | 238 | /* Begin PBXVariantGroup section */ 239 | 3F9696EC1B3455A200CDD77A /* Main.storyboard */ = { 240 | isa = PBXVariantGroup; 241 | children = ( 242 | 3F9696ED1B3455A200CDD77A /* Base */, 243 | ); 244 | name = Main.storyboard; 245 | sourceTree = ""; 246 | }; 247 | 3F9696F11B3455A200CDD77A /* LaunchScreen.xib */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | 3F9696F21B3455A200CDD77A /* Base */, 251 | ); 252 | name = LaunchScreen.xib; 253 | sourceTree = ""; 254 | }; 255 | /* End PBXVariantGroup section */ 256 | 257 | /* Begin XCBuildConfiguration section */ 258 | 3F9697001B3455A200CDD77A /* Debug */ = { 259 | isa = XCBuildConfiguration; 260 | buildSettings = { 261 | ALWAYS_SEARCH_USER_PATHS = NO; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_WARN_BOOL_CONVERSION = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 269 | CLANG_WARN_EMPTY_BODY = YES; 270 | CLANG_WARN_ENUM_CONVERSION = YES; 271 | CLANG_WARN_INT_CONVERSION = YES; 272 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 273 | CLANG_WARN_UNREACHABLE_CODE = YES; 274 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 275 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 276 | COPY_PHASE_STRIP = NO; 277 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 278 | ENABLE_STRICT_OBJC_MSGSEND = YES; 279 | GCC_C_LANGUAGE_STANDARD = gnu99; 280 | GCC_DYNAMIC_NO_PIC = NO; 281 | GCC_NO_COMMON_BLOCKS = YES; 282 | GCC_OPTIMIZATION_LEVEL = 0; 283 | GCC_PREPROCESSOR_DEFINITIONS = ( 284 | "DEBUG=1", 285 | "$(inherited)", 286 | ); 287 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 288 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 289 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 290 | GCC_WARN_UNDECLARED_SELECTOR = YES; 291 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 292 | GCC_WARN_UNUSED_FUNCTION = YES; 293 | GCC_WARN_UNUSED_VARIABLE = YES; 294 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 295 | MTL_ENABLE_DEBUG_INFO = YES; 296 | ONLY_ACTIVE_ARCH = YES; 297 | SDKROOT = iphoneos; 298 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 299 | TARGETED_DEVICE_FAMILY = "1,2"; 300 | }; 301 | name = Debug; 302 | }; 303 | 3F9697011B3455A200CDD77A /* Release */ = { 304 | isa = XCBuildConfiguration; 305 | buildSettings = { 306 | ALWAYS_SEARCH_USER_PATHS = NO; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BOOL_CONVERSION = YES; 312 | CLANG_WARN_CONSTANT_CONVERSION = YES; 313 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 314 | CLANG_WARN_EMPTY_BODY = YES; 315 | CLANG_WARN_ENUM_CONVERSION = YES; 316 | CLANG_WARN_INT_CONVERSION = YES; 317 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 318 | CLANG_WARN_UNREACHABLE_CODE = YES; 319 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 320 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 321 | COPY_PHASE_STRIP = NO; 322 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 323 | ENABLE_NS_ASSERTIONS = NO; 324 | ENABLE_STRICT_OBJC_MSGSEND = YES; 325 | GCC_C_LANGUAGE_STANDARD = gnu99; 326 | GCC_NO_COMMON_BLOCKS = YES; 327 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 328 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 329 | GCC_WARN_UNDECLARED_SELECTOR = YES; 330 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 331 | GCC_WARN_UNUSED_FUNCTION = YES; 332 | GCC_WARN_UNUSED_VARIABLE = YES; 333 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 334 | MTL_ENABLE_DEBUG_INFO = NO; 335 | SDKROOT = iphoneos; 336 | TARGETED_DEVICE_FAMILY = "1,2"; 337 | VALIDATE_PRODUCT = YES; 338 | }; 339 | name = Release; 340 | }; 341 | 3F9697031B3455A200CDD77A /* Debug */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 345 | INFOPLIST_FILE = "Simple Universal Webview App/Info.plist"; 346 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 347 | PRODUCT_NAME = "$(TARGET_NAME)"; 348 | }; 349 | name = Debug; 350 | }; 351 | 3F9697041B3455A200CDD77A /* Release */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 355 | INFOPLIST_FILE = "Simple Universal Webview App/Info.plist"; 356 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 357 | PRODUCT_NAME = "$(TARGET_NAME)"; 358 | }; 359 | name = Release; 360 | }; 361 | 3F9697061B3455A200CDD77A /* Debug */ = { 362 | isa = XCBuildConfiguration; 363 | buildSettings = { 364 | BUNDLE_LOADER = "$(TEST_HOST)"; 365 | FRAMEWORK_SEARCH_PATHS = ( 366 | "$(SDKROOT)/Developer/Library/Frameworks", 367 | "$(inherited)", 368 | ); 369 | GCC_PREPROCESSOR_DEFINITIONS = ( 370 | "DEBUG=1", 371 | "$(inherited)", 372 | ); 373 | INFOPLIST_FILE = "Simple Universal Webview AppTests/Info.plist"; 374 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 375 | PRODUCT_NAME = "$(TARGET_NAME)"; 376 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Simple Universal Webview App.app/Simple Universal Webview App"; 377 | }; 378 | name = Debug; 379 | }; 380 | 3F9697071B3455A200CDD77A /* Release */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | BUNDLE_LOADER = "$(TEST_HOST)"; 384 | FRAMEWORK_SEARCH_PATHS = ( 385 | "$(SDKROOT)/Developer/Library/Frameworks", 386 | "$(inherited)", 387 | ); 388 | INFOPLIST_FILE = "Simple Universal Webview AppTests/Info.plist"; 389 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 390 | PRODUCT_NAME = "$(TARGET_NAME)"; 391 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Simple Universal Webview App.app/Simple Universal Webview App"; 392 | }; 393 | name = Release; 394 | }; 395 | /* End XCBuildConfiguration section */ 396 | 397 | /* Begin XCConfigurationList section */ 398 | 3F9696DE1B3455A200CDD77A /* Build configuration list for PBXProject "Simple Universal Webview App" */ = { 399 | isa = XCConfigurationList; 400 | buildConfigurations = ( 401 | 3F9697001B3455A200CDD77A /* Debug */, 402 | 3F9697011B3455A200CDD77A /* Release */, 403 | ); 404 | defaultConfigurationIsVisible = 0; 405 | defaultConfigurationName = Release; 406 | }; 407 | 3F9697021B3455A200CDD77A /* Build configuration list for PBXNativeTarget "Simple Universal Webview App" */ = { 408 | isa = XCConfigurationList; 409 | buildConfigurations = ( 410 | 3F9697031B3455A200CDD77A /* Debug */, 411 | 3F9697041B3455A200CDD77A /* Release */, 412 | ); 413 | defaultConfigurationIsVisible = 0; 414 | defaultConfigurationName = Release; 415 | }; 416 | 3F9697051B3455A200CDD77A /* Build configuration list for PBXNativeTarget "Simple Universal Webview AppTests" */ = { 417 | isa = XCConfigurationList; 418 | buildConfigurations = ( 419 | 3F9697061B3455A200CDD77A /* Debug */, 420 | 3F9697071B3455A200CDD77A /* Release */, 421 | ); 422 | defaultConfigurationIsVisible = 0; 423 | defaultConfigurationName = Release; 424 | }; 425 | /* End XCConfigurationList section */ 426 | }; 427 | rootObject = 3F9696DB1B3455A200CDD77A /* Project object */; 428 | } 429 | -------------------------------------------------------------------------------- /Simple Universal Webview App.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Simple Universal Webview App.xcodeproj/xcuserdata/nfrmn.xcuserdatad/xcschemes/Simple Universal Webview App.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /Simple Universal Webview App.xcodeproj/xcuserdata/nfrmn.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Simple Universal Webview App.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 3F9696E21B3455A200CDD77A 16 | 17 | primary 18 | 19 | 20 | 3F9696F71B3455A200CDD77A 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Simple Universal Webview App/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Simple Universal Webview App 4 | // 5 | // Created by Nabil Freeman on 19/06/2015. 6 | // Copyright (c) 2015 Freeman Industries. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Simple Universal Webview App/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Simple Universal Webview App/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Simple Universal Webview App/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Simple Universal Webview App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.freeman.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarHidden 34 | 35 | UIStatusBarStyle 36 | UIStatusBarStyleLightContent 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | UISupportedInterfaceOrientations~ipad 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationPortraitUpsideDown 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Simple Universal Webview App/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Simple Universal Webview App 4 | // 5 | // Created by Nabil Freeman on 19/06/2015. 6 | // Copyright (c) 2015 Freeman Industries. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import WebKit 11 | 12 | class ViewController: UIViewController { 13 | 14 | var wkWebView: WKWebView? 15 | var uiWebView: UIWebView? 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | // Do any additional setup after loading the view, typically from a nib. 20 | 21 | // Get main screen rect size 22 | let screenSize: CGRect = UIScreen.mainScreen().bounds 23 | 24 | // Construct frame where webview will be pop 25 | let frameRect: CGRect = CGRect(x: 0, y: 0, width: screenSize.width, height: screenSize.height) 26 | 27 | // Create url request from local index.html file located in web_content 28 | let url: NSURL = NSBundle.mainBundle().URLForResource("web_content/index", withExtension: "html")! 29 | 30 | // Create a url request that points to a remote server (uncomment this line to use a remote url) 31 | // let url: NSURL = NSURL(string: "http://example.com")!; 32 | 33 | let requestObj: NSURLRequest = NSURLRequest(URL: url); 34 | 35 | // Test operating system 36 | if NSProcessInfo().isOperatingSystemAtLeastVersion(NSOperatingSystemVersion(majorVersion: 8, minorVersion: 0, patchVersion: 0)) { 37 | 38 | self.wkWebView = WKWebView(frame: frameRect) 39 | self.wkWebView?.loadRequest(requestObj) 40 | self.view.addSubview(self.wkWebView!) 41 | 42 | } else { 43 | 44 | self.uiWebView = UIWebView(frame: frameRect) 45 | self.uiWebView?.loadRequest(requestObj) 46 | self.view.addSubview(self.uiWebView!) 47 | } 48 | 49 | } 50 | 51 | override func didReceiveMemoryWarning() { 52 | super.didReceiveMemoryWarning() 53 | // Dispose of any resources that can be recreated. 54 | } 55 | 56 | //Commented: black status bar. 57 | //Uncommented: white status bar. 58 | override func preferredStatusBarStyle() -> UIStatusBarStyle { 59 | return UIStatusBarStyle.LightContent 60 | } 61 | 62 | } 63 | 64 | -------------------------------------------------------------------------------- /Simple Universal Webview App/web_content: -------------------------------------------------------------------------------- 1 | ../www -------------------------------------------------------------------------------- /Simple Universal Webview AppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.freeman.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello wrold 5 | 11 | 12 | 13 |

14 | Hello world 15 |

16 |

17 | Hey! I am a file called index.html, located in Xcode project in a folder called web_content. 18 |

19 |

20 | Replace me with your cool web app. Try and make as much of it as local as possible. Network requests are supported, but remember to build in some good offline behaviour. 21 |

22 | 23 | 24 | --------------------------------------------------------------------------------