Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

mrbagels/WebHeadersController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebHeadersController GitHub license Carthage compatible

A WKWebView based view controller that supports adding HTTP headers and toolbar/accessory view hiding.

Features

  • Add custom [String: String] headers to the WKWebView URL request
  • Toggle WKWebView toolbar & keyboard accessory view

Installation

Carthage

If you're using Carthage you can add a dependency on WebHeadersController by adding it to your Cartfile:

github "kylebegeman/WebHeadersController" ~> 0.1

Usage

Push

Push onto an existing navigation controller:

let vc = WHViewController(urlString: url, headers: headers, showToolbar: showToolbar, showKeyboardAccessory: showKeyboardAccessory)
self.navigationController?.pushViewController(vc, animated: true)

Modal

Present modally with a built in navigation controller. Customize the dismiss button title; otherwise defaults to "Close"

let vc = WHModalViewController(urlString: url, headers: headers, showToolbar: showToolbar, showKeyboardAccessory: showKeyboardAccessory, dismissTitle: dismissTitle)
self.present(vc, animated: true, completion: nil)

To Do

  • Include error handling
  • Configure with custom toolbar buttons
  • Allow for UI configuration (ex: tint)

Contributing

Contributions are very welcome 👍

About

A WKWebView based view controller that supports adding HTTP headers and toolbar/accessory view hiding.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors