Skip to content

Commit 6b9ab71

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents f219ec9 + 4ba09c7 commit 6b9ab71

File tree

1 file changed

+66
-12
lines changed

1 file changed

+66
-12
lines changed

README.md

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# WebViewLibrary
2-
1+
WebViewLibrary
2+
=============
33
A package for a customized webview.
44

5-
## How to use:
6-
- Import WebViewLibrary to your project with either SPM or Cocoapods
7-
- Import WebViewLibrary in the class, view controller, method or delegate methods in case of textfields that would use the web e.g:
8-
9-
```
5+
BASIC EXAMPLE
6+
---------
7+
``` Swift
108
import UIKit
119
import WebViewLibrary
1210

@@ -15,18 +13,74 @@ A package for a customized webview.
1513
override func viewDidLoad() {
1614
super.viewDidLoad()
1715
view.backgroundColor = .red
18-
let vc = WebViewLibrary(link: "https://your-url")
19-
self.navigationController?.present(vc, animated: true)
16+
let viewController = WebViewLibrary(link: "https://your-url")
17+
self.navigationController?.present(viewController, animated: true)
2018
}
2119
}
2220

2321
```
22+
Futher Customization
23+
---------
24+
If you do not need the link textfield to show, you can do this:
25+
```swift
26+
let viewController = WebViewLibrary(link: "https://fb.com", isLinkTextfieldHidden: true)
27+
```
28+
29+
Setup Instruction
30+
---------
31+
- ### COCOAPODS
32+
With CocoaPods, add to your Podfile
33+
34+
```sh
35+
pod 'WebViewLibrary'
36+
```
37+
Open your project directory in terminal and run
38+
```sh
39+
$ pod install
40+
```
41+
42+
In order to update with the lastest WebViewLibrary SDK, run
43+
```sh
44+
$ pod update
45+
```
46+
47+
- ### SPM
48+
<br>When using Xcode 11 or later, you can install Toast by going to your `Project settings` > `Swift Packages` and add the repository by providing the GitHub URL. Alternatively, you can go to `File` > `Swift Packages` > `Add Package Dependencies`...
2449

25-
- Initialize WebViewLibrary with the link it is to load; ensure the link is a valid url and has in this format- `"https://your-url"`
26-
- Run your project and see it in action.
50+
- ### Manually
51+
1. Add `WebViewLibrary.swift` to your project.
52+
2. Enjoy!
2753

28-
#### How it looks:
54+
Extra Notes
55+
---------
56+
- Ensure the link provided is a valid url and is in this format- `"https://your-url"`
57+
- It is very useful in textfields.
2958

59+
How it looks:
60+
---------
3061
<div>
3162
<img src="https://user-images.githubusercontent.com/58847828/221267986-5f9a6cf4-2bdf-4f83-b23e-0fb90a644136.png" width="350" height="700" />
3263
</div>
64+
65+
MIT License
66+
---------
67+
Copyright (c) 2015-2019 Charles Scalesse.
68+
69+
Permission is hereby granted, free of charge, to any person obtaining a
70+
copy of this software and associated documentation files (the
71+
"Software"), to deal in the Software without restriction, including
72+
without limitation the rights to use, copy, modify, merge, publish,
73+
distribute, sublicense, and/or sell copies of the Software, and to
74+
permit persons to whom the Software is furnished to do so, subject to
75+
the following conditions:
76+
77+
The above copyright notice and this permission notice shall be included
78+
in all copies or substantial portions of the Software.
79+
80+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
81+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
82+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
83+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
84+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
85+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
86+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)