Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Multiline Text view #478

Closed
Wiwaltill opened this issue Jan 14, 2023 · 5 comments
Closed

Disable Multiline Text view #478

Wiwaltill opened this issue Jan 14, 2023 · 5 comments

Comments

@Wiwaltill
Copy link

It would be great if you could lock the input in your long text field. This would make it easier to display longer texts.

It would be an alternative to the long footer text and could be set via UserDefaults.

@futuretap
Copy link
Owner

You mean an IASKIsEditable flag in the plist? Or something more dynamic using a delegate callback?

@Wiwaltill
Copy link
Author

Yes, exactly. That's what I mean.

@futuretap
Copy link
Owner

You could subclass IASKAppSettingsViewController and override -tableView:newCellForSpecifier::

- (UITableViewCell*)tableView:(UITableView *)tableView newCellForSpecifier:(IASKSpecifier*)specifier {
    UITableViewCell *cell = [super tableView:tableView newCellForSpecifier:specifier];
    if ([specifier.type isEqualToString:kIASKTextViewSpecifier]) {
        ((IASKTextViewCell*)cell).textView.editable = NO;
    }
    return cell;
}

@Wiwaltill
Copy link
Author

I don't have that much experience with Swift and how to use it. What would an application example be like? Or how exactly could I use it for my code?

I want to use it here:
image

In my code:

self.defaults.set(appInfo.releaseNotes, forKey: "dynamicTextViewUpdates")

@futuretap
Copy link
Owner

converted to Swift:

override func tableView(_ tableView: UITableView, newCellForSpecifier specifier: IASKSpecifier) -> UITableViewCell {
    let cell = super.tableView(tableView, newCellForSpecifier: specifier)
    if specifier.type == kIASKTextViewSpecifier {
        (cell as? IASKTextViewCell)?.textView.isEditable = false
    }
    return cell
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants