├── Demo.gif ├── WKWebViewContentSizeCalculation-Example ├── Assets.xcassets │ ├── Contents.json │ ├── example.imageset │ │ ├── example.jpg │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── fonts │ ├── TitilliumWeb-Bold.ttf │ ├── TitilliumWeb-Italic.ttf │ └── TitilliumWeb-Regular.ttf ├── style.css ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard ├── Info.plist ├── AppDelegate.swift ├── ViewController+SetupSubviews.swift └── ViewController.swift ├── WKWebViewContentSizeCalculation-Example.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── project.pbxproj ├── .gitignore ├── README.md └── LICENSE /Demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerhukic/WKWebViewContentSizeCalculation-Example/HEAD/Demo.gif -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/fonts/TitilliumWeb-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerhukic/WKWebViewContentSizeCalculation-Example/HEAD/WKWebViewContentSizeCalculation-Example/fonts/TitilliumWeb-Bold.ttf -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/fonts/TitilliumWeb-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerhukic/WKWebViewContentSizeCalculation-Example/HEAD/WKWebViewContentSizeCalculation-Example/fonts/TitilliumWeb-Italic.ttf -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/fonts/TitilliumWeb-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerhukic/WKWebViewContentSizeCalculation-Example/HEAD/WKWebViewContentSizeCalculation-Example/fonts/TitilliumWeb-Regular.ttf -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/Assets.xcassets/example.imageset/example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerhukic/WKWebViewContentSizeCalculation-Example/HEAD/WKWebViewContentSizeCalculation-Example/Assets.xcassets/example.imageset/example.jpg -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/Assets.xcassets/example.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "example.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/style.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "Titillium Web"; 3 | font-weight: normal; 4 | src: url("TitilliumWeb-Regular.ttf") 5 | } 6 | @font-face { 7 | font-family: "Titillium Web"; 8 | font-style: italic; 9 | src: url("TitilliumWeb-Italic.ttf") 10 | } 11 | @font-face { 12 | font-family: "Titillium Web"; 13 | font-weight: bold; 14 | src: url("TitilliumWeb-Bold.ttf") 15 | } 16 | body { 17 | margin: 0px; 18 | font-family: "Titillium Web"; 19 | font-weight: normal; 20 | font-size: 13pt; 21 | } 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | # 37 | # Pods/ 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Demo 3 |

4 | 5 |

6 | 7 | 8 | Twitter: @hukicamer 9 | 10 |

