Fix Label::set_max_number_of_lines causing crash on iOS (#98)

This commit is contained in:
maxer137 2023-07-19 21:20:43 +00:00 committed by GitHub
parent 9fbb332b38
commit 1b577506a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -417,7 +417,10 @@ impl<T> Label<T> {
/// Sets the maximum number of lines. /// Sets the maximum number of lines.
pub fn set_max_number_of_lines(&self, num: NSInteger) { pub fn set_max_number_of_lines(&self, num: NSInteger) {
self.objc.with_mut(|obj| unsafe { self.objc.with_mut(|obj| unsafe {
#[cfg(feature = "appkit")]
let _: () = msg_send![obj, setMaximumNumberOfLines: num]; let _: () = msg_send![obj, setMaximumNumberOfLines: num];
#[cfg(feature = "uikit")]
let _: () = msg_send![obj, setNumberOfLines: num];
}); });
} }