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

DatePicker crashes on iOS 9.x with message [UILabel setAdjustsFontForContentSizeCategory:]: unrecognized selector sent to instance #18

Open
carlosanjos opened this issue Apr 13, 2018 · 2 comments

Comments

@carlosanjos
Copy link

Which platform(s) does your issue occur on?

iOS emulator version 9.3
iOS device version 9.2.1
iOS device model me432b/a (iPhone 5s)

Please, provide the following version numbers that your issue occurs with:

It's a NativeScript Angular 5 project

tns --version
3.4.3
tns-ios
3.4.1

Packages Used

"nativescript-modal-datetimepicker": "^1.1.2",
"tns-core-modules": "^3.4.0",
"@angular/compiler-cli": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"moment": "^2.18.1",

Steps to reproduce the bug

Tap on a TextField to fire the modal. It works like charm for iOS > 9.x, but on 9.x the error -[UILabel setAdjustsFontForContentSizeCategory:]: unrecognized selector sent to instance 0x7fb1b3ee18e0 is printed out on the console.

Is there any code involved?

<TextField (ngModelChange)="onInputChange()" editable="false" [text]="personalInfo.dateOfBirth | date:'d MMMM yyyy'" (tap)="openDatePicker()"></TextField>
    public openDatePicker(): void {
        const picker = new ModalPicker.ModalDatetimepicker();
        picker.pickDate({
            theme: 'dark',
            maxDate: new Date(),
            is24HourView: false
        }).then((result) => {
            this.personalInfo.dateOfBirth = moment(result).toDate();
        }).catch((error) => {
            this.handleError(error);
        })
    }
@nunopedrosa
Copy link

nunopedrosa commented Apr 13, 2018

In the meantime, either comment the attribute, or place an if around it, like:

if (titleLabel.respondsToSelector(“adjustsFontForContentSizeCategory”)) {
titleLabel.adjustsFontForContentSizeCategory = true;
}

@shiv19
Copy link
Collaborator

shiv19 commented Apr 3, 2019

@carlosanjos Please try v1.2.0 and let me know if it resolves this issue. Thanks :)
this version incorporates PR #27

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

3 participants