Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The right Swift API depends on what “full-page screenshot” means. For an image of an app-owned web page, call WKWebView.takeSnapshot(with:completionHandler:). For a document, use WebKit’s PDF APIs, createPDF(configuration:completionHandler:) or pdf(configuration:). For the system screenshot experience, provide scene PDF data through UIScreenshotServiceDelegate. The iPhone’s Safari Full Page button is a user interface feature, not a universal API for capturing every Swift or SwiftUI scroll view.

Choose the capture path before writing code

What you need Use Output Important distinction
Image of an app-owned WKWebView WKWebView.takeSnapshot Platform-native image Asynchronous snapshot of web-view content
Web content as a document createPDF or pdf(configuration:) with WKPDFConfiguration PDF data rect selects a view-coordinate region
Your app supplies content when a person requests an app screenshot UIScreenshotService plus UIScreenshotServiceDelegate PDF data UIKit requests a representation for the associated window scene
A person captures a Safari page on iPhone Screenshot thumbnail, then Full Page Apple’s system save/share workflow User-facing workflow, not a general Swift capture method

These APIs are not interchangeable. A WebKit snapshot is an app-invoked operation on one web view. A screenshot service is a UIKit integration for the system’s user-requested screenshot flow. Neither makes a regular, arbitrarily tall native scroll view automatically capturable.

Capture an app-owned WKWebView as an image

Use takeSnapshot when the result must be a raster image such as PNG, JPEG, or another image format your app writes. The completion handler returns an optional image and an optional error, so production code must handle both success and failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Minimal Swift example

import WebKit
import UIKit

final class WebSnapshotter {
    private let webView: WKWebView

    init(webView: WKWebView) {
        self.webView = webView
    }

    func capture(completion: @escaping (Result) -> Void) {
        let configuration = WKSnapshotConfiguration()
        // Leave rect nil to request the web view's current content snapshot.
        webView.takeSnapshot(with: configuration) { image, error in
            if let error {
                completion(.failure(error))
            } else if let image {
                completion(.success(image))
            } else {
                completion(.failure(CaptureError.noImage))
            }
        }
    }

    enum CaptureError: Error {
        case noImage
    }
}

The API is asynchronous. Keep the web view alive until the completion handler runs, and decide how your app will persist or present the returned UIImage. For example, convert it to PNG data with image.pngData() before writing it to a file or sharing it.

#1 Best Overall
Apple iPhone 14, 128GB, Midnight - Unlocked (Renewed)
  • This phone is unlocked and compatible with any carrier of choice on GSM and CDMA networks (e.g. AT&T, T-Mobile, Sprint, Verizon, US Cellular, Cricket, Metro, Tracfone, Mint Mobile, etc.).
  • Please check with your carrier to verify compatibility.
  • The device does not come with headphones or a SIM card. It does include a generic (Mfi certified) charging cable.
  • Tested for battery health and guaranteed to have a minimum battery capacity of 80%.

Availability and deployment targets

The public WebKit header annotates takeSnapshot as available from iOS 11.0. Your deployment target and the SDK used to build the app still determine what availability checks are required. If your project supports older systems, guard the call with the appropriate availability condition rather than assuming the annotation matches every deployment target.

Main-thread requirement

Apple’s WebKit guidance says: “Always call WebKit functions and methods from your app’s main thread or main dispatch queue.” The method’s asynchronous completion does not remove that requirement. Start the capture on the main actor or dispatch queue, then move any expensive image encoding or file work elsewhere after the callback.

@MainActor
func captureOnMain(webView: WKWebView) async throws -> UIImage {
    try await withCheckedThrowingContinuation { continuation in
        webView.takeSnapshot(with: nil) { image, error in
            if let error {
                continuation.resume(throwing: error)
            } else if let image {
                continuation.resume(returning: image)
            } else {
                continuation.resume(throwing: SnapshotError.noImage)
            }
        }
    }
}

enum SnapshotError: Error {
    case noImage
}

Save the entire web view as a PDF

If “full page” means a document that can span pages, PDF is usually the better native output. WebKit provides both a completion-handler form and an async form. WKPDFConfiguration.rect is a rectangle in the web view’s coordinate system; use it to select the region you want represented.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Completion-handler version

