Repository: AvaloniaUI/Avalonia
File: src/iOS/Avalonia.iOS/TextInputResponder.Properties.cs (C#)

Code before:

        [Export("enablesReturnKeyAutomatically")]
        public bool EnablesReturnKeyAutomatically { get; set; }

        [Export("isSecureTextEntry")] public bool IsSecureEntry =>
            _view._options?.ContentType is TextInputContentType.Password or TextInputContentType.Pin 
            || (_view._options?.IsSensitive ?? false);

        [Export("spellCheckingType")]
        public UITextSpellCheckingType SpellCheckingType => 
            _view._options?.ShowSuggestions == false ?
                UITextSpellCheckingType.No :
                UITextSpellCheckingType.Yes;

        [Export("textContentType")] public NSString TextContentType { get; set; } = new NSString("text/plain");

        [Export("smartQuotesType")]
        public UITextSmartQuotesType SmartQuotesType { get; set; } = UITextSmartQuotesType.Default;

        [Export("smartDashesType")]
        public UITextSmartDashesType SmartDashesType { get; set; } = UITextSmartDashesType.Default;

        [Export("smartInsertDeleteType")]
        public UITextSmartInsertDeleteType SmartInsertDeleteType { get; set; } = UITextSmartInsertDeleteType.Default;

        [Export("passwordRules")] public UITextInputPasswordRules PasswordRules { get; set; } = null!;

        public NSObject? WeakInputDelegate
        {
            get;
            set;
        }

        NSObject IUITextInput.WeakTokenizer => _tokenizer;
        
    }
}


Review comment (suggestion):
`UITextInputPasswordRules.PasswordRules` is a nullable value for iOS and Catalyst. I'm not sure why it wasn't breaking for iOS normally, but adding Catalyst would break the build to complain about it not being nullable here. Adding the nullable flag fixes it.

Code after:

        [Export("enablesReturnKeyAutomatically")]
        public bool EnablesReturnKeyAutomatically { get; set; }

        [Export("isSecureTextEntry")] public bool IsSecureEntry =>
            _view._options?.ContentType is TextInputContentType.Password or TextInputContentType.Pin 
            || (_view._options?.IsSensitive ?? false);

        [Export("spellCheckingType")]
        public UITextSpellCheckingType SpellCheckingType => 
            _view._options?.ShowSuggestions == false ?
                UITextSpellCheckingType.No :
                UITextSpellCheckingType.Yes;

        [Export("textContentType")] public NSString TextContentType { get; set; } = new NSString("text/plain");

        [Export("smartQuotesType")]
        public UITextSmartQuotesType SmartQuotesType { get; set; } = UITextSmartQuotesType.Default;

        [Export("smartDashesType")]
        public UITextSmartDashesType SmartDashesType { get; set; } = UITextSmartDashesType.Default;

        [Export("smartInsertDeleteType")]
        public UITextSmartInsertDeleteType SmartInsertDeleteType { get; set; } = UITextSmartInsertDeleteType.Default;

        [Export("passwordRules")] public UITextInputPasswordRules? PasswordRules { get; set; } = null!;

        public NSObject? WeakInputDelegate
        {
            get;
            set;
        }

        NSObject IUITextInput.WeakTokenizer => _tokenizer;
        
    }
}