Text

The 9th Multiple Text Widgets

How should it be done to make more than 9 multiple text widgets in 1 screen?
The 9th can't be changed.


Sorry for the delay, we have done some tests in order to reproduce this issue, but we need more details to better analyze it.
Could you please let us know:
- which device do you use? Which iOS version does it run on?
- did you create 9 fields?
- do you mean that you can't write anything in the 9th field although it works properly in the other fields?
Best regards

- which device do you use? Which iOS version does it run on?
iPad Air2 iOS8

- did you create 9 fields?
Yes. I created 12 fields.

- do you mean that you can’t write anything in the 9th field although it works properly in the other fields?
It's possible to write it, but it isn't changed.

When following ViewController is called 9 times from NavigationController,
change processing isn't called any more.

---- ViewController.h ----
//
// ViewController.h
// sample
//
// Created by dpcc on 2015/01/28.
//

#import <UIKit/UIKit.h>
#import <AtkMltw/MultiLineTextWidget.h>

@interface ViewController : UIViewController

@property (strong, nonatomic) IBOutlet MLTWMultiLineView *widget;

@property (nonatomic, strong) NSString *locale;

@end

---- ViewController.m ----
//
// ViewController.m
// sample
//
// Created by dpcc on 2015/01/28.
//

#import "ViewController.h"
#import "MyCertificate.h"

@interface ViewController () <MLTWMultiLineViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self initWidget];
}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (void)initWidget
{
// widget settings
_widget.delegate = self;
_widget.guidelineFirstPosition = 150.;
_widget.autoScrollDisabled = YES;

// widget colors
// _widget.inkColor = [UIColor appTintColor];
// _widget.inkColorHighlight = [UIColor appSoftBlueColor];
// _widget.guidelinesColor = [[UIColor appTintColor] colorWithAlphaComponent:0.4];
// _widget.scrollBackgroundColor = [[UIColor appDarkGrayColor] colorWithAlphaComponent:0.5];

// start configuration with english
NSString* LOCALE_EN = @"en_US";
[self configureRecognitionForLocale:LOCALE_EN];
}

//----------------------------------
#pragma mark - MultiLine View delegate - Configuration
//----------------------------------

- (void)configureRecognitionForLocale:(NSString *)locale
{
_locale = locale;

NSArray *resources = [self resourcesForLocale:locale];

NSData *certificate = [self certificate];

[_widget configureWithLocale:locale resources:resources lexicon:nil certificate:certificate density:132 * 2];
}

- (NSArray *)resourcesForLocale:(NSString *)locale
{
NSString *akCur, *lkText;

NSString* LOCALE_EN = @"en_US";
if ([locale isEqualToString:LOCALE_EN])
{
akCur = [[NSBundle mainBundle] pathForResource:@"en_US-ak-cur.lite" ofType:@"res"];
lkText = [[NSBundle mainBundle] pathForResource:@"en_US-lk-text.lite" ofType:@"res"];
}

NSArray *resources = @[akCur, lkText];
return resources;
}

- (NSString *)labelForLocale:(NSString *)locale
{
NSString* LOCALE_EN = @"en_US";
if ([locale isEqualToString:LOCALE_EN])
{
return @"English";
}

return nil;
}

- (NSData *)certificate
{
return [NSData dataWithBytes:myCertificate.bytes length:myCertificate.length];
}

- (void)multiLineView:(MLTWMultiLineView *)view didChangeText:(NSString *)text
{
NSLog(@"%@",text);
}

@end

====================================


Thanks for those details and sorry for the misunderstanding.
I think the best solution for your needs would be using the Single Line Text Widget instead of the MultiLineTextWidget.
The Single Line Text Widget allows to create several fields with a specific location on the screen first and then to write in each field using the TextWidget instead of the keyboard.

The Sample shows an example with 3 fields. Did you try it?
I hope it will be helpful! Please let us know if you have any questions.
Kind regards,

Thank you very much for your answer.

It isn't using a keyboard area to a field, I'd like to input directly, is it possible?

You can locate the writing area of the TextWidget at a specific place and it is not limited to 8 instances like the MultiLine Text Widget. The limit has been set to avoid out of memory error and that's why the recognition can't be done in the 9th field of your application.
Maybe you should have a look to the Single Char Widget, it could be a great solution for your needs as well.

Please let us know if it helps.

Hi,
We need to use without UITextField's inputView property.
If SCW is not set to inputView,
SCW sends empty text via singleCharView:didChangeText: to its own delegate.
We want to place anywhere in parent view, and use without UITextField.
Please tell me some way to avoid these restriction.

Hello,
Here are some steps to answer your needs with the Single Char Widget:
1. Follow integration procedure described in the documentation

2. In your main view controller class, add the single char widget view to your view hierarchy

_widget.frame = CGRectMake(0, 0, 300, 300);
// update the coordinates to place the widget frame where you see fit
_widget.delegate = self;
// self must implement the SCWSingleCharViewDelegate

[self.view addSubView:_widget];

3. Write into the widget, the widget should call the following delegate everytime something is recognized

(void)singleCharWidget:(SCWSingleCharView *)sender didChangeText:(NSString*)text intermediate:(BOOL)intermediate;