import WebKit

func makePDF(from webView: WKWebView,
             completion: @escaping (Result<Data, Error>) -> Void) {
    let configuration = WKPDFConfiguration()
    configuration.rect = webView.bounds

    webView.createPDF(configuration: configuration) { result in
        switch result {
        case .success(let data):
            completion(.success(data))
        case .failure(let error):
            completion(.failure(error))
        }
    }
}

Swift concurrency version

import WebKit

@MainActor
func makePDF(from webView: WKWebView) async throws -> Data {
    let configuration = WKPDFConfiguration()
    configuration.rect = webView.bounds
    return try await webView.pdf(configuration: configuration)
}

Write the returned bytes as a .pdf file, present a share sheet, or hand them to a document preview controller. A PDF is not a single very-tall bitmap: it preserves a paged document representation and is generally more practical for long pages.

Rank #2
Sale
Apple iPhone 16, 128GB, Pink - Unlocked (Renewed)
  • 6.1" Super Retina XDR OLED, HDR10, Dolby Vision, 1000nits (typ), 2000nits (HBM), 2556x1179px at 460ppi, 3561mAh Battery
  • 128GB 8GB RAM, Apple A18 (3nm), Hexa-core (2x4.04 GHz + 4x2.20 GHz), Apple GPU 5-core, 16‑core Neural Engine
  • Rear camera: 48MP, f/1.6, wide + 12MP, f/2.2, ultrawide, Front Camera: 12MP, f/1.9, wide, iOS 18, upgradable to iOS 18.5
  • 4G LTE: 1/2/3/4/5/7/8/12/13/14/17/18/19/20/25/26/28/29/30/32/34/38/39/40/41/42/48/53/66/71, 5G: n1/2/3/5/7/8/12/14/20/25/26/28/29/30/38/40/41/48/53/66/70/71/75/76/77/78/79 - Dual eSIM
  • Unlocked for freedom to choose your carrier. Compatible with both GSM & CDMA networks. The phone is unlocked to work with all GSM Carriers & CDMA Carriers Including AT&T, T-Mobile, Verizon, Sprint., Etc.

Choosing the rectangle

The rectangle is expressed in web-view coordinates, not screen coordinates. Set it deliberately when the web view displays only part of a larger layout. Do not assume that changing the on-screen frame automatically means the PDF contains every scrollable pixel. Validate the result with the actual page, especially when content is dynamically laid out.

Supply PDF data to the system screenshot flow

UIScreenshotService belongs to UIKit’s window-scene screenshot integration. Obtain the service associated with the relevant scene and assign a delegate. UIKit then calls the delegate when it needs PDF data representing the scene’s content.

Scene setup

import UIKit

final class ScreenshotDelegate: NSObject, UIScreenshotServiceDelegate {
    private let pdfProvider: () async throws -> Data

    init(pdfProvider: @escaping () async throws -> Data) {
        self.pdfProvider = pdfProvider
    }

    func screenshotService(_ screenshotService: UIScreenshotService,
                           generatePDFRepresentationWithCompletion completion: @escaping (Data?, Int, CGRect) -> Void) {
        Task {
            do {
                let data = try await pdfProvider()
                // Supply the page count and bounds that describe your PDF.
                completion(data, 1, CGRect(x: 0, y: 0, width: 612, height: 792))
            } catch {
                completion(nil, 0, .zero)
            }
        }
    }
}

func installScreenshotDelegate(for windowScene: UIWindowScene,
                               delegate: UIScreenshotServiceDelegate) {
    windowScene.screenshotService.delegate = delegate
}

The callback supplies PDF data, a page count, and bounds. The exact page count and bounds must match the document your app generates; the values above are only a structural example, not a universal page size. Generate the PDF from the scene’s actual content and retain the delegate for as long as the scene needs it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This path is different from calling takeSnapshot yourself. It lets UIKit request a high-fidelity PDF representation when the user invokes the app screenshot experience. It does not turn arbitrary SwiftUI or UIKit scroll views into a documented, universal full-page image API.

