Skip to content

Commit d58bf0d

Browse files
committed
feat(iqkeyboardmanager): swift package 8.0.2
1 parent bb831a1 commit d58bf0d

17 files changed

Lines changed: 1068 additions & 691 deletions
Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:IQKeyboardManager="@nativescript/iqkeyboardmanager" navigatingTo="navigatingTo" class="page">
2-
<Page.actionBar>
3-
<ActionBar title="iqkeyboardmanager" icon="" class="action-bar">
4-
</ActionBar>
5-
</Page.actionBar>
6-
<ScrollView>
1+
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
2+
xmlns:IQKeyboardManager="@nativescript/iqkeyboardmanager" navigatingTo="navigatingTo" class="page">
3+
<Page.actionBar>
4+
<ActionBar title="iqkeyboardmanager" icon="" class="action-bar">
5+
</ActionBar>
6+
</Page.actionBar>
7+
<ScrollView>
78
<StackLayout>
89

910
<iOS>
@@ -33,36 +34,24 @@
3334
</GridLayout>
3435
</iOS>
3536

36-
<IQKeyboardManager:PreviousNextView>
37+
38+
<StackLayout>
39+
<TextField hint="Email"/>
40+
<TextField hint="Password"/>
41+
<StackLayout>
42+
<IQKeyboardManager:TextViewWithHint text="{{ textViewWithHintText }}" hint="Working TextView hint 🤪"/>
43+
</StackLayout>
3744
<StackLayout>
38-
<TextField hint="Email"/>
39-
<TextField hint="Password"/>
40-
<StackLayout>
41-
<IQKeyboardManager:TextViewWithHint text="{{ textViewWithHintText }}" hint="Working TextView hint 🤪"/>
42-
</StackLayout>
43-
<StackLayout>
44-
<TextView text="{{ textViewText }}" hint="Not working TextView hint"/>
45-
</StackLayout>
46-
<StackLayout>
47-
<TextField hint="5"/>
48-
</StackLayout>
49-
<StackLayout>
50-
<TextField hint="6"/>
51-
</StackLayout>
52-
<StackLayout>
53-
<TextView hint="7"/>
54-
</StackLayout>
55-
<StackLayout>
56-
<TextView hint="8"/>
57-
</StackLayout>
58-
<StackLayout>
59-
<TextView hint="9"/>
60-
</StackLayout>
61-
<StackLayout>
62-
<TextField hint="10"/>
63-
</StackLayout>
45+
<TextView text="{{ textViewText }}" hint="Not working TextView hint"/>
6446
</StackLayout>
65-
</IQKeyboardManager:PreviousNextView>
47+
<TextField hint="5"/>
48+
<TextField hint="6"/>
49+
<TextView hint="7"/>
50+
<TextView hint="8"/>
51+
<TextView hint="9"/>
52+
<TextField hint="10"/>
53+
</StackLayout>
54+
6655
</StackLayout>
6756
</ScrollView>
6857
</Page>

packages/iqkeyboardmanager/README.md

Lines changed: 32 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
# @nativescript/iqkeyboardmanager
22