For more information, please refer to the documentation:
SCWSingleCharViewDelegate api
Please let us know if it works properly on your side.

Thank you for answer me.

From a conclusion, result is unsuccessful.

I build new project, and set up your integration step for SCW.
But I did not get expected result.

Following code is all I wrote to find out this problem.

ViewController.m


#import "ViewController.h"
#import "MyCertificate.h"

@interface ViewController ()

@end

@implementation ViewController
{

}

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// Create the Single Char Widget View
SCWSingleCharView *_widget = [[SCWSingleCharView alloc] init];
_widget.delegate = self;

NSBundle* resourceBundle = [NSBundle bundleWithPath:@"AtkScw.bundle"];
// Recognition resources
NSArray *_resources = [NSArray arrayWithObjects:
[resourceBundle pathForResource:@"latin-ak-superimposed.lite" ofType:@"res"],
[resourceBundle pathForResource:@"en_US-lk-text_superimposed.lite" ofType:@"res"],
[resourceBundle pathForResource:@"mul-lk-gesture_superimposed" ofType:@"res"],
nil];

// Certificate
NSData *_certificate = [NSData dataWithBytes:myCertificate.bytes length:myCertificate.length];

// Configure the Single Char Widget View with the recognition resources and the certificate
[_widget configureWithLanguage:@"en_US"
resources:_resources
certificate:_certificate];

_widget.frame = CGRectMake(0, 0, 300, 300);
// update the coordinates to place the widget frame where you see fit
_widget.delegate = self;
// self must implement the SCWS
[self.view addSubview:_widget];
}

-(void)singleCharWidget:(SCWSingleCharView *)sender didChangeText:(NSString*)text intermediate:(BOOL)intermediate{
NSLog(@"recognized(reconizing=%@) text = "%@"",intermediate? @"YES":@"NO",text);
}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

@end


And I ran it. I got following console logs. I tried to write single 'a' character on iPad screen by hand.


2015-02-04 09:50:07.741 SCWTest01[240:13208] Auto-freeze
2015-02-04 09:50:07.744 SCWTest01[240:13208] recognized(reconizing=NO) text = ""
2015-02-04 09:50:07.774 SCWTest01[240:13208] Recognizer configured success=YES
2015-02-04 09:50:36.187 SCWTest01[240:13208] Pen down
2015-02-04 09:50:36.705 SCWTest01[240:13208] 31 points captured
2015-02-04 09:50:36.706 SCWTest01[240:13208] Trigger auto-freeze timer
2015-02-04 09:50:36.709 SCWTest01[240:13208] Trigger auto-commit timer
2015-02-04 09:50:37.211 SCWTest01[240:13208] Auto-commit
2015-02-04 09:50:37.212 SCWTest01[240:13208] Recognize
2015-02-04 09:50:37.214 SCWTest01[240:13208] Recognize (before="", after="", pre-context="", ink model (1 boxes, 1 strokes in last box))
2015-02-04 09:50:37.218 SCWTest01[240:13208] Recognizer result available
2015-02-04 09:50:39.707 SCWTest01[240:13208] Auto-freeze

After I wrote by hand on screen, but singleCharWidget:didChangeText:intermediate:
did not called.

Configuration of SCW seems to work fine.
Recognizing process may seems to be working, But delegate method did *NOT* call from SCW.

Why?

Looks like there is an issue in our documentation.

In your implementation, resourceBundle shall be nil and _resources array shall be empty.
Can you confirm?

Seems like name of resources is wrong as well, compared to what is included in AtkScw.bundle.

I suggest the following modifications:
NSString* resourceBundlePath = [[NSBundlemainBundle] pathForResource:@AtkScwofType:@bundle];
NSBundle* resourceBundle = [NSBundlebundleWithPath:resourceBundlePath];
// Recognition resources
NSArray *_resources = [NSArrayarrayWithObjects:[resourceBundle pathForResource:@latin/latin-ak-superimposed.liteofType:@res],[resourceBundle pathForResource:@en_US/en_US-lk-text.liteofType:@res],[resourceBundle pathForResource:@mul/mul-lk-gestureofType:@res],nil];

Please accept our apologies for this error in our documentation.

We plan to fix them in our upcoming ATK release.

Best regards,

Olivier

Hi,

I modified my code following your advice.
Then it works!

I appreciate your quick response.

When such a error about configuration occurs, I want to know it some way.(NSError from delegate or console warning, etc.)
I hope to consider to fix your modules about it upcoming release.

Thank you very much.

When SCW is started more than twice on more than 2 screens, SCW stops it, or application stops.
Are they able to use SCW on more than 2 screens?
How should it be done?

On our side, we created 2 instances of the SCW, and did not face any issue. A priori, there is no limitation, except the device by itself.

In your case, maybe you do not have enough memory left on your device.

Best regards,

Olivier

We also can create more than one instance on a single screen as you say has been confirmed.

However, SCW will not recognize when you create an instance in multiple screens.

If the SCW than something that only works on a single screen, it can not be used as an application of the engine.

We are very troubled.

We might have found the cause of this problem.

We have created SCW on the PopOverController.

Please tell me if there are any restrictions on PopOverController.

Login or Signup to post a comment