Rank #3
Apple iPhone 15, 128GB, Black - Unlocked (Renewed)
  • 6.1inch Super Retina XDR display. Aluminum with color-infused glass back. Ring/Silent switch
  • Dynamic Island. A magical way to interact with iPhone. A16 Bionic chip with 5-core GPU
  • Advanced dual-camera system. 48MP Main | Ultra Wide. Super-high-resolution photos (24MP and 48MP). Next-generation portraits with Focus and Depth Control. 4X optical zoom range
  • Emergency SOS via satellite. Crash Detection. Roadside Assistance via satellite
  • Up to 26 hours video playback. USB C, Supports USB 2. Face ID

Use the iPhone Full Page control for Safari

For a person—not an app—capturing a webpage in Safari, take a normal screenshot and tap its thumbnail when it appears. Choose Full Page, then preview, crop, annotate, save, or share. Apple’s support workflow uses an entire Safari webpage as the example. On iOS 17 and iPadOS 17, Apple documents saving or sharing the full-page result as a PDF or image.

The labels and placement can change with the operating system and region. This workflow is not callable from Swift, and it should not be presented as a way for an app to capture every scroll view.

What about a regular SwiftUI or UIKit scroll view?

The WebKit APIs above are for WKWebView; they are not documented as generic view-rendering APIs. If your content is a native scroll view, design a capture representation for that view hierarchy and verify it on the OS versions you support. A single, arbitrarily tall bitmap can have substantial memory and rendering implications, and the sources for these APIs do not establish a universal maximum height, memory limit, or guarantee that every dynamic page will be complete.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For web content, prefer the PDF route when a long document is the goal. For an image, use takeSnapshot and test the exact page. Lazy-loaded content, animation, cross-origin frames, unusually long documents, and other page behavior can affect the result; do not promise completeness without validating your own content.

Rank #4
Apple iPhone 13, 128GB, Midnight - Unlocked (Renewed)
  • This pre-owned product is not Apple certified, but has been professionally inspected, tested and cleaned by Amazon-qualified suppliers.
  • There will be no visible cosmetic imperfections when held at an arm’s length.
  • This product is eligible for a replacement or refund within 90 days of receipt if you are not satisfied.
  • Product may come in generic Box.

Timing, loading, and reliability checklist

  • Wait until the web view has finished the navigation and the content you need is present before starting capture.
  • Call WebKit methods on the main thread or main dispatch queue.
  • Handle both error and empty-result cases in every completion handler.
  • Test pages with responsive layouts at the actual viewport and device scale used by your app.
  • Check dynamic pages more than once if animation or delayed resources are important to the output.
  • Keep PDF and image work separate: capture on the main queue, then perform file encoding and upload work off the main queue.
  • Inspect the produced file, not just the callback: verify page count, clipping, missing images, fonts, and links where those matter.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common failures

The image is nil and there is no useful output

Confirm that you handle the optional image and error, that the web view remains alive, and that the call starts on the main queue. Add logging around navigation completion and the snapshot callback.

The PDF is clipped or contains only the visible area

Review WKPDFConfiguration.rect. It is a web-view-coordinate rectangle, so an incorrectly sized or positioned rectangle can exclude content. Compare the rectangle with the layout you intend to export and test a PDF rather than inferring its contents from the on-screen frame.

Late images or sections are missing

The capture APIs are asynchronous, but that does not mean every page resource has finished loading. Wait for the relevant page state, and test lazy-loaded sections and scripts on representative pages. There is no documented blanket guarantee for every dynamic site.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The system screenshot callback is never called

Ensure the delegate is assigned to the UIScreenshotService belonging to the active UIWindowScene, and keep the delegate strongly referenced. Confirm that you are testing the user-requested screenshot flow rather than expecting UIKit to call it during an app-invoked WebKit snapshot.