33
## Contents
4-
* [Intro](#intro)
5-
* [Installation](#installation)
6-
* [Use @nativescript/iqkeyboardmanager](#use-nativescriptiqkeyboardmanager)
7-
* [Core](#core)
8-
* [Angular](#angular)
9-
* [Vue](#vue)
10-
* [Svelte](#svelte)
11-
* [React](#react)
12-
* [Adding a hint text to the TextView accessory bar](#adding-a-hint-text-to-the-textview-accessory-bar)
13-
* [Core](#core-1)
14-
* [Angular](#angular-1)
15-
* [Vue](#vue-1)
16-
* [Svelte](#svelte-1)
17-
* [Demo app](#demo-apps)
18-
* [Tweaking the appearance and behavior](#tweaking-the-appearance-and-behavior)
19-
* [Multi-factor one-time code auto-fill](#multi-factor-one-time-code-auto-fill)
20-
* [Native documentation](#native-documentation)
21-
* [Maintainers](#maintainers)
22-
* [License](#license)
4+
- [@nativescript/iqkeyboardmanager](#nativescriptiqkeyboardmanager)
5+
- [Contents](#contents)
6+
- [Intro](#intro)
7+
- [Installation](#installation)
8+
- [Use @nativescript/iqkeyboardmanager](#use-nativescriptiqkeyboardmanager)
9+
- [Adding a hint text to the TextView accessory bar](#adding-a-hint-text-to-the-textview-accessory-bar)
10+
- [Core](#core)
11+
- [Angular](#angular)
12+
- [Vue](#vue)
13+
- [Svelte](#svelte)
14+
- [React](#react)
15+
- [Tweaking the appearance and behavior](#tweaking-the-appearance-and-behavior)
16+
- [Multi-factor one-time code auto-fill](#multi-factor-one-time-code-auto-fill)
17+
- [Native documentation](#native-documentation)
18+
- [Maintainers](#maintainers)
19+
- [License](#license)
2320

2421
## Intro
2522

@@ -43,107 +40,20 @@ The following sections describe how to use the `@nativescript/iqkeyboardmanager`
4340
> **Note** Make related text fields siblings for the IQKeyboardManager to automatically
4441
add the `previous`(`<`) and `next`(`>`) buttons to the accessory bar. The user can then use those buttons to jump back and forth.
4542
46-
### Core
47-
1. Register the plugin namespace with Page's `xmlns` attribute under a prefix( `IQKeyboardManager` for example) that you can use to access the `PreviousNextView`.
48-
49-
```xml
50-
<Page xmlns:IQKeyboardManager="@nativescript-iqkeyboardmanager">
51-
```
52-
2. Access the `PreviousNextView` using the prefix.
53-
54-
```xml
55-
<IQKeyboardManager:PreviousNextView><!-- add this 'wrapper' to enable those previous / next buttons -->
56-
<StackLayout>
57-
<TextField hint="Email"/>
58-
<TextField hint="Password"/>
59-
</StackLayout>
60-
</IQKeyboardManager:PreviousNextView>
6143
```
62-
The 2 preceding steps result in the code below:
63-
64-
```xml
65-
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:IQKeyboardManager="@nativescript-iqkeyboardmanager">
66-
<ScrollView>
67-
<IQKeyboardManager.PreviousNextView><!-- add this 'wrapper' to enable those previous / next buttons -->
68-
<StackLayout>
69-
<TextField hint="Email"/>
70-
<TextField hint="Password"/>
71-
</StackLayout>
72-
</IQKeyboardManager:PreviousNextView>
73-
</ScrollView>
74-
</Page>
44+
IQKeyboardToolbarManager.shared.isEnabled = true
7545
```
7646

77-
### Angular
78-
79-
1. Register the `PreviousNextView` element in the `.modules.ts` file where you want to use this feature (or the `app.module.ts` for global access).
80-
81-
```ts
82-
import { registerElement } from '@nativescript/angular';
83-
import { PreviousNextView } from '@nativescript/iqkeyboardmanager';
84-
registerElement('PreviousNextView', () => PreviousNextView);
85-
```
86-
87-
2. Add `PreviousNextView` to the markup as follows:
88-
89-
```html
90-
<ScrollView>
91-
<PreviousNextView
92-
><!-- add this 'wrapper' to enable those previous / next buttons -->
93-
<StackLayout>
94-
<TextField hint="Email"></TextField>
95-
<TextField hint="Password"></TextField>
96-
</StackLayout>
97-
</PreviousNextView>
98-
</ScrollView>
99-
```
100-
101-
### Vue
102-
103-
1. Register `PreviousNextView` by adding the following code to the `app.ts` file.
104-
105-
```ts
106-
registerElement('PreviousNextView', () => require('@nativescript/iqkeyboardmanager').PreviousNextView);
107-
```
108-
2. Use `PreviousNextView` in markup.
109-
110-
```xml
111-
<ScrollView>
112-
<PreviousNextView
113-
><!-- add this 'wrapper' to enable those previous / next buttons -->
114-
<StackLayout>
115-
<TextField hint="Email"></TextField>
116-
<TextField hint="Password"></TextField>
117-
</StackLayout>
118-
</PreviousNextView>
119-
</ScrollView>
120-
```
121-
122-
### Svelte
123-
124-
1. Register `PreviousNextView` by adding the following code to the `app.ts` file.
125-
126-
```ts
127-
registerNativeViewElement('previousNextView', () => require('@nativescript/iqkeyboardmanager').PreviousNextView);
128-
```
129-
2. Add `previousNextView` to markup.
130-
131-
```xml
132-
<previousNextView><!-- add this 'wrapper' to enable those previous / next buttons -->
133-
<stackLayout>
134-
<textField hint="Email"/>
135-
<textField hint="Password"/>
136-
</stackLayout>
137-
</previousNextView>
138-
```
139-
For a demo app, visit [NativeScript Svelte: IQ Keyboard Manager](https://stackblitz.com/edit/nativescript-stackblitz-templates-rygnsk?file=app/components/Home.svelte).
140-
14147
### Adding a hint text to the TextView accessory bar
14248

14349
By default, when a `TextField` is focused, the keyboard manager shows the field's hint label in the accessory bar above the keyboard.
14450

14551
For a `TextView`, however, use the `TextViewWithHint` component,
146-
provided by this plugin, to add the hint label to the accessory bar.
52+
provided by this plugin, to add the hint label to the accessory bar. Be sure to enable the toolbar:
53+
54+
```ts
55+
IQKeyboardToolbarManager.shared.enableAutoToolbar = true;
56+
```
14757

14858
#### Core
14959

@@ -233,40 +143,34 @@ registerElement("textViewWithHint", ()=> require("@nativescript/iqkeyboardmanage
233143
</stackLayout>
234144
</previousNextView>
235145
```
236-
### Demo apps
237-
238-
The following are links to the plugin demo apps in the different JS flavors.
239-
240-
* [NativeScript TS: IQ Keyboard Manager](https://stackblitz.com/edit/nativescript-stackblitz-templates-sia8th?file=app/main-page.xml).
241-
* [NativeScript Svelte: IQ Keyboard Manager](https://stackblitz.com/edit/nativescript-stackblitz-templates-rygnsk?file=app/components/Home.svelte)
242-
* [NativeScript React: IQ Keyboard Manager](https://stackblitz.com/edit/nativescript-stackblitz-templates-5uygfj?file=src/components/ScreenOne.tsx)
243146

244147

245148
### Tweaking the appearance and behavior
246149

247-
To tweak the appearance and behavior of `PreviousNextView`, follow the steps below:
248-
249150
1. Add the following path to your app’s `references.d.ts` file.
250151

251152
```xml
252-
/// <reference path="./node_modules/@nativescript/iqkeyboardmanager/index.d.ts" />
153+
/// <reference path="./node_modules/@nativescript/iqkeyboardmanager/typings/index.d.ts" />
253154
```
254155

255156
2. Initialize an instance of `IQKeyboardManager` as follows.
256157

257158
```typescript
258-
const iqKeyboard = IQKeyboardManager.sharedManager();
159+
const iqKeyboard = IQKeyboardManager.shared;
259160
```
260161

261162
You now have the full IQKeyboardManager APIs available for you to use. For example, to switch to a dark keyboard you could use the following code.
262163

263164
```typescript
264-
const iqKeyboard = IQKeyboardManager.sharedManager();
265-
iqKeyboard.overrideKeyboardAppearance = true;
266-
iqKeyboard.keyboardAppearance = UIKeyboardAppearance.Dark;
267-
```
165+
const iqKeyboard = IQKeyboardManager.shared;
166+
const config = IQKeyboardAppearanceConfiguration.new();
167+
config.appearance = UIKeyboardAppearance.Dark;
168+
config.overrideAppearance = true;
169+
iqKeyboard.keyboardConfiguration = config;
268170

269-
<img src="https://github.com/tjvantoll/nativescript-IQKeyboardManager/raw/master/demo.gif" width="320px"/>
171+
// Toolbar
172+
iqKeyboard.enableAutoToolbar = true;
173+
```
270174

271175
#### Multi-factor one-time code auto-fill
272176

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { ContentView, TextView } from '@nativescript/core';
22

3+
/**
4+
* No longer needed.
5+
* @deprecated This class is not needed anymore. Instead use:
6+
* IQKeyboardToolbarManager.shared.isEnabled = true;
7+
*/
38
export declare class PreviousNextView extends ContentView {}
49

510
export declare class TextViewWithHint extends TextView {}
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
import { ContentView, TextView } from "@nativescript/core";
1+
import { ContentView, TextView } from '@nativescript/core';
22

3+
/**
4+
* No longer needed.
5+
* @deprecated This class is not needed anymore. Instead use:
6+
* IQKeyboardToolbarManager.shared.isEnabled = true;
7+
*/
38
export class PreviousNextView extends ContentView {
4-
createNativeView() {
5-
return IQPreviousNextView.new();
6-
}
9+
createNativeView() {
10+
return UIView.new();
11+
}
712
}
813

914
export class TextViewWithHint extends TextView {
10-
createNativeView() {
11-
const view = IQTextView.new();
12-
this.nativeView = view;
13-
view.placeholder = this.hint;
14-
return view;
15-
}
15+
createNativeView() {
16+
const view = IQTextView.new();
17+
this.nativeView = view;
18+
view.placeholder = this.hint;
19+
return view;
20+
}
1621
}

packages/iqkeyboardmanager/nativescript.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: 'IQKeyboardManagerSwift',
88
libs: ['IQKeyboardManagerSwift'],
99
repositoryURL: 'https://github.com/hackiftekhar/IQKeyboardManager.git',
10-
version: '6.5.11',
10+
version: '8.0.2',
1111
},
1212
],
1313
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/// <reference path="../../references.d.ts" />
2-
/// <reference path="./typings/objc!IQKeyboardManager.d.ts" />
2+
/// <reference path="./typings/index.d.ts" />
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path="../../../references.d.ts" />
2+
/// <reference path="./objc!IQKeyboardManagerSwift.d.ts" />
3+
/// <reference path="./objc!IQKeyboardCore.d.ts" />
4+
/// <reference path="./objc!IQKeyboardNotification.d.ts" />
5+
/// <reference path="./objc!IQKeyboardReturnManager.d.ts" />
6+
/// <reference path="./objc!IQKeyboardToolbar.d.ts" />
7+
/// <reference path="./objc!IQKeyboardToolbarManager.d.ts" />
8+
/// <reference path="./objc!IQTextInputViewNotification.d.ts" />
9+
/// <reference path="./objc!IQTextView.d.ts" />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
declare const enum IQEnableMode {
2+
Default = 0,
3+
4+
Enabled = 1,
5+
6+
Disabled = 2,
7+
}
8+
9+
interface IQTextInputView extends UITextInputTraits {
10+
inputAccessoryView: UIView;
11+
12+
/**
13+
* @since 16.0
14+
*/
15+
iqFindInteraction: UIFindInteraction;
16+
17+
iqIsEnabled: boolean;
18+
19+
/**
20+
* @since 16.0
21+
*/
22+
iqIsFindInteractionEnabled: boolean;
23+
}
24+
declare var IQTextInputView: {
25+
prototype: IQTextInputView;
26+
};

0 commit comments

Comments
 (0)