11 | 12 | This repo contains an example iOS project that demonstrates how to determine the content size of a WKWebView that loads HTML and local CSS with a custom font. 13 | [A detailed explanation about the implementation is available as a blog-post on my website](https://www.amerhukic.com/determining-the-content-size-of-a-wkwebview). 14 | 15 | 16 | ## License 17 | 18 | WKWebViewContentSizeCalculation-Example is licensed under the MIT license. Check the [LICENSE](LICENSE) file for details. 19 | 20 | ## Author 21 | 22 | [Amer Hukić](https://amerhukic.com) 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Amer Hukić 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 | -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-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 | -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/Base.lproj/LaunchScreen.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 | -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIAppFonts 45 | 46 | TitilliumWeb-Regular.ttf 47 | TitilliumWeb-Bold.ttf 48 | TitilliumWeb-Italic.ttf 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-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 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // WKWebViewLocalHtmlCssFont-Example 4 | // 5 | // Created by Amer Hukic on 02/11/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/ViewController+SetupSubviews.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController+SetupSubviews.swift 3 | // WKWebViewLocalHtmlCssFont-Example 4 | // 5 | // Created by Amer Hukic on 03/11/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension ViewController { 12 | 13 | func setupSubviews() { 14 | 15 | view.addSubview(scrollView) 16 | scrollView.translatesAutoresizingMaskIntoConstraints = false 17 | scrollView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true 18 | scrollView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true 19 | scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true 20 | scrollView.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true 21 | 22 | scrollView.addSubview(contentView) 23 | contentView.translatesAutoresizingMaskIntoConstraints = false 24 | contentView.topAnchor.constraint(equalTo: scrollView.topAnchor).isActive = true 25 | contentView.leftAnchor.constraint(equalTo: scrollView.leftAnchor).isActive = true 26 | contentView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor).isActive = true 27 | contentView.rightAnchor.constraint(equalTo: scrollView.rightAnchor).isActive = true 28 | contentView.widthAnchor.constraint(equalTo: scrollView.widthAnchor).isActive = true 29 | 30 | contentView.addSubview(imageView) 31 | imageView.translatesAutoresizingMaskIntoConstraints = false 32 | imageView.topAnchor.constraint(equalTo: contentView.topAnchor).isActive = true 33 | imageView.leftAnchor.constraint(equalTo: contentView.leftAnchor).isActive = true 34 | imageView.rightAnchor.constraint(equalTo: contentView.rightAnchor).isActive = true 35 | imageView.heightAnchor.constraint(equalToConstant: 300).isActive = true 36 | 37 | contentView.addSubview(titleLabel) 38 | titleLabel.translatesAutoresizingMaskIntoConstraints = false 39 | titleLabel.topAnchor.constraint(equalTo: imageView.bottomAnchor, constant: 10).isActive = true 40 | titleLabel.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: 8).isActive = true 41 | 42 | contentView.addSubview(webView) 43 | webView.translatesAutoresizingMaskIntoConstraints = false 44 | webView.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 10).isActive = true 45 | webView.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: 8).isActive = true 46 | webView.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: -8).isActive = true 47 | webView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -8).isActive = true 48 | webViewHeightConstraint = webView.heightAnchor.constraint(equalToConstant: 200) 49 | webViewHeightConstraint?.isActive = true 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // WKWebViewLocalHtmlCssFont-Example 4 | // 5 | // Created by Amer Hukic on 02/11/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import WebKit 11 | 12 | class ViewController: UIViewController { 13 | 14 | // MARK: Properties 15 | 16 | let scrollView: UIScrollView = { 17 | let scrollView = UIScrollView() 18 | scrollView.showsVerticalScrollIndicator = false 19 | return scrollView 20 | }() 21 | 22 | let contentView: UIView = { 23 | let view = UIView() 24 | view.backgroundColor = .white 25 | return view 26 | }() 27 | 28 | let imageView = UIImageView(image: UIImage(named: "example")) 29 | 30 | let titleLabel: UILabel = { 31 | let label = UILabel() 32 | label.font = UIFont(name: "TitilliumWeb-Bold", size: 25) 33 | label.text = "Example title" 34 | return label 35 | }() 36 | 37 | lazy var webView: WKWebView = { 38 | guard let path = Bundle.main.path(forResource: "style", ofType: "css") else { 39 | return WKWebView() 40 | } 41 | 42 | let cssString = try! String(contentsOfFile: path).components(separatedBy: .newlines).joined() 43 | let source = """ 44 | var style = document.createElement('style'); 45 | style.innerHTML = '\(cssString)'; 46 | document.head.appendChild(style); 47 | """ 48 | 49 | let userScript = WKUserScript(source: source, 50 | injectionTime: .atDocumentEnd, 51 | forMainFrameOnly: true) 52 | 53 | let userContentController = WKUserContentController() 54 | userContentController.addUserScript(userScript) 55 | 56 | let configuration = WKWebViewConfiguration() 57 | configuration.userContentController = userContentController 58 | 59 | let webView = WKWebView(frame: .zero, 60 | configuration: configuration) 61 | webView.navigationDelegate = self 62 | webView.scrollView.isScrollEnabled = false 63 | webView.scrollView.bounces = false 64 | return webView 65 | }() 66 | 67 | var webViewHeightConstraint: NSLayoutConstraint? 68 | 69 | // MARK: Lifecycle methods 70 | 71 | override func viewDidLoad() { 72 | super.viewDidLoad() 73 | setupSubviews() 74 | 75 | let html = """ 76 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 77 |
78 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 79 |
80 | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 81 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 82 | """ 83 | loadHTMLContent(html) 84 | imageView.backgroundColor = .red 85 | } 86 | 87 | // MARK: Helper methods 88 | 89 | private func loadHTMLContent(_ htmlContent: String) { 90 | let htmlStart = "" 91 | let htmlEnd = "" 92 | let htmlString = "\(htmlStart)\(htmlContent)\(htmlEnd)" 93 | webView.loadHTMLString(htmlString, baseURL: Bundle.main.bundleURL) 94 | } 95 | 96 | } 97 | 98 | // MARK: WKNavigationDelegate methods 99 | 100 | extension ViewController: WKNavigationDelegate { 101 | func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { 102 | webView.evaluateJavaScript("document.documentElement.scrollHeight", completionHandler: { (height, error) in 103 | self.webViewHeightConstraint?.constant = height as! CGFloat 104 | }) 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /WKWebViewContentSizeCalculation-Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 196CD02F218C27F500C0350D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 196CD02E218C27F500C0350D /* AppDelegate.swift */; }; 11 | 196CD031218C27F500C0350D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 196CD030218C27F500C0350D /* ViewController.swift */; }; 12 | 196CD034218C27F500C0350D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 196CD032218C27F500C0350D /* Main.storyboard */; }; 13 | 196CD036218C27F800C0350D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 196CD035218C27F800C0350D /* Assets.xcassets */; }; 14 | 196CD039218C27F800C0350D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 196CD037218C27F800C0350D /* LaunchScreen.storyboard */; }; 15 | 196CD041218DC5F200C0350D /* style.css in Resources */ = {isa = PBXBuildFile; fileRef = 196CD040218DC5F200C0350D /* style.css */; }; 16 | 196CD043218DC65700C0350D /* ViewController+SetupSubviews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 196CD042218DC65700C0350D /* ViewController+SetupSubviews.swift */; }; 17 | 196CD048218E49AC00C0350D /* TitilliumWeb-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 196CD046218E48F800C0350D /* TitilliumWeb-Bold.ttf */; }; 18 | 196CD049218E49AC00C0350D /* TitilliumWeb-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 196CD044218E48F800C0350D /* TitilliumWeb-Italic.ttf */; }; 19 | 196CD04A218E49AC00C0350D /* TitilliumWeb-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 196CD045218E48F800C0350D /* TitilliumWeb-Regular.ttf */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 196CD02B218C27F500C0350D /* WKWebViewContentSizeCalculation-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "WKWebViewContentSizeCalculation-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 196CD02E218C27F500C0350D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 25 | 196CD030218C27F500C0350D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 26 | 196CD033218C27F500C0350D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 27 | 196CD035218C27F800C0350D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | 196CD038218C27F800C0350D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 29 | 196CD03A218C27F800C0350D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 196CD040218DC5F200C0350D /* style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = style.css; sourceTree = ""; }; 31 | 196CD042218DC65700C0350D /* ViewController+SetupSubviews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewController+SetupSubviews.swift"; sourceTree = ""; }; 32 | 196CD044218E48F800C0350D /* TitilliumWeb-Italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "TitilliumWeb-Italic.ttf"; sourceTree = ""; }; 33 | 196CD045218E48F800C0350D /* TitilliumWeb-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "TitilliumWeb-Regular.ttf"; sourceTree = ""; }; 34 | 196CD046218E48F800C0350D /* TitilliumWeb-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "TitilliumWeb-Bold.ttf"; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 196CD028218C27F500C0350D /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 196CD022218C27F500C0350D = { 49 | isa = PBXGroup; 50 | children = ( 51 | 196CD02D218C27F500C0350D /* WKWebViewContentSizeCalculation-Example */, 52 | 196CD02C218C27F500C0350D /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | 196CD02C218C27F500C0350D /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 196CD02B218C27F500C0350D /* WKWebViewContentSizeCalculation-Example.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | 196CD02D218C27F500C0350D /* WKWebViewContentSizeCalculation-Example */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 196CD02E218C27F500C0350D /* AppDelegate.swift */, 68 | 196CD030218C27F500C0350D /* ViewController.swift */, 69 | 196CD042218DC65700C0350D /* ViewController+SetupSubviews.swift */, 70 | 196CD032218C27F500C0350D /* Main.storyboard */, 71 | 196CD035218C27F800C0350D /* Assets.xcassets */, 72 | 196CD037218C27F800C0350D /* LaunchScreen.storyboard */, 73 | 196CD03A218C27F800C0350D /* Info.plist */, 74 | 196CD040218DC5F200C0350D /* style.css */, 75 | 196CD047218E490C00C0350D /* fonts */, 76 | ); 77 | path = "WKWebViewContentSizeCalculation-Example"; 78 | sourceTree = ""; 79 | }; 80 | 196CD047218E490C00C0350D /* fonts */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 196CD046218E48F800C0350D /* TitilliumWeb-Bold.ttf */, 84 | 196CD044218E48F800C0350D /* TitilliumWeb-Italic.ttf */, 85 | 196CD045218E48F800C0350D /* TitilliumWeb-Regular.ttf */, 86 | ); 87 | path = fonts; 88 | sourceTree = ""; 89 | }; 90 | /* End PBXGroup section */ 91 | 92 | /* Begin PBXNativeTarget section */ 93 | 196CD02A218C27F500C0350D /* WKWebViewContentSizeCalculation-Example */ = { 94 | isa = PBXNativeTarget; 95 | buildConfigurationList = 196CD03D218C27F800C0350D /* Build configuration list for PBXNativeTarget "WKWebViewContentSizeCalculation-Example" */; 96 | buildPhases = ( 97 | 196CD027218C27F500C0350D /* Sources */, 98 | 196CD028218C27F500C0350D /* Frameworks */, 99 | 196CD029218C27F500C0350D /* Resources */, 100 | ); 101 | buildRules = ( 102 | ); 103 | dependencies = ( 104 | ); 105 | name = "WKWebViewContentSizeCalculation-Example"; 106 | productName = "WKWebViewLocalHtmlCssFont-Example"; 107 | productReference = 196CD02B218C27F500C0350D /* WKWebViewContentSizeCalculation-Example.app */; 108 | productType = "com.apple.product-type.application"; 109 | }; 110 | /* End PBXNativeTarget section */ 111 | 112 | /* Begin PBXProject section */ 113 | 196CD023218C27F500C0350D /* Project object */ = { 114 | isa = PBXProject; 115 | attributes = { 116 | LastSwiftUpdateCheck = 1000; 117 | LastUpgradeCheck = 1000; 118 | ORGANIZATIONNAME = "Amer Hukic"; 119 | TargetAttributes = { 120 | 196CD02A218C27F500C0350D = { 121 | CreatedOnToolsVersion = 10.0; 122 | }; 123 | }; 124 | }; 125 | buildConfigurationList = 196CD026218C27F500C0350D /* Build configuration list for PBXProject "WKWebViewContentSizeCalculation-Example" */; 126 | compatibilityVersion = "Xcode 9.3"; 127 | developmentRegion = en; 128 | hasScannedForEncodings = 0; 129 | knownRegions = ( 130 | en, 131 | Base, 132 | ); 133 | mainGroup = 196CD022218C27F500C0350D; 134 | productRefGroup = 196CD02C218C27F500C0350D /* Products */; 135 | projectDirPath = ""; 136 | projectRoot = ""; 137 | targets = ( 138 | 196CD02A218C27F500C0350D /* WKWebViewContentSizeCalculation-Example */, 139 | ); 140 | }; 141 | /* End PBXProject section */ 142 | 143 | /* Begin PBXResourcesBuildPhase section */ 144 | 196CD029218C27F500C0350D /* Resources */ = { 145 | isa = PBXResourcesBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | 196CD048218E49AC00C0350D /* TitilliumWeb-Bold.ttf in Resources */, 149 | 196CD049218E49AC00C0350D /* TitilliumWeb-Italic.ttf in Resources */, 150 | 196CD04A218E49AC00C0350D /* TitilliumWeb-Regular.ttf in Resources */, 151 | 196CD039218C27F800C0350D /* LaunchScreen.storyboard in Resources */, 152 | 196CD041218DC5F200C0350D /* style.css in Resources */, 153 | 196CD036218C27F800C0350D /* Assets.xcassets in Resources */, 154 | 196CD034218C27F500C0350D /* Main.storyboard in Resources */, 155 | ); 156 | runOnlyForDeploymentPostprocessing = 0; 157 | }; 158 | /* End PBXResourcesBuildPhase section */ 159 | 160 | /* Begin PBXSourcesBuildPhase section */ 161 | 196CD027218C27F500C0350D /* Sources */ = { 162 | isa = PBXSourcesBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | 196CD043218DC65700C0350D /* ViewController+SetupSubviews.swift in Sources */, 166 | 196CD031218C27F500C0350D /* ViewController.swift in Sources */, 167 | 196CD02F218C27F500C0350D /* AppDelegate.swift in Sources */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | /* End PBXSourcesBuildPhase section */ 172 | 173 | /* Begin PBXVariantGroup section */ 174 | 196CD032218C27F500C0350D /* Main.storyboard */ = { 175 | isa = PBXVariantGroup; 176 | children = ( 177 | 196CD033218C27F500C0350D /* Base */, 178 | ); 179 | name = Main.storyboard; 180 | sourceTree = ""; 181 | }; 182 | 196CD037218C27F800C0350D /* LaunchScreen.storyboard */ = { 183 | isa = PBXVariantGroup; 184 | children = ( 185 | 196CD038218C27F800C0350D /* Base */, 186 | ); 187 | name = LaunchScreen.storyboard; 188 | sourceTree = ""; 189 | }; 190 | /* End PBXVariantGroup section */ 191 | 192 | /* Begin XCBuildConfiguration section */ 193 | 196CD03B218C27F800C0350D /* Debug */ = { 194 | isa = XCBuildConfiguration; 195 | buildSettings = { 196 | ALWAYS_SEARCH_USER_PATHS = NO; 197 | CLANG_ANALYZER_NONNULL = YES; 198 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 199 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 200 | CLANG_CXX_LIBRARY = "libc++"; 201 | CLANG_ENABLE_MODULES = YES; 202 | CLANG_ENABLE_OBJC_ARC = YES; 203 | CLANG_ENABLE_OBJC_WEAK = YES; 204 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 205 | CLANG_WARN_BOOL_CONVERSION = YES; 206 | CLANG_WARN_COMMA = YES; 207 | CLANG_WARN_CONSTANT_CONVERSION = YES; 208 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 209 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 210 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 211 | CLANG_WARN_EMPTY_BODY = YES; 212 | CLANG_WARN_ENUM_CONVERSION = YES; 213 | CLANG_WARN_INFINITE_RECURSION = YES; 214 | CLANG_WARN_INT_CONVERSION = YES; 215 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 216 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 217 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 218 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 219 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 220 | CLANG_WARN_STRICT_PROTOTYPES = YES; 221 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 222 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 223 | CLANG_WARN_UNREACHABLE_CODE = YES; 224 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 225 | CODE_SIGN_IDENTITY = "iPhone Developer"; 226 | COPY_PHASE_STRIP = NO; 227 | DEBUG_INFORMATION_FORMAT = dwarf; 228 | ENABLE_STRICT_OBJC_MSGSEND = YES; 229 | ENABLE_TESTABILITY = YES; 230 | GCC_C_LANGUAGE_STANDARD = gnu11; 231 | GCC_DYNAMIC_NO_PIC = NO; 232 | GCC_NO_COMMON_BLOCKS = YES; 233 | GCC_OPTIMIZATION_LEVEL = 0; 234 | GCC_PREPROCESSOR_DEFINITIONS = ( 235 | "DEBUG=1", 236 | "$(inherited)", 237 | ); 238 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 239 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 240 | GCC_WARN_UNDECLARED_SELECTOR = YES; 241 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 242 | GCC_WARN_UNUSED_FUNCTION = YES; 243 | GCC_WARN_UNUSED_VARIABLE = YES; 244 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 245 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 246 | MTL_FAST_MATH = YES; 247 | ONLY_ACTIVE_ARCH = YES; 248 | SDKROOT = iphoneos; 249 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 250 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 251 | }; 252 | name = Debug; 253 | }; 254 | 196CD03C218C27F800C0350D /* Release */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | ALWAYS_SEARCH_USER_PATHS = NO; 258 | CLANG_ANALYZER_NONNULL = YES; 259 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 260 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 261 | CLANG_CXX_LIBRARY = "libc++"; 262 | CLANG_ENABLE_MODULES = YES; 263 | CLANG_ENABLE_OBJC_ARC = YES; 264 | CLANG_ENABLE_OBJC_WEAK = YES; 265 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 266 | CLANG_WARN_BOOL_CONVERSION = YES; 267 | CLANG_WARN_COMMA = YES; 268 | CLANG_WARN_CONSTANT_CONVERSION = YES; 269 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 271 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 272 | CLANG_WARN_EMPTY_BODY = YES; 273 | CLANG_WARN_ENUM_CONVERSION = YES; 274 | CLANG_WARN_INFINITE_RECURSION = YES; 275 | CLANG_WARN_INT_CONVERSION = YES; 276 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 278 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 279 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 280 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 281 | CLANG_WARN_STRICT_PROTOTYPES = YES; 282 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 283 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 284 | CLANG_WARN_UNREACHABLE_CODE = YES; 285 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 286 | CODE_SIGN_IDENTITY = "iPhone Developer"; 287 | COPY_PHASE_STRIP = NO; 288 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 289 | ENABLE_NS_ASSERTIONS = NO; 290 | ENABLE_STRICT_OBJC_MSGSEND = YES; 291 | GCC_C_LANGUAGE_STANDARD = gnu11; 292 | GCC_NO_COMMON_BLOCKS = YES; 293 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 294 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 295 | GCC_WARN_UNDECLARED_SELECTOR = YES; 296 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 297 | GCC_WARN_UNUSED_FUNCTION = YES; 298 | GCC_WARN_UNUSED_VARIABLE = YES; 299 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 300 | MTL_ENABLE_DEBUG_INFO = NO; 301 | MTL_FAST_MATH = YES; 302 | SDKROOT = iphoneos; 303 | SWIFT_COMPILATION_MODE = wholemodule; 304 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 305 | VALIDATE_PRODUCT = YES; 306 | }; 307 | name = Release; 308 | }; 309 | 196CD03E218C27F800C0350D /* Debug */ = { 310 | isa = XCBuildConfiguration; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CODE_SIGN_STYLE = Automatic; 314 | DEVELOPMENT_TEAM = 6U954KDCYZ; 315 | INFOPLIST_FILE = "WKWebViewContentSizeCalculation-Example/Info.plist"; 316 | LD_RUNPATH_SEARCH_PATHS = ( 317 | "$(inherited)", 318 | "@executable_path/Frameworks", 319 | ); 320 | PRODUCT_BUNDLE_IDENTIFIER = "ba.amerhukic.WKWebViewContentSizeCalculation-Example"; 321 | PRODUCT_NAME = "$(TARGET_NAME)"; 322 | SWIFT_VERSION = 4.2; 323 | TARGETED_DEVICE_FAMILY = "1,2"; 324 | }; 325 | name = Debug; 326 | }; 327 | 196CD03F218C27F800C0350D /* Release */ = { 328 | isa = XCBuildConfiguration; 329 | buildSettings = { 330 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 331 | CODE_SIGN_STYLE = Automatic; 332 | DEVELOPMENT_TEAM = 6U954KDCYZ; 333 | INFOPLIST_FILE = "WKWebViewContentSizeCalculation-Example/Info.plist"; 334 | LD_RUNPATH_SEARCH_PATHS = ( 335 | "$(inherited)", 336 | "@executable_path/Frameworks", 337 | ); 338 | PRODUCT_BUNDLE_IDENTIFIER = "ba.amerhukic.WKWebViewContentSizeCalculation-Example"; 339 | PRODUCT_NAME = "$(TARGET_NAME)"; 340 | SWIFT_VERSION = 4.2; 341 | TARGETED_DEVICE_FAMILY = "1,2"; 342 | }; 343 | name = Release; 344 | }; 345 | /* End XCBuildConfiguration section */ 346 | 347 | /* Begin XCConfigurationList section */ 348 | 196CD026218C27F500C0350D /* Build configuration list for PBXProject "WKWebViewContentSizeCalculation-Example" */ = { 349 | isa = XCConfigurationList; 350 | buildConfigurations = ( 351 | 196CD03B218C27F800C0350D /* Debug */, 352 | 196CD03C218C27F800C0350D /* Release */, 353 | ); 354 | defaultConfigurationIsVisible = 0; 355 | defaultConfigurationName = Release; 356 | }; 357 | 196CD03D218C27F800C0350D /* Build configuration list for PBXNativeTarget "WKWebViewContentSizeCalculation-Example" */ = { 358 | isa = XCConfigurationList; 359 | buildConfigurations = ( 360 | 196CD03E218C27F800C0350D /* Debug */, 361 | 196CD03F218C27F800C0350D /* Release */, 362 | ); 363 | defaultConfigurationIsVisible = 0; 364 | defaultConfigurationName = Release; 365 | }; 366 | /* End XCConfigurationList section */ 367 | }; 368 | rootObject = 196CD023218C27F500C0350D /* Project object */; 369 | } 370 | --------------------------------------------------------------------------------