Best Value
Apple iPhone 16e, 128GB, Black - Unlocked (Renewed)
  • 6.1" Super Retina XDR OLED, HDR10, 800 nits (HBM), 1200 nits (peak), 2532x1170px at 460ppi, 4005mAh Battery
  • 8GB RAM, Apple A18 6-core CPU (2 performance + 4 efficiency cores), Apple GPU 4-core, 16‑core Neural Engine
  • Rear camera: 48MP, f/1.6, wide, Front Camera: 12MP, f/1.9, wide, iOS 18.3.1, upgradable to iOS 18.5
  • Connectivity: Global 4G LTE, Sub-6 GHz 5G, LTE, Wi-Fi 6, Bluetooth 5.3, NFC, USB-C, Wireless Charging (7.5W). (does not have mmWave 5G or MagSafe or physical SIM card) - Dual eSIM Only
  • Unlocked for freedom to choose your carrier. Compatible with both GSM & CDMA networks. The phone is unlocked to work with all GSM Carriers & CDMA Carriers Including AT&T, T-Mobile, Verizon, Straight Talk., Etc.

A very long image causes memory pressure

A single tall bitmap may be unsuitable for the content. Prefer a PDF, reduce the requested image region, or design a paged/export representation. Do not infer a safe maximum from one successful device test.

Or skip the browser setup:

ScreenshotNeo provides a website screenshot API and MCP server when the source is a public URL rather than an app-owned WKWebView. One GET request can return PNG, JPEG, WebP, or PDF. It accepts the cookie or consent banner like a visitor, removes more than 60 known consent platforms plus newsletter popups and chat widgets, and reports whether the result was clean and billable. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed.

See the ScreenshotNeo documentation for all options. This Swift example uses the same HTTP endpoint:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import Foundation

var components = URLComponents(string: "https://api.screenshotneo.com/v1/shot")!
components.queryItems = [
    URLQueryItem(name: "access_key", value: "YOUR_API_KEY"),
    URLQueryItem(name: "url", value: "https://stripe.com")
]

let (data, response) = try await URLSession.shared.data(from: components.url!)
let http = response as! HTTPURLResponse
guard (200...299).contains(http.statusCode) else {
    throw URLError(.badServerResponse)
}
try data.write(to: URL(fileURLWithPath: "shot.webp"))

Equivalent command-line and server examples:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. Features include full-page lazy-image loading, CSS-selector element capture, device presets, custom CSS and JavaScript, waits, blocking rules, cookies and headers, geolocation, PDF controls, caching, signed links, webhooks, bulk capture, and a usage API.

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is on every plan. Create a free ScreenshotNeo account.

Swift full-page screenshot decision

  1. Choose takeSnapshot for an image of an app-owned WKWebView.
  2. Choose createPDF or pdf(configuration:) when the deliverable is a long web document.
  3. Use UIScreenshotServiceDelegate when UIKit’s user-requested scene screenshot flow must receive your PDF representation.
  4. Use the iPhone’s Full Page button only as the manual Safari workflow it is designed to be.
  5. Validate dynamic and exceptionally long content on every supported OS and device configuration.

Frequently Asked Questions

Can I call WKWebView.takeSnapshot from a background thread?

No. Apple’s WebKit guidance requires WebKit functions and methods to be called from the app’s main thread or main dispatch queue.

Does WKPDFConfiguration.rect mean screen coordinates?

No. The rectangle is defined in the web view’s coordinate system.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is iPhone Full Page available as a Swift API for my scroll view?

No documented universal API makes the user-facing iPhone Full Page control a generic capture method for arbitrary SwiftUI or UIKit scroll views.

Quick Recap

Bestseller No. 1
Apple iPhone 14, 128GB, Midnight - Unlocked (Renewed)
Apple iPhone 14, 128GB, Midnight - Unlocked (Renewed)
Please check with your carrier to verify compatibility.; Tested for battery health and guaranteed to have a minimum battery capacity of 80%.
$300.00
Bestseller No. 3
Apple iPhone 15, 128GB, Black - Unlocked (Renewed)
Apple iPhone 15, 128GB, Black - Unlocked (Renewed)
Dynamic Island. A magical way to interact with iPhone. A16 Bionic chip with 5-core GPU; Emergency SOS via satellite. Crash Detection. Roadside Assistance via satellite
$409.99
Bestseller No. 4
Apple iPhone 13, 128GB, Midnight - Unlocked (Renewed)
Apple iPhone 13, 128GB, Midnight - Unlocked (Renewed)
There will be no visible cosmetic imperfections when held at an arm’s length.; Product may come in generic Box.
$262.00

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.