feat(ios): apple intelligence writing tools (#10643)

This commit is contained in:
Nathan Walker
2025-02-17 20:56:29 -08:00
committed by GitHub
parent 1b72912f81
commit e853fca3c9
17 changed files with 638 additions and 68 deletions

View File

@@ -1,4 +1,4 @@
import { Page, Observable, EventData, TextField, PropertyChangeData } from '@nativescript/core';
import { Page, Observable, EventData, TextField, PropertyChangeData, TextView } from '@nativescript/core';
let page: Page;
@@ -28,6 +28,12 @@ export class SampleData extends Observable {
console.log(args.value);
this.notifyPropertyChange('formattedPhoneInput', args.value);
}
textChangeArea(args: PropertyChangeData) {
const textArea = args.object as TextView;
console.log('---- AI active:', textArea.isWritingToolsActive);
console.log('textChangeArea:', args.value);
}
}
function formatPhoneNumber(value: string, useParens?: boolean) {

View File

@@ -20,6 +20,10 @@
</TextField>
<Label text="{{ formattedPhoneInput }}" marginTop="6" />
<Label text="TextView" fontWeight="bold" marginTop="12" />
<TextView hint="Type text..." style.placeholderColor="silver" textChange="{{textChangeArea}}" color="black" width="80%" borderColor="silver" borderWidth="1" height="200" borderRadius="4" fontSize="14">
</TextView>
</StackLayout>
</ScrollView>
</Page>