├── .codecov.yml ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .swift-version ├── .travis.yml ├── CHANGELOG.md ├── Example ├── Example.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Example.xcscheme ├── Example │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Info.plist │ └── ViewController.swift └── ExampleUITests │ ├── ExampleUITests.swift │ └── Info.plist ├── JSQWebViewController.podspec ├── JSQWebViewController.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── JSQWebViewController.xcscheme ├── LICENSE ├── Package.swift ├── README.md ├── Screenshots ├── screenshot_0.png └── screenshot_1.png ├── Source ├── Info.plist ├── JSQWebViewController.h └── WebViewController.swift ├── Tests ├── Info.plist └── JSQWebViewControllerTests.swift ├── build_docs.sh └── docs ├── Classes.html ├── Classes └── WebViewController.html ├── badge.svg ├── css ├── highlight.css └── jazzy.css ├── img ├── carat.png ├── dash.png └── gh.png ├── index.html ├── js ├── jazzy.js └── jquery.min.js ├── search.json └── undocumented.json /.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | branch: master 3 | 4 | coverage: 5 | precision: 2 6 | round: nearest 7 | range: "60...100" 8 | ignore: 9 | - Tests/* 10 | - Example/* 11 | 12 | status: 13 | project: 14 | default: 15 | target: auto 16 | branches: 17 | - master 18 | - develop 19 | 20 | comment: 21 | layout: "header, diff, changes, sunburst, uncovered, tree" 22 | behavior: default 23 | branches: 24 | - master 25 | - develop 26 | 27 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How To Contribute 2 | 3 | Please follow these sweet [contribution guidelines](https://github.com/jessesquires/HowToContribute). 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## New issue checklist 2 | 3 | 4 | - [ ] I have read all of the [`README`](https://github.com/jessesquires/JSQDataSourcesKit/blob/develop/README.md) and [documentation](http://www.jessesquires.com/JSQDataSourcesKit/). 5 | - [ ] I have reviewed the [contributing guidelines](https://github.com/jessesquires/HowToContribute). 6 | - [ ] I have searched [existing issues](https://github.com/jessesquires/JSQDataSourcesKit/issues?q=is%3Aissue+sort%3Acreated-desc) and **this is not a duplicate**. 7 | 8 | ## General information 9 | 10 | - Library version: 11 | - OS version: 12 | - Devices/Simulators: 13 | - Reproducible in the demo project (Yes/No): 14 | - Any related issues: 15 | 16 | ## What happened? 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Pull request checklist 2 | 3 | - [ ] All tests pass. 4 | - [ ] Demo project builds and runs. 5 | - [ ] I have resolved merge conflicts. 6 | - [ ] I have followed the [coding style](https://github.com/jessesquires/HowToContribute#style-guidelines) and [contributing guidelines](https://github.com/jessesquires/HowToContribute). 7 | 8 | #### This fixes issue # 9 | 10 | ## What's in this pull request? 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # docs 4 | docs/docsets 5 | 6 | # Xcode 7 | # 8 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 9 | 10 | ## Build generated 11 | build/ 12 | DerivedData/ 13 | 14 | ## Various settings 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata/ 24 | 25 | ## Other 26 | *.moved-aside 27 | *.xcuserstate 28 | 29 | ## Obj-C/Swift specific 30 | *.hmap 31 | *.ipa 32 | *.dSYM.zip 33 | *.dSYM 34 | 35 | ## Playgrounds 36 | timeline.xctimeline 37 | playground.xcworkspace 38 | 39 | # Swift Package Manager 40 | # 41 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 42 | # Packages/ 43 | .build/ 44 | 45 | # CocoaPods 46 | # 47 | # We recommend against adding the Pods directory to your .gitignore. However 48 | # you should judge for yourself, the pros and cons are mentioned at: 49 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 50 | # 51 | # Pods/ 52 | 53 | # Carthage 54 | # 55 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 56 | # Carthage/Checkouts 57 | 58 | Carthage/Build 59 | 60 | # fastlane 61 | # 62 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 63 | # screenshots whenever they are needed. 64 | # For more information about the recommended setup visit: 65 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 66 | 67 | fastlane/report.xml 68 | fastlane/Preview.html 69 | fastlane/screenshots 70 | fastlane/test_output 71 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.0 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode9 3 | 4 | env: 5 | global: 6 | - LANG=en_US.UTF-8 7 | 8 | - PROJECT="JSQWebViewController.xcodeproj" 9 | - IOS_SCHEME="JSQWebViewController" 10 | 11 | - IOS_SDK=iphonesimulator11.0 12 | 13 | - EXAMPLE="Example/Example.xcodeproj" 14 | 15 | matrix: 16 | - DESTINATION="OS=8.1,name=iPhone 4s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="YES" POD_LINT="YES" RUN_UI_TESTS="NO" 17 | - DESTINATION="OS=8.2,name=iPhone 5" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" RUN_UI_TESTS="NO" 18 | - DESTINATION="OS=8.3,name=iPhone 5s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" RUN_UI_TESTS="NO" 19 | - DESTINATION="OS=8.4,name=iPhone 6" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" RUN_UI_TESTS="NO" 20 | 21 | - DESTINATION="OS=9.0,name=iPhone 6 Plus" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" RUN_UI_TESTS="YES" 22 | - DESTINATION="OS=9.1,name=iPhone 6s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" RUN_UI_TESTS="NO" 23 | - DESTINATION="OS=9.2,name=iPhone 6s Plus" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" RUN_UI_TESTS="NO" 24 | - DESTINATION="OS=9.3,name=iPad Air 2" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" RUN_UI_TESTS="NO" 25 | 26 | - DESTINATION="OS=10.0,name=iPhone 6s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" RUN_UI_TESTS="NO" 27 | - DESTINATION="OS=10.1,name=iPhone 6s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" RUN_UI_TESTS="NO" 28 | - DESTINATION="OS=10.2,name=iPad Air" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" RUN_UI_TESTS="NO" 29 | - DESTINATION="OS=10.3.1,name=iPhone 7" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" RUN_UI_TESTS="NO" 30 | 31 | - DESTINATION="OS=11.0,name=iPhone X" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" RUN_UI_TESTS="NO" 32 | 33 | script: 34 | - set -o pipefail 35 | 36 | - if [ $POD_LINT == "YES" ]; then 37 | pod lib lint; 38 | fi 39 | 40 | 41 | - if [ $BUILD_EXAMPLE == "YES" ]; then 42 | xcodebuild build analyze -project "$EXAMPLE" -scheme Example -sdk "$SDK" -destination "$DESTINATION" ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO | xcpretty -c; 43 | fi 44 | 45 | 46 | - if [ $RUN_TESTS == "YES" ]; then 47 | xcodebuild analyze test -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO | xcpretty -c; 48 | else 49 | xcodebuild build analyze -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO | xcpretty -c; 50 | fi 51 | 52 | 53 | - if [ $RUN_UI_TESTS == "YES" ]; then 54 | xcodebuild build test -project "$EXAMPLE" -scheme Example -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO | xcpretty -c; 55 | fi 56 | 57 | # Build for reporting test coverage 58 | - if [ $RUN_TESTS == "YES" ]; then 59 | xcodebuild test -project JSQWebViewController.xcodeproj -scheme "JSQWebViewController" -destination "platform=iOS Simulator,name=iPhone 7" CODE_SIGNING_REQUIRED=NO; 60 | fi 61 | 62 | after_success: 63 | - bash <(curl -s https://codecov.io/bash) 64 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | The changelog for `JSQWebViewController`. Also see the [releases](https://github.com/jessesquires/JSQWebViewController/releases) on GitHub. 4 | 5 | -------------------------------------- 6 | 7 | 6.0.0 8 | ----- 9 | 10 | - Swift 4 11 | - Official deprecation 12 | 13 | 5.0.0 14 | ----- 15 | 16 | **Swift 3.0 now required.** 17 | 18 | 4.0.0 19 | ----- 20 | 21 | **Swift 2.3 now required.** 22 | 23 | 3.0.0 24 | ----- 25 | 26 | This release closes the [3.0.0 milestone](https://github.com/jessesquires/JSQWebViewController/issues?utf8=✓&q=+milestone%3A3.0.0+). 27 | 28 | - **Swift 2.2 and above is now required** 29 | - Support Swift Package Manager 30 | 31 | 2.0.1 32 | ----- 33 | 34 | Closes the [2.0.1 milestone](https://github.com/jessesquires/JSQWebViewController/issues?q=milestone%3A2.0.1). 35 | 36 | Minor fixes and refinements. 37 | 38 | 2.0.0 39 | ----- 40 | 41 | Closes the [2.0.0 milestone](https://github.com/jessesquires/JSQWebViewController/issues?q=milestone%3A2.0.0). 42 | 43 | - Migrate to Swift 2.0 44 | - iOS 9 support 45 | 46 | 1.0.0 47 | ----- 48 | 49 | :tada: Initial release :tada: 50 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 880563931DF7223E00031FCC /* JSQWebViewController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 880563901DF7222000031FCC /* JSQWebViewController.framework */; }; 11 | 880563941DF7223E00031FCC /* JSQWebViewController.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 880563901DF7222000031FCC /* JSQWebViewController.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 12 | 886487F41BCADBED00671052 /* ExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 886487F31BCADBED00671052 /* ExampleUITests.swift */; }; 13 | 88AEBB621BADF8C500923E82 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88AEBB611BADF8C500923E82 /* AppDelegate.swift */; }; 14 | 88AEBB641BADF8C500923E82 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88AEBB631BADF8C500923E82 /* ViewController.swift */; }; 15 | 88AEBB671BADF8C600923E82 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 88AEBB651BADF8C600923E82 /* Main.storyboard */; }; 16 | 88AEBB691BADF8C600923E82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88AEBB681BADF8C600923E82 /* Assets.xcassets */; }; 17 | 88AEBB901BADF9B600923E82 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88AEBB8E1BADF9B600923E82 /* LaunchScreen.xib */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 8805638F1DF7222000031FCC /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 8805638A1DF7222000031FCC /* JSQWebViewController.xcodeproj */; 24 | proxyType = 2; 25 | remoteGlobalIDString = 88AEBB081BADF48300923E82; 26 | remoteInfo = JSQWebViewController; 27 | }; 28 | 880563911DF7222000031FCC /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 8805638A1DF7222000031FCC /* JSQWebViewController.xcodeproj */; 31 | proxyType = 2; 32 | remoteGlobalIDString = 88AEBB121BADF48300923E82; 33 | remoteInfo = JSQWebViewControllerTests; 34 | }; 35 | 880563951DF7223E00031FCC /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 8805638A1DF7222000031FCC /* JSQWebViewController.xcodeproj */; 38 | proxyType = 1; 39 | remoteGlobalIDString = 88AEBB071BADF48300923E82; 40 | remoteInfo = JSQWebViewController; 41 | }; 42 | 886487F61BCADBED00671052 /* PBXContainerItemProxy */ = { 43 | isa = PBXContainerItemProxy; 44 | containerPortal = 88AEBB561BADF8C500923E82 /* Project object */; 45 | proxyType = 1; 46 | remoteGlobalIDString = 88AEBB5D1BADF8C500923E82; 47 | remoteInfo = Example; 48 | }; 49 | /* End PBXContainerItemProxy section */ 50 | 51 | /* Begin PBXCopyFilesBuildPhase section */ 52 | 88E3AF7E1CB62CBD00F1E775 /* Embed Frameworks */ = { 53 | isa = PBXCopyFilesBuildPhase; 54 | buildActionMask = 2147483647; 55 | dstPath = ""; 56 | dstSubfolderSpec = 10; 57 | files = ( 58 | 880563941DF7223E00031FCC /* JSQWebViewController.framework in Embed Frameworks */, 59 | ); 60 | name = "Embed Frameworks"; 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXCopyFilesBuildPhase section */ 64 | 65 | /* Begin PBXFileReference section */ 66 | 8805638A1DF7222000031FCC /* JSQWebViewController.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = JSQWebViewController.xcodeproj; path = ../JSQWebViewController.xcodeproj; sourceTree = ""; }; 67 | 886487F11BCADBED00671052 /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | 886487F31BCADBED00671052 /* ExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleUITests.swift; sourceTree = ""; }; 69 | 886487F51BCADBED00671052 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 70 | 88AEBB5E1BADF8C500923E82 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | 88AEBB611BADF8C500923E82 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 72 | 88AEBB631BADF8C500923E82 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 73 | 88AEBB661BADF8C600923E82 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 74 | 88AEBB681BADF8C600923E82 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 75 | 88AEBB6D1BADF8C600923E82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 76 | 88AEBB8F1BADF9B600923E82 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 77 | /* End PBXFileReference section */ 78 | 79 | /* Begin PBXFrameworksBuildPhase section */ 80 | 886487EE1BCADBED00671052 /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | 88AEBB5B1BADF8C500923E82 /* Frameworks */ = { 88 | isa = PBXFrameworksBuildPhase; 89 | buildActionMask = 2147483647; 90 | files = ( 91 | 880563931DF7223E00031FCC /* JSQWebViewController.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 8805638B1DF7222000031FCC /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 880563901DF7222000031FCC /* JSQWebViewController.framework */, 102 | 880563921DF7222000031FCC /* JSQWebViewControllerTests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 886487F21BCADBED00671052 /* ExampleUITests */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 886487F31BCADBED00671052 /* ExampleUITests.swift */, 111 | 886487F51BCADBED00671052 /* Info.plist */, 112 | ); 113 | path = ExampleUITests; 114 | sourceTree = ""; 115 | }; 116 | 88AEBB551BADF8C500923E82 = { 117 | isa = PBXGroup; 118 | children = ( 119 | 8805638A1DF7222000031FCC /* JSQWebViewController.xcodeproj */, 120 | 88AEBB601BADF8C500923E82 /* Example */, 121 | 886487F21BCADBED00671052 /* ExampleUITests */, 122 | 88AEBB5F1BADF8C500923E82 /* Products */, 123 | ); 124 | sourceTree = ""; 125 | }; 126 | 88AEBB5F1BADF8C500923E82 /* Products */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 88AEBB5E1BADF8C500923E82 /* Example.app */, 130 | 886487F11BCADBED00671052 /* ExampleUITests.xctest */, 131 | ); 132 | name = Products; 133 | sourceTree = ""; 134 | }; 135 | 88AEBB601BADF8C500923E82 /* Example */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 88AEBB611BADF8C500923E82 /* AppDelegate.swift */, 139 | 88AEBB681BADF8C600923E82 /* Assets.xcassets */, 140 | 88AEBB6D1BADF8C600923E82 /* Info.plist */, 141 | 88AEBB8E1BADF9B600923E82 /* LaunchScreen.xib */, 142 | 88AEBB651BADF8C600923E82 /* Main.storyboard */, 143 | 88AEBB631BADF8C500923E82 /* ViewController.swift */, 144 | ); 145 | path = Example; 146 | sourceTree = ""; 147 | }; 148 | /* End PBXGroup section */ 149 | 150 | /* Begin PBXNativeTarget section */ 151 | 886487F01BCADBED00671052 /* ExampleUITests */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = 886487F81BCADBED00671052 /* Build configuration list for PBXNativeTarget "ExampleUITests" */; 154 | buildPhases = ( 155 | 886487ED1BCADBED00671052 /* Sources */, 156 | 886487EE1BCADBED00671052 /* Frameworks */, 157 | 886487EF1BCADBED00671052 /* Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | 886487F71BCADBED00671052 /* PBXTargetDependency */, 163 | ); 164 | name = ExampleUITests; 165 | productName = ExampleUITests; 166 | productReference = 886487F11BCADBED00671052 /* ExampleUITests.xctest */; 167 | productType = "com.apple.product-type.bundle.ui-testing"; 168 | }; 169 | 88AEBB5D1BADF8C500923E82 /* Example */ = { 170 | isa = PBXNativeTarget; 171 | buildConfigurationList = 88AEBB7B1BADF8C600923E82 /* Build configuration list for PBXNativeTarget "Example" */; 172 | buildPhases = ( 173 | 88AEBB5A1BADF8C500923E82 /* Sources */, 174 | 88AEBB5B1BADF8C500923E82 /* Frameworks */, 175 | 88AEBB5C1BADF8C500923E82 /* Resources */, 176 | 88E3AF7E1CB62CBD00F1E775 /* Embed Frameworks */, 177 | ); 178 | buildRules = ( 179 | ); 180 | dependencies = ( 181 | 880563961DF7223E00031FCC /* PBXTargetDependency */, 182 | ); 183 | name = Example; 184 | productName = Example; 185 | productReference = 88AEBB5E1BADF8C500923E82 /* Example.app */; 186 | productType = "com.apple.product-type.application"; 187 | }; 188 | /* End PBXNativeTarget section */ 189 | 190 | /* Begin PBXProject section */ 191 | 88AEBB561BADF8C500923E82 /* Project object */ = { 192 | isa = PBXProject; 193 | attributes = { 194 | LastUpgradeCheck = 0900; 195 | ORGANIZATIONNAME = "Hexed Bits"; 196 | TargetAttributes = { 197 | 886487F01BCADBED00671052 = { 198 | CreatedOnToolsVersion = 7.0.1; 199 | LastSwiftMigration = 0900; 200 | TestTargetID = 88AEBB5D1BADF8C500923E82; 201 | }; 202 | 88AEBB5D1BADF8C500923E82 = { 203 | CreatedOnToolsVersion = 7.0; 204 | LastSwiftMigration = 0900; 205 | }; 206 | }; 207 | }; 208 | buildConfigurationList = 88AEBB591BADF8C500923E82 /* Build configuration list for PBXProject "Example" */; 209 | compatibilityVersion = "Xcode 3.2"; 210 | developmentRegion = English; 211 | hasScannedForEncodings = 0; 212 | knownRegions = ( 213 | en, 214 | Base, 215 | ); 216 | mainGroup = 88AEBB551BADF8C500923E82; 217 | productRefGroup = 88AEBB5F1BADF8C500923E82 /* Products */; 218 | projectDirPath = ""; 219 | projectReferences = ( 220 | { 221 | ProductGroup = 8805638B1DF7222000031FCC /* Products */; 222 | ProjectRef = 8805638A1DF7222000031FCC /* JSQWebViewController.xcodeproj */; 223 | }, 224 | ); 225 | projectRoot = ""; 226 | targets = ( 227 | 88AEBB5D1BADF8C500923E82 /* Example */, 228 | 886487F01BCADBED00671052 /* ExampleUITests */, 229 | ); 230 | }; 231 | /* End PBXProject section */ 232 | 233 | /* Begin PBXReferenceProxy section */ 234 | 880563901DF7222000031FCC /* JSQWebViewController.framework */ = { 235 | isa = PBXReferenceProxy; 236 | fileType = wrapper.framework; 237 | path = JSQWebViewController.framework; 238 | remoteRef = 8805638F1DF7222000031FCC /* PBXContainerItemProxy */; 239 | sourceTree = BUILT_PRODUCTS_DIR; 240 | }; 241 | 880563921DF7222000031FCC /* JSQWebViewControllerTests.xctest */ = { 242 | isa = PBXReferenceProxy; 243 | fileType = wrapper.cfbundle; 244 | path = JSQWebViewControllerTests.xctest; 245 | remoteRef = 880563911DF7222000031FCC /* PBXContainerItemProxy */; 246 | sourceTree = BUILT_PRODUCTS_DIR; 247 | }; 248 | /* End PBXReferenceProxy section */ 249 | 250 | /* Begin PBXResourcesBuildPhase section */ 251 | 886487EF1BCADBED00671052 /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | 88AEBB5C1BADF8C500923E82 /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | 88AEBB691BADF8C600923E82 /* Assets.xcassets in Resources */, 263 | 88AEBB901BADF9B600923E82 /* LaunchScreen.xib in Resources */, 264 | 88AEBB671BADF8C600923E82 /* Main.storyboard in Resources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | /* End PBXResourcesBuildPhase section */ 269 | 270 | /* Begin PBXSourcesBuildPhase section */ 271 | 886487ED1BCADBED00671052 /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 886487F41BCADBED00671052 /* ExampleUITests.swift in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | 88AEBB5A1BADF8C500923E82 /* Sources */ = { 280 | isa = PBXSourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 88AEBB641BADF8C500923E82 /* ViewController.swift in Sources */, 284 | 88AEBB621BADF8C500923E82 /* AppDelegate.swift in Sources */, 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | /* End PBXSourcesBuildPhase section */ 289 | 290 | /* Begin PBXTargetDependency section */ 291 | 880563961DF7223E00031FCC /* PBXTargetDependency */ = { 292 | isa = PBXTargetDependency; 293 | name = JSQWebViewController; 294 | targetProxy = 880563951DF7223E00031FCC /* PBXContainerItemProxy */; 295 | }; 296 | 886487F71BCADBED00671052 /* PBXTargetDependency */ = { 297 | isa = PBXTargetDependency; 298 | target = 88AEBB5D1BADF8C500923E82 /* Example */; 299 | targetProxy = 886487F61BCADBED00671052 /* PBXContainerItemProxy */; 300 | }; 301 | /* End PBXTargetDependency section */ 302 | 303 | /* Begin PBXVariantGroup section */ 304 | 88AEBB651BADF8C600923E82 /* Main.storyboard */ = { 305 | isa = PBXVariantGroup; 306 | children = ( 307 | 88AEBB661BADF8C600923E82 /* Base */, 308 | ); 309 | name = Main.storyboard; 310 | sourceTree = ""; 311 | }; 312 | 88AEBB8E1BADF9B600923E82 /* LaunchScreen.xib */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | 88AEBB8F1BADF9B600923E82 /* Base */, 316 | ); 317 | name = LaunchScreen.xib; 318 | sourceTree = ""; 319 | }; 320 | /* End PBXVariantGroup section */ 321 | 322 | /* Begin XCBuildConfiguration section */ 323 | 886487F91BCADBED00671052 /* Debug */ = { 324 | isa = XCBuildConfiguration; 325 | buildSettings = { 326 | INFOPLIST_FILE = ExampleUITests/Info.plist; 327 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 328 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 329 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.ExampleUITests; 330 | PRODUCT_NAME = "$(TARGET_NAME)"; 331 | SWIFT_VERSION = 4.0; 332 | TEST_TARGET_NAME = Example; 333 | USES_XCTRUNNER = YES; 334 | }; 335 | name = Debug; 336 | }; 337 | 886487FA1BCADBED00671052 /* Release */ = { 338 | isa = XCBuildConfiguration; 339 | buildSettings = { 340 | INFOPLIST_FILE = ExampleUITests/Info.plist; 341 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 342 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 343 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.ExampleUITests; 344 | PRODUCT_NAME = "$(TARGET_NAME)"; 345 | SWIFT_VERSION = 4.0; 346 | TEST_TARGET_NAME = Example; 347 | USES_XCTRUNNER = YES; 348 | }; 349 | name = Release; 350 | }; 351 | 88AEBB791BADF8C600923E82 /* Debug */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | ALWAYS_SEARCH_USER_PATHS = NO; 355 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 356 | CLANG_CXX_LIBRARY = "libc++"; 357 | CLANG_ENABLE_MODULES = YES; 358 | CLANG_ENABLE_OBJC_ARC = YES; 359 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 360 | CLANG_WARN_BOOL_CONVERSION = YES; 361 | CLANG_WARN_COMMA = YES; 362 | CLANG_WARN_CONSTANT_CONVERSION = YES; 363 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 364 | CLANG_WARN_EMPTY_BODY = YES; 365 | CLANG_WARN_ENUM_CONVERSION = YES; 366 | CLANG_WARN_INFINITE_RECURSION = YES; 367 | CLANG_WARN_INT_CONVERSION = YES; 368 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 369 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 370 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 371 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 372 | CLANG_WARN_STRICT_PROTOTYPES = YES; 373 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 374 | CLANG_WARN_UNREACHABLE_CODE = YES; 375 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 376 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 377 | COPY_PHASE_STRIP = NO; 378 | DEBUG_INFORMATION_FORMAT = dwarf; 379 | ENABLE_STRICT_OBJC_MSGSEND = YES; 380 | ENABLE_TESTABILITY = YES; 381 | GCC_C_LANGUAGE_STANDARD = gnu99; 382 | GCC_DYNAMIC_NO_PIC = NO; 383 | GCC_NO_COMMON_BLOCKS = YES; 384 | GCC_OPTIMIZATION_LEVEL = 0; 385 | GCC_PREPROCESSOR_DEFINITIONS = ( 386 | "DEBUG=1", 387 | "$(inherited)", 388 | ); 389 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 390 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 391 | GCC_WARN_UNDECLARED_SELECTOR = YES; 392 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 393 | GCC_WARN_UNUSED_FUNCTION = YES; 394 | GCC_WARN_UNUSED_VARIABLE = YES; 395 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 396 | MTL_ENABLE_DEBUG_INFO = YES; 397 | ONLY_ACTIVE_ARCH = YES; 398 | SDKROOT = iphoneos; 399 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 400 | SWIFT_VERSION = 4.0; 401 | TARGETED_DEVICE_FAMILY = "1,2"; 402 | }; 403 | name = Debug; 404 | }; 405 | 88AEBB7A1BADF8C600923E82 /* Release */ = { 406 | isa = XCBuildConfiguration; 407 | buildSettings = { 408 | ALWAYS_SEARCH_USER_PATHS = NO; 409 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 410 | CLANG_CXX_LIBRARY = "libc++"; 411 | CLANG_ENABLE_MODULES = YES; 412 | CLANG_ENABLE_OBJC_ARC = YES; 413 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 414 | CLANG_WARN_BOOL_CONVERSION = YES; 415 | CLANG_WARN_COMMA = YES; 416 | CLANG_WARN_CONSTANT_CONVERSION = YES; 417 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 418 | CLANG_WARN_EMPTY_BODY = YES; 419 | CLANG_WARN_ENUM_CONVERSION = YES; 420 | CLANG_WARN_INFINITE_RECURSION = YES; 421 | CLANG_WARN_INT_CONVERSION = YES; 422 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 423 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 424 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 425 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 426 | CLANG_WARN_STRICT_PROTOTYPES = YES; 427 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 428 | CLANG_WARN_UNREACHABLE_CODE = YES; 429 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 430 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 431 | COPY_PHASE_STRIP = NO; 432 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 433 | ENABLE_NS_ASSERTIONS = NO; 434 | ENABLE_STRICT_OBJC_MSGSEND = YES; 435 | GCC_C_LANGUAGE_STANDARD = gnu99; 436 | GCC_NO_COMMON_BLOCKS = YES; 437 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 438 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 439 | GCC_WARN_UNDECLARED_SELECTOR = YES; 440 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 441 | GCC_WARN_UNUSED_FUNCTION = YES; 442 | GCC_WARN_UNUSED_VARIABLE = YES; 443 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 444 | MTL_ENABLE_DEBUG_INFO = NO; 445 | SDKROOT = iphoneos; 446 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 447 | SWIFT_VERSION = 4.0; 448 | TARGETED_DEVICE_FAMILY = "1,2"; 449 | VALIDATE_PRODUCT = YES; 450 | }; 451 | name = Release; 452 | }; 453 | 88AEBB7C1BADF8C600923E82 /* Debug */ = { 454 | isa = XCBuildConfiguration; 455 | buildSettings = { 456 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 457 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 458 | DEVELOPMENT_TEAM = ""; 459 | INFOPLIST_FILE = Example/Info.plist; 460 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 461 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.Example; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 464 | SWIFT_VERSION = 4.0; 465 | }; 466 | name = Debug; 467 | }; 468 | 88AEBB7D1BADF8C600923E82 /* Release */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 472 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 473 | DEVELOPMENT_TEAM = ""; 474 | INFOPLIST_FILE = Example/Info.plist; 475 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 476 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.Example; 477 | PRODUCT_NAME = "$(TARGET_NAME)"; 478 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 479 | SWIFT_VERSION = 4.0; 480 | }; 481 | name = Release; 482 | }; 483 | /* End XCBuildConfiguration section */ 484 | 485 | /* Begin XCConfigurationList section */ 486 | 886487F81BCADBED00671052 /* Build configuration list for PBXNativeTarget "ExampleUITests" */ = { 487 | isa = XCConfigurationList; 488 | buildConfigurations = ( 489 | 886487F91BCADBED00671052 /* Debug */, 490 | 886487FA1BCADBED00671052 /* Release */, 491 | ); 492 | defaultConfigurationIsVisible = 0; 493 | defaultConfigurationName = Release; 494 | }; 495 | 88AEBB591BADF8C500923E82 /* Build configuration list for PBXProject "Example" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | 88AEBB791BADF8C600923E82 /* Debug */, 499 | 88AEBB7A1BADF8C600923E82 /* Release */, 500 | ); 501 | defaultConfigurationIsVisible = 0; 502 | defaultConfigurationName = Release; 503 | }; 504 | 88AEBB7B1BADF8C600923E82 /* Build configuration list for PBXNativeTarget "Example" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | 88AEBB7C1BADF8C600923E82 /* Debug */, 508 | 88AEBB7D1BADF8C600923E82 /* Release */, 509 | ); 510 | defaultConfigurationIsVisible = 0; 511 | defaultConfigurationName = Release; 512 | }; 513 | /* End XCConfigurationList section */ 514 | }; 515 | rootObject = 88AEBB561BADF8C500923E82 /* Project object */; 516 | } 517 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 79 | 81 | 87 | 88 | 89 | 90 | 91 | 92 | 98 | 100 | 106 | 107 | 108 | 109 | 111 | 112 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.github.io/JSQWebViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQWebViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2015 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | import UIKit 20 | 21 | @UIApplicationMain 22 | class AppDelegate: UIResponder, UIApplicationDelegate { 23 | 24 | var window: UIWindow? 25 | 26 | func application(_ application: UIApplication, 27 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 28 | return true 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Example/Example/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Example/Example/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 | 27 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /Example/Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIMainStoryboardFile 33 | Main 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UISupportedInterfaceOrientations~ipad 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationPortraitUpsideDown 48 | UIInterfaceOrientationLandscapeLeft 49 | UIInterfaceOrientationLandscapeRight 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Example/Example/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.github.io/JSQWebViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQWebViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2015 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | import UIKit 20 | import JSQWebViewController 21 | 22 | final class ViewController: UITableViewController { 23 | 24 | let url = URL(string: "http://jessesquires.com")! 25 | 26 | override func viewDidLoad() { 27 | super.viewDidLoad() 28 | self.navigationController?.navigationBar.isTranslucent = true 29 | if #available(iOS 11.0, *) { 30 | self.navigationItem.largeTitleDisplayMode = .automatic 31 | } 32 | } 33 | 34 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 35 | tableView.deselectRow(at: indexPath, animated: true) 36 | 37 | if indexPath.row == 2 { 38 | return 39 | } 40 | 41 | let webVC = WebViewController(url: url) 42 | 43 | switch indexPath.row { 44 | case 0: 45 | navigationController?.pushViewController(webVC, animated: true) 46 | 47 | case 1: 48 | let nav = UINavigationController(rootViewController: webVC) 49 | present(nav, animated: true, completion: nil) 50 | 51 | default: break 52 | } 53 | } 54 | 55 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 56 | let webViewController = segue.destination as? WebViewController 57 | webViewController?.urlRequest = URLRequest(url: url) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Example/ExampleUITests/ExampleUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.github.io/JSQWebViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQWebViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2015 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | import UIKit 20 | import XCTest 21 | 22 | 23 | final class ExampleUITests: XCTestCase { 24 | 25 | override func setUp() { 26 | super.setUp() 27 | continueAfterFailure = false 28 | XCUIApplication().launch() 29 | } 30 | 31 | override func tearDown() { 32 | super.tearDown() 33 | } 34 | 35 | func test_WebView_Push() { 36 | let app = XCUIApplication() 37 | 38 | app.tables.staticTexts["Push"].tap() 39 | XCTAssertTrue(app.webViews.count == 1) 40 | 41 | let navbar = app.navigationBars["jessesquires.com"] 42 | navbar.buttons["Share"].tap() 43 | XCTAssertTrue(app.sheets.count == 1) 44 | 45 | app.sheets.buttons["Cancel"].tap() 46 | XCTAssertTrue(app.sheets.count == 0) 47 | 48 | navbar.children(matching: .button).matching(identifier: "Back").element(boundBy: 0).tap() 49 | XCTAssertTrue(app.webViews.count == 0) 50 | } 51 | 52 | func test_WebView_Modal() { 53 | let app = XCUIApplication() 54 | 55 | app.tables.staticTexts["Modal"].tap() 56 | XCTAssertTrue(app.webViews.count == 1) 57 | 58 | let navbar = app.navigationBars["jessesquires.com"] 59 | navbar.buttons["Share"].tap() 60 | XCTAssertTrue(app.sheets.count == 1) 61 | 62 | app.sheets.buttons["Cancel"].tap() 63 | XCTAssertTrue(app.sheets.count == 0) 64 | 65 | navbar.buttons["Done"].tap() 66 | XCTAssertTrue(app.webViews.count == 0) 67 | } 68 | 69 | func test_WebView_Storyboard() { 70 | let app = XCUIApplication() 71 | 72 | app.tables.staticTexts["Storyboard"].tap() 73 | XCTAssertTrue(app.webViews.count == 1) 74 | 75 | let navbar = app.navigationBars["jessesquires.com"] 76 | navbar.buttons["Share"].tap() 77 | XCTAssertTrue(app.sheets.count == 1) 78 | 79 | app.sheets.buttons["Cancel"].tap() 80 | XCTAssertTrue(app.sheets.count == 0) 81 | 82 | navbar.children(matching: .button).matching(identifier: "Back").element(boundBy: 0).tap() 83 | XCTAssertTrue(app.webViews.count == 0) 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Example/ExampleUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /JSQWebViewController.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'JSQWebViewController' 3 | s.version = '6.0.0' 4 | s.license = 'MIT' 5 | 6 | s.summary = 'A lightweight Swift WebKit view controller for iOS' 7 | s.homepage = 'https://github.com/jessesquires/JSQWebViewController' 8 | s.documentation_url = 'https://jessesquires.github.io/JSQWebViewController' 9 | 10 | s.social_media_url = 'https://twitter.com/jesse_squires' 11 | s.authors = 'Jesse Squires' 12 | 13 | s.source = { :git => 'https://github.com/jessesquires/JSQWebViewController.git', :tag => s.version } 14 | s.source_files = 'Source/*.swift' 15 | 16 | s.platform = :ios, '8.0' 17 | 18 | s.frameworks = 'WebKit' 19 | s.requires_arc = true 20 | s.deprecated = true 21 | end 22 | -------------------------------------------------------------------------------- /JSQWebViewController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 88AEBB131BADF48300923E82 /* JSQWebViewController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88AEBB081BADF48300923E82 /* JSQWebViewController.framework */; }; 11 | 88E3AF701CB62C0100F1E775 /* JSQWebViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 88E3AF6B1CB62BD700F1E775 /* JSQWebViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 88E3AF711CB62C0700F1E775 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88E3AF6C1CB62BD700F1E775 /* WebViewController.swift */; }; 13 | 88E3AF741CB62C3000F1E775 /* JSQWebViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88E3AF6F1CB62BD700F1E775 /* JSQWebViewControllerTests.swift */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXContainerItemProxy section */ 17 | 88AEBB141BADF48300923E82 /* PBXContainerItemProxy */ = { 18 | isa = PBXContainerItemProxy; 19 | containerPortal = 88AEBAFF1BADF48300923E82 /* Project object */; 20 | proxyType = 1; 21 | remoteGlobalIDString = 88AEBB071BADF48300923E82; 22 | remoteInfo = JSQWebViewController; 23 | }; 24 | /* End PBXContainerItemProxy section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 88AEBB081BADF48300923E82 /* JSQWebViewController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JSQWebViewController.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 88AEBB121BADF48300923E82 /* JSQWebViewControllerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JSQWebViewControllerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 88E3AF6A1CB62BD700F1E775 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 88E3AF6B1CB62BD700F1E775 /* JSQWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSQWebViewController.h; sourceTree = ""; }; 31 | 88E3AF6C1CB62BD700F1E775 /* WebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = ""; }; 32 | 88E3AF6E1CB62BD700F1E775 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | 88E3AF6F1CB62BD700F1E775 /* JSQWebViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSQWebViewControllerTests.swift; sourceTree = ""; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | 88AEBB041BADF48300923E82 /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | 88AEBB0F1BADF48300923E82 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | 88AEBB131BADF48300923E82 /* JSQWebViewController.framework in Frameworks */, 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXFrameworksBuildPhase section */ 53 | 54 | /* Begin PBXGroup section */ 55 | 88AEBAFE1BADF48300923E82 = { 56 | isa = PBXGroup; 57 | children = ( 58 | 88E3AF691CB62BD700F1E775 /* Source */, 59 | 88E3AF6D1CB62BD700F1E775 /* Tests */, 60 | 88AEBB091BADF48300923E82 /* Products */, 61 | ); 62 | sourceTree = ""; 63 | }; 64 | 88AEBB091BADF48300923E82 /* Products */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 88AEBB081BADF48300923E82 /* JSQWebViewController.framework */, 68 | 88AEBB121BADF48300923E82 /* JSQWebViewControllerTests.xctest */, 69 | ); 70 | name = Products; 71 | sourceTree = ""; 72 | }; 73 | 88E3AF691CB62BD700F1E775 /* Source */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 88E3AF6A1CB62BD700F1E775 /* Info.plist */, 77 | 88E3AF6B1CB62BD700F1E775 /* JSQWebViewController.h */, 78 | 88E3AF6C1CB62BD700F1E775 /* WebViewController.swift */, 79 | ); 80 | path = Source; 81 | sourceTree = ""; 82 | }; 83 | 88E3AF6D1CB62BD700F1E775 /* Tests */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 88E3AF6E1CB62BD700F1E775 /* Info.plist */, 87 | 88E3AF6F1CB62BD700F1E775 /* JSQWebViewControllerTests.swift */, 88 | ); 89 | path = Tests; 90 | sourceTree = ""; 91 | }; 92 | /* End PBXGroup section */ 93 | 94 | /* Begin PBXHeadersBuildPhase section */ 95 | 88AEBB051BADF48300923E82 /* Headers */ = { 96 | isa = PBXHeadersBuildPhase; 97 | buildActionMask = 2147483647; 98 | files = ( 99 | 88E3AF701CB62C0100F1E775 /* JSQWebViewController.h in Headers */, 100 | ); 101 | runOnlyForDeploymentPostprocessing = 0; 102 | }; 103 | /* End PBXHeadersBuildPhase section */ 104 | 105 | /* Begin PBXNativeTarget section */ 106 | 88AEBB071BADF48300923E82 /* JSQWebViewController */ = { 107 | isa = PBXNativeTarget; 108 | buildConfigurationList = 88AEBB1C1BADF48300923E82 /* Build configuration list for PBXNativeTarget "JSQWebViewController" */; 109 | buildPhases = ( 110 | 88AEBB031BADF48300923E82 /* Sources */, 111 | 88AEBB041BADF48300923E82 /* Frameworks */, 112 | 88AEBB051BADF48300923E82 /* Headers */, 113 | 88AEBB061BADF48300923E82 /* Resources */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = JSQWebViewController; 120 | productName = JSQWebViewController; 121 | productReference = 88AEBB081BADF48300923E82 /* JSQWebViewController.framework */; 122 | productType = "com.apple.product-type.framework"; 123 | }; 124 | 88AEBB111BADF48300923E82 /* JSQWebViewControllerTests */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = 88AEBB1F1BADF48300923E82 /* Build configuration list for PBXNativeTarget "JSQWebViewControllerTests" */; 127 | buildPhases = ( 128 | 88AEBB0E1BADF48300923E82 /* Sources */, 129 | 88AEBB0F1BADF48300923E82 /* Frameworks */, 130 | 88AEBB101BADF48300923E82 /* Resources */, 131 | ); 132 | buildRules = ( 133 | ); 134 | dependencies = ( 135 | 88AEBB151BADF48300923E82 /* PBXTargetDependency */, 136 | ); 137 | name = JSQWebViewControllerTests; 138 | productName = JSQWebViewControllerTests; 139 | productReference = 88AEBB121BADF48300923E82 /* JSQWebViewControllerTests.xctest */; 140 | productType = "com.apple.product-type.bundle.unit-test"; 141 | }; 142 | /* End PBXNativeTarget section */ 143 | 144 | /* Begin PBXProject section */ 145 | 88AEBAFF1BADF48300923E82 /* Project object */ = { 146 | isa = PBXProject; 147 | attributes = { 148 | LastSwiftUpdateCheck = 0700; 149 | LastUpgradeCheck = 0900; 150 | ORGANIZATIONNAME = "Hexed Bits"; 151 | TargetAttributes = { 152 | 88AEBB071BADF48300923E82 = { 153 | CreatedOnToolsVersion = 7.0; 154 | LastSwiftMigration = 0900; 155 | }; 156 | 88AEBB111BADF48300923E82 = { 157 | CreatedOnToolsVersion = 7.0; 158 | LastSwiftMigration = 0900; 159 | ProvisioningStyle = Manual; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 88AEBB021BADF48300923E82 /* Build configuration list for PBXProject "JSQWebViewController" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | ); 170 | mainGroup = 88AEBAFE1BADF48300923E82; 171 | productRefGroup = 88AEBB091BADF48300923E82 /* Products */; 172 | projectDirPath = ""; 173 | projectRoot = ""; 174 | targets = ( 175 | 88AEBB071BADF48300923E82 /* JSQWebViewController */, 176 | 88AEBB111BADF48300923E82 /* JSQWebViewControllerTests */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 88AEBB061BADF48300923E82 /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | 88AEBB101BADF48300923E82 /* Resources */ = { 190 | isa = PBXResourcesBuildPhase; 191 | buildActionMask = 2147483647; 192 | files = ( 193 | ); 194 | runOnlyForDeploymentPostprocessing = 0; 195 | }; 196 | /* End PBXResourcesBuildPhase section */ 197 | 198 | /* Begin PBXSourcesBuildPhase section */ 199 | 88AEBB031BADF48300923E82 /* Sources */ = { 200 | isa = PBXSourcesBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | 88E3AF711CB62C0700F1E775 /* WebViewController.swift in Sources */, 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | 88AEBB0E1BADF48300923E82 /* Sources */ = { 208 | isa = PBXSourcesBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | 88E3AF741CB62C3000F1E775 /* JSQWebViewControllerTests.swift in Sources */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXSourcesBuildPhase section */ 216 | 217 | /* Begin PBXTargetDependency section */ 218 | 88AEBB151BADF48300923E82 /* PBXTargetDependency */ = { 219 | isa = PBXTargetDependency; 220 | target = 88AEBB071BADF48300923E82 /* JSQWebViewController */; 221 | targetProxy = 88AEBB141BADF48300923E82 /* PBXContainerItemProxy */; 222 | }; 223 | /* End PBXTargetDependency section */ 224 | 225 | /* Begin XCBuildConfiguration section */ 226 | 88AEBB1A1BADF48300923E82 /* Debug */ = { 227 | isa = XCBuildConfiguration; 228 | buildSettings = { 229 | ALWAYS_SEARCH_USER_PATHS = NO; 230 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 231 | CLANG_CXX_LIBRARY = "libc++"; 232 | CLANG_ENABLE_MODULES = YES; 233 | CLANG_ENABLE_OBJC_ARC = YES; 234 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 235 | CLANG_WARN_BOOL_CONVERSION = YES; 236 | CLANG_WARN_COMMA = YES; 237 | CLANG_WARN_CONSTANT_CONVERSION = YES; 238 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 239 | CLANG_WARN_EMPTY_BODY = YES; 240 | CLANG_WARN_ENUM_CONVERSION = YES; 241 | CLANG_WARN_INFINITE_RECURSION = YES; 242 | CLANG_WARN_INT_CONVERSION = YES; 243 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 244 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 245 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 246 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 247 | CLANG_WARN_STRICT_PROTOTYPES = YES; 248 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 249 | CLANG_WARN_UNREACHABLE_CODE = YES; 250 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 251 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 252 | COPY_PHASE_STRIP = NO; 253 | CURRENT_PROJECT_VERSION = 1; 254 | DEBUG_INFORMATION_FORMAT = dwarf; 255 | ENABLE_STRICT_OBJC_MSGSEND = YES; 256 | ENABLE_TESTABILITY = YES; 257 | GCC_C_LANGUAGE_STANDARD = gnu99; 258 | GCC_DYNAMIC_NO_PIC = NO; 259 | GCC_NO_COMMON_BLOCKS = YES; 260 | GCC_OPTIMIZATION_LEVEL = 0; 261 | GCC_PREPROCESSOR_DEFINITIONS = ( 262 | "DEBUG=1", 263 | "$(inherited)", 264 | ); 265 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 266 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 267 | GCC_WARN_UNDECLARED_SELECTOR = YES; 268 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 269 | GCC_WARN_UNUSED_FUNCTION = YES; 270 | GCC_WARN_UNUSED_VARIABLE = YES; 271 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 272 | MTL_ENABLE_DEBUG_INFO = YES; 273 | ONLY_ACTIVE_ARCH = YES; 274 | SDKROOT = iphoneos; 275 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 276 | SWIFT_VERSION = 4.0; 277 | TARGETED_DEVICE_FAMILY = "1,2"; 278 | VERSIONING_SYSTEM = "apple-generic"; 279 | VERSION_INFO_PREFIX = ""; 280 | }; 281 | name = Debug; 282 | }; 283 | 88AEBB1B1BADF48300923E82 /* Release */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | ALWAYS_SEARCH_USER_PATHS = NO; 287 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 288 | CLANG_CXX_LIBRARY = "libc++"; 289 | CLANG_ENABLE_MODULES = YES; 290 | CLANG_ENABLE_OBJC_ARC = YES; 291 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 292 | CLANG_WARN_BOOL_CONVERSION = YES; 293 | CLANG_WARN_COMMA = YES; 294 | CLANG_WARN_CONSTANT_CONVERSION = YES; 295 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 296 | CLANG_WARN_EMPTY_BODY = YES; 297 | CLANG_WARN_ENUM_CONVERSION = YES; 298 | CLANG_WARN_INFINITE_RECURSION = YES; 299 | CLANG_WARN_INT_CONVERSION = YES; 300 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 301 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 304 | CLANG_WARN_STRICT_PROTOTYPES = YES; 305 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 306 | CLANG_WARN_UNREACHABLE_CODE = YES; 307 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 308 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 309 | COPY_PHASE_STRIP = NO; 310 | CURRENT_PROJECT_VERSION = 1; 311 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 312 | ENABLE_NS_ASSERTIONS = NO; 313 | ENABLE_STRICT_OBJC_MSGSEND = YES; 314 | GCC_C_LANGUAGE_STANDARD = gnu99; 315 | GCC_NO_COMMON_BLOCKS = YES; 316 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 318 | GCC_WARN_UNDECLARED_SELECTOR = YES; 319 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 320 | GCC_WARN_UNUSED_FUNCTION = YES; 321 | GCC_WARN_UNUSED_VARIABLE = YES; 322 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 323 | MTL_ENABLE_DEBUG_INFO = NO; 324 | SDKROOT = iphoneos; 325 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 326 | SWIFT_VERSION = 4.0; 327 | TARGETED_DEVICE_FAMILY = "1,2"; 328 | VALIDATE_PRODUCT = YES; 329 | VERSIONING_SYSTEM = "apple-generic"; 330 | VERSION_INFO_PREFIX = ""; 331 | }; 332 | name = Release; 333 | }; 334 | 88AEBB1D1BADF48300923E82 /* Debug */ = { 335 | isa = XCBuildConfiguration; 336 | buildSettings = { 337 | CLANG_ENABLE_MODULES = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 339 | DEFINES_MODULE = YES; 340 | DYLIB_COMPATIBILITY_VERSION = 1; 341 | DYLIB_CURRENT_VERSION = 1; 342 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 343 | INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; 344 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 345 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 346 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 347 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.JSQWebViewController; 348 | PRODUCT_NAME = "$(TARGET_NAME)"; 349 | SKIP_INSTALL = YES; 350 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 351 | SWIFT_VERSION = 4.0; 352 | }; 353 | name = Debug; 354 | }; 355 | 88AEBB1E1BADF48300923E82 /* Release */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | CLANG_ENABLE_MODULES = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 360 | DEFINES_MODULE = YES; 361 | DYLIB_COMPATIBILITY_VERSION = 1; 362 | DYLIB_CURRENT_VERSION = 1; 363 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 364 | INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; 365 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 366 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 367 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 368 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.JSQWebViewController; 369 | PRODUCT_NAME = "$(TARGET_NAME)"; 370 | SKIP_INSTALL = YES; 371 | SWIFT_VERSION = 4.0; 372 | }; 373 | name = Release; 374 | }; 375 | 88AEBB201BADF48300923E82 /* Debug */ = { 376 | isa = XCBuildConfiguration; 377 | buildSettings = { 378 | DEVELOPMENT_TEAM = ""; 379 | INFOPLIST_FILE = Tests/Info.plist; 380 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 381 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.JSQWebViewControllerTests; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | SWIFT_VERSION = 4.0; 384 | }; 385 | name = Debug; 386 | }; 387 | 88AEBB211BADF48300923E82 /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | DEVELOPMENT_TEAM = ""; 391 | INFOPLIST_FILE = Tests/Info.plist; 392 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 393 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.JSQWebViewControllerTests; 394 | PRODUCT_NAME = "$(TARGET_NAME)"; 395 | SWIFT_VERSION = 4.0; 396 | }; 397 | name = Release; 398 | }; 399 | /* End XCBuildConfiguration section */ 400 | 401 | /* Begin XCConfigurationList section */ 402 | 88AEBB021BADF48300923E82 /* Build configuration list for PBXProject "JSQWebViewController" */ = { 403 | isa = XCConfigurationList; 404 | buildConfigurations = ( 405 | 88AEBB1A1BADF48300923E82 /* Debug */, 406 | 88AEBB1B1BADF48300923E82 /* Release */, 407 | ); 408 | defaultConfigurationIsVisible = 0; 409 | defaultConfigurationName = Release; 410 | }; 411 | 88AEBB1C1BADF48300923E82 /* Build configuration list for PBXNativeTarget "JSQWebViewController" */ = { 412 | isa = XCConfigurationList; 413 | buildConfigurations = ( 414 | 88AEBB1D1BADF48300923E82 /* Debug */, 415 | 88AEBB1E1BADF48300923E82 /* Release */, 416 | ); 417 | defaultConfigurationIsVisible = 0; 418 | defaultConfigurationName = Release; 419 | }; 420 | 88AEBB1F1BADF48300923E82 /* Build configuration list for PBXNativeTarget "JSQWebViewControllerTests" */ = { 421 | isa = XCConfigurationList; 422 | buildConfigurations = ( 423 | 88AEBB201BADF48300923E82 /* Debug */, 424 | 88AEBB211BADF48300923E82 /* Release */, 425 | ); 426 | defaultConfigurationIsVisible = 0; 427 | defaultConfigurationName = Release; 428 | }; 429 | /* End XCConfigurationList section */ 430 | }; 431 | rootObject = 88AEBAFF1BADF48300923E82 /* Project object */; 432 | } 433 | -------------------------------------------------------------------------------- /JSQWebViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JSQWebViewController.xcodeproj/xcshareddata/xcschemes/JSQWebViewController.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jesse Squires 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://www.jessesquires.com/JSQWebViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQWebViewController 12 | // 13 | // 14 | // License 15 | // Copyright © 2015 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | import PackageDescription 20 | 21 | let package = Package( 22 | name: "JSQWebViewController" 23 | ) 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/) 3 | 4 | > **NOTE:** As of iOS 9, this library is no longer necessary. 5 | > 6 | > You should use [`SFSafariViewController`](https://developer.apple.com/library/prerelease/ios/documentation/SafariServices/Reference/SFSafariViewController_Ref/index.html) instead. 7 | 8 | # ⚠ Deprecated ⚠ 9 | 10 | # JSQWebViewController 11 | 12 | [![Build Status](https://secure.travis-ci.org/jessesquires/JSQWebViewController.svg)](http://travis-ci.org/jessesquires/JSQWebViewController) [![Version Status](https://img.shields.io/cocoapods/v/JSQWebViewController.svg)][podLink] [![license MIT](https://img.shields.io/cocoapods/l/JSQWebViewController.svg)][mitLink] [![codecov](https://codecov.io/gh/jessesquires/JSQWebViewController/branch/develop/graph/badge.svg)](https://codecov.io/gh/jessesquires/JSQWebViewController) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Platform](https://img.shields.io/cocoapods/p/JSQWebViewController.svg)][docsLink] 13 | 14 | *A lightweight Swift WebKit view controller for iOS* 15 | 16 | ![screenshot](https://raw.githubusercontent.com/jessesquires/JSQWebViewController/develop/Screenshots/screenshot_0.png) 17 |        18 | ![screenshot](https://raw.githubusercontent.com/jessesquires/JSQWebViewController/develop/Screenshots/screenshot_1.png) 19 | 20 | ## Requirements 21 | 22 | * Swift 3.2+ 23 | * Xcode 9+ 24 | * iOS 8+ 25 | 26 | ## Installation 27 | 28 | #### [CocoaPods](http://cocoapods.org) (recommended) 29 | 30 | ````ruby 31 | use_frameworks! 32 | 33 | # For latest release in cocoapods 34 | pod 'JSQWebViewController' 35 | ```` 36 | 37 | #### [Carthage](https://github.com/Carthage/Carthage) 38 | 39 | ````bash 40 | github "jessesquires/JSQWebViewController" 41 | ```` 42 | 43 | ## Documentation 44 | 45 | Read the [docs][docsLink]. Generated with [jazzy](https://github.com/realm/jazzy). Hosted by [GitHub Pages](https://pages.github.com). 46 | 47 | #### Generate 48 | 49 | ````bash 50 | $ ./build_docs.sh 51 | ```` 52 | 53 | #### Preview 54 | 55 | ````bash 56 | $ open index.html -a Safari 57 | ```` 58 | 59 | ## Getting Started 60 | 61 | ````swift 62 | import JSQWebViewController 63 | 64 | let controller = WebViewController(url: URL(string: "http://jessesquires.com")!) 65 | let nav = UINavigationController(rootViewController: controller) 66 | present(nav, animated: true, completion: nil) 67 | ```` 68 | 69 | See the included example app, open `Example/Example.xcodeproj`. 70 | 71 | ## Contribute 72 | 73 | Please follow these sweet [contribution guidelines](https://github.com/jessesquires/HowToContribute). 74 | 75 | ## Credits 76 | 77 | Created and maintained by [**@jesse_squires**](https://twitter.com/jesse_squires). 78 | 79 | ## License 80 | 81 | `JSQWebViewController` is released under an [MIT License][mitLink]. See `LICENSE` for details. 82 | 83 | >**Copyright © 2015 Jesse Squires.** 84 | 85 | *Please provide attribution, it is greatly appreciated.* 86 | 87 | [mitLink]:http://opensource.org/licenses/MIT 88 | [docsLink]:http://jessesquires.github.io/JSQWebViewController 89 | [podLink]:https://cocoapods.org/pods/JSQWebViewController 90 | -------------------------------------------------------------------------------- /Screenshots/screenshot_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessesquires/JSQWebViewController/f9abcd82398abb51a267335475679bcca574552c/Screenshots/screenshot_0.png -------------------------------------------------------------------------------- /Screenshots/screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessesquires/JSQWebViewController/f9abcd82398abb51a267335475679bcca574552c/Screenshots/screenshot_1.png -------------------------------------------------------------------------------- /Source/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 6.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Source/JSQWebViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.github.io/JSQWebViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQWebViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2015 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | #import 21 | 22 | FOUNDATION_EXPORT double JSQWebViewControllerVersionNumber; 23 | 24 | FOUNDATION_EXPORT const unsigned char JSQWebViewControllerVersionString[]; 25 | -------------------------------------------------------------------------------- /Source/WebViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.github.io/JSQWebViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQWebViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2015 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | import UIKit 20 | import WebKit 21 | 22 | 23 | private let titleKeyPath = "title" 24 | private let estimatedProgressKeyPath = "estimatedProgress" 25 | 26 | 27 | /// An instance of `WebViewController` displays interactive web content. 28 | open class WebViewController: UIViewController { 29 | 30 | // MARK: Properties 31 | 32 | /// Returns the web view for the controller. 33 | public final var webView: WKWebView { 34 | get { 35 | return _webView 36 | } 37 | } 38 | 39 | /// Returns the progress view for the controller. 40 | public final var progressBar: UIProgressView { 41 | get { 42 | return _progressBar 43 | } 44 | } 45 | 46 | /// The URL request for the web view. Upon setting this property, the web view immediately begins loading the request. 47 | public final var urlRequest: URLRequest { 48 | didSet { 49 | webView.load(urlRequest) 50 | } 51 | } 52 | 53 | /** 54 | Specifies whether or not to display the web view title as the navigation bar title. 55 | The default is `false`, which sets the navigation bar title to the URL host name of the URL request. 56 | */ 57 | public final var displaysWebViewTitle: Bool = false 58 | 59 | // MARK: Private properties 60 | 61 | private final let configuration: WKWebViewConfiguration 62 | private final let activities: [UIActivity]? 63 | 64 | private lazy final var _webView: WKWebView = { 65 | let webView = WKWebView(frame: CGRect.zero, configuration: configuration) 66 | webView.addObserver(self, forKeyPath: titleKeyPath, options: .new, context: nil) 67 | webView.addObserver(self, forKeyPath: estimatedProgressKeyPath, options: .new, context: nil) 68 | webView.allowsBackForwardNavigationGestures = true 69 | if #available(iOS 9.0, *) { 70 | webView.allowsLinkPreview = true 71 | } 72 | return webView 73 | }() 74 | 75 | private lazy final var _progressBar: UIProgressView = { 76 | let progressBar = UIProgressView(progressViewStyle: .bar) 77 | progressBar.backgroundColor = .clear 78 | progressBar.trackTintColor = .clear 79 | return progressBar 80 | }() 81 | 82 | // MARK: Initialization 83 | 84 | /** 85 | Constructs a new `WebViewController`. 86 | 87 | - parameter urlRequest: The URL request for the web view to load. 88 | - parameter configuration: The configuration for the web view. 89 | - parameter activities: The custom activities to display in the `UIActivityViewController` that is presented when the action button is tapped. 90 | 91 | - returns: A new `WebViewController` instance. 92 | */ 93 | public init(urlRequest: URLRequest, configuration: WKWebViewConfiguration = WKWebViewConfiguration(), activities: [UIActivity]? = nil) { 94 | self.configuration = configuration 95 | self.urlRequest = urlRequest 96 | self.activities = activities 97 | super.init(nibName: nil, bundle: nil) 98 | } 99 | 100 | /** 101 | Constructs a new `WebViewController`. 102 | 103 | - parameter url: The URL to display in the web view. 104 | 105 | - returns: A new `WebViewController` instance. 106 | */ 107 | public convenience init(url: URL) { 108 | self.init(urlRequest: URLRequest(url: url)) 109 | } 110 | 111 | /// :nodoc: 112 | public required init?(coder aDecoder: NSCoder) { 113 | self.configuration = WKWebViewConfiguration() 114 | self.urlRequest = URLRequest(url: URL(string: "http://")!) 115 | self.activities = nil 116 | super.init(coder: aDecoder) 117 | } 118 | 119 | deinit { 120 | webView.removeObserver(self, forKeyPath: titleKeyPath, context: nil) 121 | webView.removeObserver(self, forKeyPath: estimatedProgressKeyPath, context: nil) 122 | } 123 | 124 | 125 | // MARK: View lifecycle 126 | 127 | /// :nodoc: 128 | open override func viewDidLoad() { 129 | super.viewDidLoad() 130 | title = urlRequest.url?.host 131 | view.addSubview(_webView) 132 | view.addSubview(_progressBar) 133 | 134 | if presentingViewController?.presentedViewController != nil { 135 | navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, 136 | target: self, 137 | action: #selector(didTapDoneButton(_:))) 138 | } 139 | 140 | navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .action, 141 | target: self, 142 | action: #selector(didTapActionButton(_:))) 143 | 144 | webView.load(urlRequest) 145 | } 146 | 147 | /// :nodoc: 148 | open override func viewWillAppear(_ animated: Bool) { 149 | assert(navigationController != nil, "\(WebViewController.self) must be presented in a \(UINavigationController.self)") 150 | super.viewWillAppear(animated) 151 | } 152 | 153 | /// :nodoc: 154 | open override func viewDidDisappear(_ animated: Bool) { 155 | super.viewDidDisappear(animated) 156 | webView.stopLoading() 157 | } 158 | 159 | /// :nodoc: 160 | open override func viewDidLayoutSubviews() { 161 | super.viewDidLayoutSubviews() 162 | webView.frame = view.bounds 163 | 164 | let isIOS11 = ProcessInfo.processInfo.isOperatingSystemAtLeast( 165 | OperatingSystemVersion(majorVersion: 11, minorVersion: 0, patchVersion: 0)) 166 | let top = isIOS11 ? CGFloat(0.0) : topLayoutGuide.length 167 | let insets = UIEdgeInsets(top: top, left: 0, bottom: 0, right: 0) 168 | webView.scrollView.contentInset = insets 169 | webView.scrollView.scrollIndicatorInsets = insets 170 | 171 | view.bringSubview(toFront: progressBar) 172 | progressBar.frame = CGRect(x: view.frame.minX, 173 | y: topLayoutGuide.length, 174 | width: view.frame.size.width, 175 | height: 2) 176 | } 177 | 178 | 179 | // MARK: Actions 180 | 181 | @objc private func didTapDoneButton(_ sender: UIBarButtonItem) { 182 | dismiss(animated: true, completion: nil) 183 | } 184 | 185 | @objc private func didTapActionButton(_ sender: UIBarButtonItem) { 186 | if let url = urlRequest.url { 187 | let activityVC = UIActivityViewController(activityItems: [url], applicationActivities: activities) 188 | activityVC.popoverPresentationController?.barButtonItem = sender 189 | present(activityVC, animated: true, completion: nil) 190 | } 191 | } 192 | 193 | 194 | // MARK: KVO 195 | 196 | /// :nodoc: 197 | open override func observeValue(forKeyPath keyPath: String?, 198 | of object: Any?, 199 | change: [NSKeyValueChangeKey : Any]?, 200 | context: UnsafeMutableRawPointer?) { 201 | guard let theKeyPath = keyPath , object as? WKWebView == webView else { 202 | super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context) 203 | return 204 | } 205 | 206 | if displaysWebViewTitle && theKeyPath == titleKeyPath { 207 | title = webView.title 208 | } 209 | 210 | if theKeyPath == estimatedProgressKeyPath { 211 | updateProgress() 212 | } 213 | } 214 | 215 | // MARK: Private 216 | 217 | private final func updateProgress() { 218 | let completed = webView.estimatedProgress == 1.0 219 | progressBar.setProgress(completed ? 0.0 : Float(webView.estimatedProgress), animated: !completed) 220 | UIApplication.shared.isNetworkActivityIndicatorVisible = !completed 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /Tests/JSQWebViewControllerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.github.io/JSQWebViewController 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/JSQWebViewController 12 | // 13 | // 14 | // License 15 | // Copyright (c) 2015 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | import UIKit 20 | import XCTest 21 | import WebKit 22 | 23 | @testable 24 | import JSQWebViewController 25 | 26 | 27 | final class JSQWebViewControllerTests: XCTestCase { 28 | 29 | override func setUp() { 30 | super.setUp() 31 | } 32 | 33 | override func tearDown() { 34 | super.tearDown() 35 | } 36 | 37 | func test_thatWebViewController_InitializesSuccessfully() { 38 | let webVC = WebViewController(url: URL(string: "http://jessesquires.com")!) 39 | XCTAssertNotNil(webVC); 40 | 41 | let nav = UINavigationController(rootViewController: webVC) 42 | nav.beginAppearanceTransition(true, animated: false) 43 | nav.endAppearanceTransition() 44 | 45 | XCTAssertNotNil(webVC.webView) 46 | XCTAssertNotNil(webVC.progressBar) 47 | XCTAssertNotNil(webVC.urlRequest) 48 | 49 | XCTAssertEqual(webVC.displaysWebViewTitle, false) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /build_docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Docs by jazzy 4 | # https://github.com/realm/jazzy 5 | # ------------------------------ 6 | 7 | jazzy -o docs/ \ 8 | --source-directory . \ 9 | --readme README.md \ 10 | -a 'Jesse Squires' \ 11 | -u 'https://twitter.com/jesse_squires' \ 12 | -m 'JSQWebViewController' \ 13 | -g 'https://github.com/jessesquires/JSQWebViewController' 14 | -------------------------------------------------------------------------------- /docs/Classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Classes Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

JSQWebViewController Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 40 |
41 |
42 |
43 |

Classes

44 |

The following classes are available globally.

45 | 46 |
47 |
48 |
49 |
    50 |
  • 51 |
    52 | 53 | 54 | 55 | WebViewController 56 | 57 |
    58 |
    59 |
    60 |
    61 |
    62 |
    63 |

    An instance of WebViewController displays interactive web content.

    64 | 65 | See more 66 |
    67 |
    68 |

    Declaration

    69 |
    70 |

    Swift

    71 |
    open class WebViewController: UIViewController
    72 | 73 |
    74 |
    75 |
    76 |
    77 |
  • 78 |
79 |
80 |
81 |
82 | 86 |
87 |
88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /docs/Classes/WebViewController.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WebViewController Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

JSQWebViewController Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 41 |
42 |
43 |
44 |

WebViewController

45 |
46 |
47 |
open class WebViewController: UIViewController
48 | 49 |
50 |
51 |

An instance of WebViewController displays interactive web content.

52 | 53 |
54 |
55 |
56 |
57 | 58 | 59 | 60 |

Properties

61 |
62 |
63 |
    64 |
  • 65 |
    66 | 67 | 68 | 69 | webView 70 | 71 |
    72 |
    73 |
    74 |
    75 |
    76 |
    77 |

    Returns the web view for the controller.

    78 | 79 |
    80 |
    81 |

    Declaration

    82 |
    83 |

    Swift

    84 |
    public final var webView: WKWebView
    85 | 86 |
    87 |
    88 |
    89 |
    90 |
  • 91 |
  • 92 |
    93 | 94 | 95 | 96 | progressBar 97 | 98 |
    99 |
    100 |
    101 |
    102 |
    103 |
    104 |

    Returns the progress view for the controller.

    105 | 106 |
    107 |
    108 |

    Declaration

    109 |
    110 |

    Swift

    111 |
    public final var progressBar: UIProgressView
    112 | 113 |
    114 |
    115 |
    116 |
    117 |
  • 118 |
  • 119 |
    120 | 121 | 122 | 123 | urlRequest 124 | 125 |
    126 |
    127 |
    128 |
    129 |
    130 |
    131 |

    The URL request for the web view. Upon setting this property, the web view immediately begins loading the request.

    132 | 133 |
    134 |
    135 |

    Declaration

    136 |
    137 |

    Swift

    138 |
    public final var urlRequest: URLRequest
    139 | 140 |
    141 |
    142 |
    143 |
    144 |
  • 145 |
  • 146 |
    147 | 148 | 149 | 150 | displaysWebViewTitle 151 | 152 |
    153 |
    154 |
    155 |
    156 |
    157 |
    158 |

    Specifies whether or not to display the web view title as the navigation bar title. 159 | The default is false, which sets the navigation bar title to the URL host name of the URL request.

    160 | 161 |
    162 |
    163 |

    Declaration

    164 |
    165 |

    Swift

    166 |
    public final var displaysWebViewTitle: Bool = false
    167 | 168 |
    169 |
    170 |
    171 |
    172 |
  • 173 |
174 |
175 |
176 |
177 | 178 | 179 | 180 |

Initialization

181 |
182 |
183 |
    184 |
  • 185 |
    186 | 187 | 188 | 189 | init(urlRequest:configuration:activities:) 190 | 191 |
    192 |
    193 |
    194 |
    195 |
    196 |
    197 |

    Constructs a new WebViewController.

    198 | 199 |
    200 |
    201 |

    Declaration

    202 |
    203 |

    Swift

    204 |
    public init(urlRequest: URLRequest, configuration: WKWebViewConfiguration = WKWebViewConfiguration(), activities: [UIActivity]? = nil)
    205 | 206 |
    207 |
    208 |
    209 |

    Parameters

    210 | 211 | 212 | 213 | 218 | 223 | 224 | 225 | 230 | 235 | 236 | 237 | 242 | 247 | 248 | 249 |
    214 | 215 | urlRequest 216 | 217 | 219 |
    220 |

    The URL request for the web view to load.

    221 |
    222 |
    226 | 227 | configuration 228 | 229 | 231 |
    232 |

    The configuration for the web view.

    233 |
    234 |
    238 | 239 | activities 240 | 241 | 243 |
    244 |

    The custom activities to display in the UIActivityViewController that is presented when the action button is tapped.

    245 |
    246 |
    250 |
    251 |
    252 |

    Return Value

    253 |

    A new WebViewController instance.

    254 |
    255 |
    256 |
    257 |
  • 258 |
  • 259 |
    260 | 261 | 262 | 263 | init(url:) 264 | 265 |
    266 |
    267 |
    268 |
    269 |
    270 |
    271 |

    Constructs a new WebViewController.

    272 | 273 |
    274 |
    275 |

    Declaration

    276 |
    277 |

    Swift

    278 |
    public convenience init(url: URL)
    279 | 280 |
    281 |
    282 |
    283 |

    Parameters

    284 | 285 | 286 | 287 | 292 | 297 | 298 | 299 |
    288 | 289 | url 290 | 291 | 293 |
    294 |

    The URL to display in the web view.

    295 |
    296 |
    300 |
    301 |
    302 |

    Return Value

    303 |

    A new WebViewController instance.

    304 |
    305 |
    306 |
    307 |
  • 308 |
309 |
310 |
311 |
312 | 316 |
317 |
318 | 319 | 320 | 321 | -------------------------------------------------------------------------------- /docs/badge.svg: -------------------------------------------------------------------------------- 1 | documentationdocumentation100%100% -------------------------------------------------------------------------------- /docs/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/css/jazzy.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { 2 | background: transparent; 3 | border: 0; 4 | margin: 0; 5 | outline: 0; 6 | padding: 0; 7 | vertical-align: baseline; } 8 | 9 | body { 10 | background-color: #f2f2f2; 11 | font-family: Helvetica, freesans, Arial, sans-serif; 12 | font-size: 14px; 13 | -webkit-font-smoothing: subpixel-antialiased; 14 | word-wrap: break-word; } 15 | 16 | h1, h2, h3 { 17 | margin-top: 0.8em; 18 | margin-bottom: 0.3em; 19 | font-weight: 100; 20 | color: black; } 21 | 22 | h1 { 23 | font-size: 2.5em; } 24 | 25 | h2 { 26 | font-size: 2em; 27 | border-bottom: 1px solid #e2e2e2; } 28 | 29 | h4 { 30 | font-size: 13px; 31 | line-height: 1.5; 32 | margin-top: 21px; } 33 | 34 | h5 { 35 | font-size: 1.1em; } 36 | 37 | h6 { 38 | font-size: 1.1em; 39 | color: #777; } 40 | 41 | .section-name { 42 | color: gray; 43 | display: block; 44 | font-family: Helvetica; 45 | font-size: 22px; 46 | font-weight: 100; 47 | margin-bottom: 15px; } 48 | 49 | pre, code { 50 | font: 0.95em Menlo, monospace; 51 | color: #777; 52 | word-wrap: normal; } 53 | 54 | p code, li code { 55 | background-color: #eee; 56 | padding: 2px 4px; 57 | border-radius: 4px; } 58 | 59 | a { 60 | color: #0088cc; 61 | text-decoration: none; } 62 | 63 | ul { 64 | padding-left: 15px; } 65 | 66 | li { 67 | line-height: 1.8em; } 68 | 69 | img { 70 | max-width: 100%; } 71 | 72 | blockquote { 73 | margin-left: 0; 74 | padding: 0 10px; 75 | border-left: 4px solid #ccc; } 76 | 77 | .content-wrapper { 78 | margin: 0 auto; 79 | width: 980px; } 80 | 81 | header { 82 | font-size: 0.85em; 83 | line-height: 26px; 84 | background-color: #414141; 85 | position: fixed; 86 | width: 100%; 87 | z-index: 1; } 88 | header img { 89 | padding-right: 6px; 90 | vertical-align: -4px; 91 | height: 16px; } 92 | header a { 93 | color: #fff; } 94 | header p { 95 | float: left; 96 | color: #999; } 97 | header .header-right { 98 | float: right; 99 | margin-left: 16px; } 100 | 101 | #breadcrumbs { 102 | background-color: #f2f2f2; 103 | height: 27px; 104 | padding-top: 17px; 105 | position: fixed; 106 | width: 100%; 107 | z-index: 1; 108 | margin-top: 26px; } 109 | #breadcrumbs #carat { 110 | height: 10px; 111 | margin: 0 5px; } 112 | 113 | .sidebar { 114 | background-color: #f9f9f9; 115 | border: 1px solid #e2e2e2; 116 | overflow-y: auto; 117 | overflow-x: hidden; 118 | position: fixed; 119 | top: 70px; 120 | bottom: 0; 121 | width: 230px; 122 | word-wrap: normal; } 123 | 124 | .nav-groups { 125 | list-style-type: none; 126 | background: #fff; 127 | padding-left: 0; } 128 | 129 | .nav-group-name { 130 | border-bottom: 1px solid #e2e2e2; 131 | font-size: 1.1em; 132 | font-weight: 100; 133 | padding: 15px 0 15px 20px; } 134 | .nav-group-name > a { 135 | color: #333; } 136 | 137 | .nav-group-tasks { 138 | margin-top: 5px; } 139 | 140 | .nav-group-task { 141 | font-size: 0.9em; 142 | list-style-type: none; 143 | white-space: nowrap; } 144 | .nav-group-task a { 145 | color: #888; } 146 | 147 | .main-content { 148 | background-color: #fff; 149 | border: 1px solid #e2e2e2; 150 | margin-left: 246px; 151 | position: absolute; 152 | overflow: hidden; 153 | padding-bottom: 60px; 154 | top: 70px; 155 | width: 734px; } 156 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { 157 | margin-bottom: 1em; } 158 | .main-content p { 159 | line-height: 1.8em; } 160 | .main-content section .section:first-child { 161 | margin-top: 0; 162 | padding-top: 0; } 163 | .main-content section .task-group-section .task-group:first-of-type { 164 | padding-top: 10px; } 165 | .main-content section .task-group-section .task-group:first-of-type .section-name { 166 | padding-top: 15px; } 167 | .main-content section .heading:before { 168 | content: ""; 169 | display: block; 170 | padding-top: 70px; 171 | margin: -70px 0 0; } 172 | 173 | .section { 174 | padding: 0 25px; } 175 | 176 | .highlight { 177 | background-color: #eee; 178 | padding: 10px 12px; 179 | border: 1px solid #e2e2e2; 180 | border-radius: 4px; 181 | overflow-x: auto; } 182 | 183 | .declaration .highlight { 184 | overflow-x: initial; 185 | padding: 0 40px 40px 0; 186 | margin-bottom: -25px; 187 | background-color: transparent; 188 | border: none; } 189 | 190 | .section-name { 191 | margin: 0; 192 | margin-left: 18px; } 193 | 194 | .task-group-section { 195 | padding-left: 6px; 196 | border-top: 1px solid #e2e2e2; } 197 | 198 | .task-group { 199 | padding-top: 0px; } 200 | 201 | .task-name-container a[name]:before { 202 | content: ""; 203 | display: block; 204 | padding-top: 70px; 205 | margin: -70px 0 0; } 206 | 207 | .item { 208 | padding-top: 8px; 209 | width: 100%; 210 | list-style-type: none; } 211 | .item a[name]:before { 212 | content: ""; 213 | display: block; 214 | padding-top: 70px; 215 | margin: -70px 0 0; } 216 | .item code { 217 | background-color: transparent; 218 | padding: 0; } 219 | .item .token { 220 | padding-left: 3px; 221 | margin-left: 15px; 222 | font-size: 11.9px; } 223 | .item .declaration-note { 224 | font-size: .85em; 225 | color: gray; 226 | font-style: italic; } 227 | 228 | .pointer-container { 229 | border-bottom: 1px solid #e2e2e2; 230 | left: -23px; 231 | padding-bottom: 13px; 232 | position: relative; 233 | width: 110%; } 234 | 235 | .pointer { 236 | background: #f9f9f9; 237 | border-left: 1px solid #e2e2e2; 238 | border-top: 1px solid #e2e2e2; 239 | height: 12px; 240 | left: 21px; 241 | top: -7px; 242 | -webkit-transform: rotate(45deg); 243 | -moz-transform: rotate(45deg); 244 | -o-transform: rotate(45deg); 245 | transform: rotate(45deg); 246 | position: absolute; 247 | width: 12px; } 248 | 249 | .height-container { 250 | display: none; 251 | left: -25px; 252 | padding: 0 25px; 253 | position: relative; 254 | width: 100%; 255 | overflow: hidden; } 256 | .height-container .section { 257 | background: #f9f9f9; 258 | border-bottom: 1px solid #e2e2e2; 259 | left: -25px; 260 | position: relative; 261 | width: 100%; 262 | padding-top: 10px; 263 | padding-bottom: 5px; } 264 | 265 | .aside, .language { 266 | padding: 6px 12px; 267 | margin: 12px 0; 268 | border-left: 5px solid #dddddd; 269 | overflow-y: hidden; } 270 | .aside .aside-title, .language .aside-title { 271 | font-size: 9px; 272 | letter-spacing: 2px; 273 | text-transform: uppercase; 274 | padding-bottom: 0; 275 | margin: 0; 276 | color: #aaa; 277 | -webkit-user-select: none; } 278 | .aside p:last-child, .language p:last-child { 279 | margin-bottom: 0; } 280 | 281 | .language { 282 | border-left: 5px solid #cde9f4; } 283 | .language .aside-title { 284 | color: #4b8afb; } 285 | 286 | .aside-warning { 287 | border-left: 5px solid #ff6666; } 288 | .aside-warning .aside-title { 289 | color: #ff0000; } 290 | 291 | .graybox { 292 | border-collapse: collapse; 293 | width: 100%; } 294 | .graybox p { 295 | margin: 0; 296 | word-break: break-word; 297 | min-width: 50px; } 298 | .graybox td { 299 | border: 1px solid #e2e2e2; 300 | padding: 5px 25px 5px 10px; 301 | vertical-align: middle; } 302 | .graybox tr td:first-of-type { 303 | text-align: right; 304 | padding: 7px; 305 | vertical-align: top; 306 | word-break: normal; 307 | width: 40px; } 308 | 309 | .slightly-smaller { 310 | font-size: 0.9em; } 311 | 312 | #footer { 313 | position: absolute; 314 | bottom: 10px; 315 | margin-left: 25px; } 316 | #footer p { 317 | margin: 0; 318 | color: #aaa; 319 | font-size: 0.8em; } 320 | 321 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar { 322 | display: none; } 323 | html.dash .main-content { 324 | width: 980px; 325 | margin-left: 0; 326 | border: none; 327 | width: 100%; 328 | top: 0; 329 | padding-bottom: 0; } 330 | html.dash .height-container { 331 | display: block; } 332 | html.dash .item .token { 333 | margin-left: 0; } 334 | html.dash .content-wrapper { 335 | width: auto; } 336 | html.dash #footer { 337 | position: static; } 338 | -------------------------------------------------------------------------------- /docs/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessesquires/JSQWebViewController/f9abcd82398abb51a267335475679bcca574552c/docs/img/carat.png -------------------------------------------------------------------------------- /docs/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessesquires/JSQWebViewController/f9abcd82398abb51a267335475679bcca574552c/docs/img/dash.png -------------------------------------------------------------------------------- /docs/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessesquires/JSQWebViewController/f9abcd82398abb51a267335475679bcca574552c/docs/img/gh.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JSQWebViewController Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

JSQWebViewController Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 40 |
41 |
42 |
43 | 44 |

No Maintenance Intended

45 | 46 |
47 |

NOTE: As of iOS 9, this library is no longer necessary.

48 | 49 |

You should use SFSafariViewController instead.

50 |
51 |

⚠ Deprecated ⚠

52 |

JSQWebViewController

53 | 54 |

Build Status Version Status license MIT codecov Carthage compatible Platform

55 | 56 |

A lightweight Swift WebKit view controller for iOS

57 | 58 |

screenshot 59 |        60 | screenshot

61 |

Requirements

62 | 63 |
    64 |
  • Swift 3.2+
  • 65 |
  • Xcode 9+
  • 66 |
  • iOS 8+
  • 67 |
68 |

Installation

69 | 70 |
use_frameworks!
 71 | 
 72 | # For latest release in cocoapods
 73 | pod 'JSQWebViewController'
 74 | 
75 |

Carthage

76 |
github "jessesquires/JSQWebViewController"
 77 | 
78 |

Documentation

79 | 80 |

Read the docs. Generated with jazzy. Hosted by GitHub Pages.

81 |

Generate

82 |
$ ./build_docs.sh
 83 | 
84 |

Preview

85 |
$ open index.html -a Safari
 86 | 
87 |

Getting Started

88 |
import JSQWebViewController
 89 | 
 90 | let controller = WebViewController(url: URL(string: "http://jessesquires.com")!)
 91 | let nav = UINavigationController(rootViewController: controller)
 92 | present(nav, animated: true, completion: nil)
 93 | 
94 | 95 |

See the included example app, open Example/Example.xcodeproj.

96 |

Contribute

97 | 98 |

Please follow these sweet contribution guidelines.

99 |

Credits

100 | 101 |

Created and maintained by @jesse_squires.

102 |

License

103 | 104 |

JSQWebViewController is released under an MIT License. See LICENSE for details.

105 | 106 |
107 |

Copyright © 2015 Jesse Squires.

108 |
109 | 110 |

Please provide attribution, it is greatly appreciated.

111 | 112 |
113 |
114 | 118 |
119 |
120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /docs/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | var tokenOffset = "15px"; 27 | var original = link.css('marginLeft') == tokenOffset; 28 | link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); 29 | $content = link.parent().parent().next(); 30 | $content.slideToggle(animationDuration); 31 | 32 | // Keeps the document from jumping to the hash. 33 | var href = $(this).attr('href'); 34 | if (history.pushState) { 35 | history.pushState({}, '', href); 36 | } else { 37 | location.hash = href; 38 | } 39 | event.preventDefault(); 40 | }); 41 | 42 | // Dumb down quotes within code blocks that delimit strings instead of quotations 43 | // https://github.com/realm/jazzy/issues/714 44 | $("code q").replaceWith(function () { 45 | return ["\"", $(this).contents(), "\""]; 46 | }); 47 | -------------------------------------------------------------------------------- /docs/search.json: -------------------------------------------------------------------------------- 1 | {"Classes/WebViewController.html#/s:20JSQWebViewController03WebbC0C03webB0So05WKWebB0Cv":{"name":"webView","abstract":"

Returns the web view for the controller.

","parent_name":"WebViewController"},"Classes/WebViewController.html#/s:20JSQWebViewController03WebbC0C11progressBarSo010UIProgressB0Cv":{"name":"progressBar","abstract":"

Returns the progress view for the controller.

","parent_name":"WebViewController"},"Classes/WebViewController.html#/s:20JSQWebViewController03WebbC0C10urlRequest10Foundation10URLRequestVv":{"name":"urlRequest","abstract":"

The URL request for the web view. Upon setting this property, the web view immediately begins loading the request.

","parent_name":"WebViewController"},"Classes/WebViewController.html#/s:20JSQWebViewController03WebbC0C08displaysdB5TitleSbv":{"name":"displaysWebViewTitle","abstract":"

Specifies whether or not to display the web view title as the navigation bar title.","parent_name":"WebViewController"},"Classes/WebViewController.html#/s:20JSQWebViewController03WebbC0CAC10Foundation10URLRequestV10urlRequest_So05WKWebB13ConfigurationC13configurationSaySo10UIActivityCGSg10activitiestcfc":{"name":"init(urlRequest:configuration:activities:)","abstract":"

Constructs a new WebViewController.

","parent_name":"WebViewController"},"Classes/WebViewController.html#/s:20JSQWebViewController03WebbC0CAC10Foundation3URLV3url_tcfc":{"name":"init(url:)","abstract":"

Constructs a new WebViewController.

","parent_name":"WebViewController"},"Classes/WebViewController.html":{"name":"WebViewController","abstract":"

An instance of WebViewController displays interactive web content.

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"}} -------------------------------------------------------------------------------- /docs/undocumented.json: -------------------------------------------------------------------------------- 1 | { 2 | "warnings": [ 3 | 4 | ], 5 | "source_directory": "/Users/jesse/GitHub/JSQWebViewController" 6 | } --------------------------------------------------------------------------------