public static IntPtr GetAppearance(IntPtr class_ptr, UITraitCollection traits) { if (traits == null) { throw new ArgumentNullException("traits"); } return(Messaging.IntPtr_objc_msgSend_IntPtr(class_ptr, Selector.GetHandle(UIAppearance.selAppearanceForTraitCollection), traits.Handle)); }
// new in iOS9 but the only option for tvOS public static IntPtr GetAppearance(IntPtr class_ptr, UITraitCollection traits, params Type [] whenFoundIn) { if (traits == null) { throw new ArgumentNullException("traits"); } using (var array = NSArray.FromIntPtrs(TypesToPointers(whenFoundIn))) { return(Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr(class_ptr, Selector.GetHandle(UIAppearance.selAppearanceForTraitCollectionWhenContainedInInstancesOfClasses), traits.Handle, array.Handle)); } }
public static UIFont GetPreferredFontForTextStyle(UIFontTextStyle uiFontTextStyle, UITraitCollection traitCollection) { return(GetPreferredFontForTextStyle(uiFontTextStyle.GetConstant(), traitCollection)); }
public static UIFont GetPreferredFontForTextStyle(NSString uiFontTextStyle, UITraitCollection traitCollection) { var ptr = _GetPreferredFontForTextStyle(uiFontTextStyle, traitCollection); return(ptr == IntPtr.Zero ? null : new UIFont(ptr)); }