Skip to content

Commit

Permalink
Fix Label::set_max_number_of_lines causing crash on iOS (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxer137 authored Jul 19, 2023
1 parent 9fbb332 commit 1b57750
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/text/label/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ impl<T> Label<T> {
/// Sets the maximum number of lines.
pub fn set_max_number_of_lines(&self, num: NSInteger) {
self.objc.with_mut(|obj| unsafe {
#[cfg(feature = "appkit")]
let _: () = msg_send![obj, setMaximumNumberOfLines: num];
#[cfg(feature = "uikit")]
let _: () = msg_send![obj, setNumberOfLines: num];
});
}

Expand Down

0 comments on commit 1b57750

Please sign in to comment.