Skip to content

Commit 71a0291

Browse files
committed
Update README.md to reflect code changes
1 parent 5537002 commit 71a0291

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

README.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Written in Swift 4.2.
99

1010
## Usage
1111

12-
Pass your App-ViewController as a `rootViewController` parameter to `TinyConsole` to create the `TinyConsoleController`.
12+
Wrap your Main ViewController inside of a `TinyConsoleController` like so:
1313

1414
```swift
15-
TinyConsole.createViewController(rootViewController: MyMainViewController())
15+
TinyConsoleController(rootViewController: MyMainViewController())
1616
```
1717

1818
### Actions
@@ -33,10 +33,7 @@ TinyConsole.addMarker()
3333
// Clear console
3434
TinyConsole.clear()
3535

36-
// Set root view controller
37-
TinyConsole.set(rootViewController: MyViewController())
3836
```
39-
> Calling `TinyConsole.set(rootViewController:)` will change the `rootViewController` of `TinyConsoleController` but hold the console content and gesture configurations, which means the text and gesture recognizers of the console view will remain the same.
4037

4138
### Gestures
4239

@@ -47,22 +44,6 @@ By default, the gestures is configured as follows:
4744
* 3 Finger Tap: Show Action Sheet to `Clear Console` and `Send Mail`
4845
* Shake to toggle the console view. If you’re using the Simulator, press <kbd>⌃ ctrl</kbd>-<kbd>⌘ cmd</kbd>-<kbd>z</kbd>.
4946

50-
To customize the gestures, specify `withDefaultGestureConfiguration` as `false`
51-
52-
```swift
53-
TinyConsole.createViewController(rootViewController: MyMainViewController(), withDefaultGestureConfiguration: false)
54-
55-
```
56-
57-
and add your own gesture recognizers
58-
59-
```swift
60-
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(consoleTapped))
61-
TinyConsole.addGestureRecognizer(tapGestureRecognizer)
62-
```
63-
64-
> Calling `TinyConsole.useDefaultGestureConfiguration()` will remove all gesture recognizers from console view and add the default gesture recognizers.
65-
6647
## Implementation Example
6748

6849
Instead of
@@ -81,7 +62,7 @@ write
8162
```swift
8263
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
8364
window = UIWindow(frame: UIScreen.main.bounds)
84-
window?.rootViewController = TinyConsole.createViewController(rootViewController: MyMainViewController())
65+
window?.rootViewController = TinyConsoleController(rootViewController: MyMainViewController())
8566
window?.makeKeyAndVisible()
8667
return true
8768
}

0 commit comments

Comments
 (0)