This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
iOS UITextInput autocorrection prompt #13959
Merged
LongCatIsLooong
merged 26 commits into
flutter:master
from
LongCatIsLooong:autocorrection
Apr 7, 2020
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
0b0000d
add new method for autocorrection
LongCatIsLooong 4846f35
account for multistage input
LongCatIsLooong 8a61354
add new method to FlutterTextInputDelegate
LongCatIsLooong 6246afc
add cause
LongCatIsLooong a5f99ce
move TODO around
LongCatIsLooong ee9bd5b
fix format
LongCatIsLooong dd30a95
Merge branch 'master' into autocorrection
LongCatIsLooong 24fceeb
update
LongCatIsLooong 920f446
update
LongCatIsLooong 6531251
add test
LongCatIsLooong e9801d9
Merge remote-tracking branch 'upstream/master' into autocorrection
LongCatIsLooong 6ff5711
Merge remote-tracking branch 'upstream/master' into autocorrection
LongCatIsLooong 7d12820
add tests
LongCatIsLooong 2c194d6
using arc for xctest
LongCatIsLooong 180ed36
revert changes
LongCatIsLooong 2d20e8f
format
LongCatIsLooong 56ead3c
comments
LongCatIsLooong bf486b6
Merge remote-tracking branch 'upstream/master' into autocorrection
LongCatIsLooong bb81680
update test name
LongCatIsLooong cf097be
remove newline
LongCatIsLooong 2237603
formatting
LongCatIsLooong cc7eb04
update licenses
LongCatIsLooong 792c37f
Update FlutterTextInputPluginTest.m
LongCatIsLooong e907174
license
LongCatIsLooong ea80b67
merge upstream/master
LongCatIsLooong 636ebf8
Merge remote-tracking branch 'upstream/master' into autocorrection
LongCatIsLooong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#import <OCMock/OCMock.h> | ||
#import <XCTest/XCTest.h> | ||
#include "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h" | ||
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterEngine.h" | ||
#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" | ||
|
||
FLUTTER_ASSERT_ARC | ||
|
||
@interface FlutterTextInputPluginTest : XCTestCase | ||
@end | ||
|
||
@implementation FlutterTextInputPluginTest | ||
|
||
- (void)testAutocorrectionPromptRectAppears { | ||
// Setup test. | ||
id engine = OCMClassMock([FlutterEngine class]); | ||
|
||
FlutterTextInputView* inputView = [[FlutterTextInputView alloc] initWithFrame:CGRectZero]; | ||
inputView.textInputDelegate = engine; | ||
[inputView firstRectForRange:[FlutterTextRange rangeWithNSRange:NSMakeRange(0, 1)]]; | ||
|
||
// Verify behavior. | ||
OCMVerify([engine showAutocorrectionPromptRectForStart:0 end:1 withClient:0]); | ||
|
||
// Clean up mocks | ||
[engine stopMocking]; | ||
} | ||
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should update the year to 2019.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2013 is the correct/approved year to use for all copyright dates in the engine. This has the effect of minimising our LICENSES text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops I have messed this up all over the place 😊 Thanks for the correction! I'll move these back to 2013 when I see them.