Once again, Xcode IB disappoints developers with unnecessary warnings.
I felt the same thing about it, until I saw how my printing house was different at 10.10 compared to 10.11. It's one thing - a message is garbage without pointing to a problematic storyboard element, see the section on PS messages for semi-processing.
The current answer almost gets it, but the problem is not that font styles are not available for old purposes, but with Xcode that doesn't handle them properly, see the full blog post for more details.
If you want to keep your styles, use a custom text field with a custom property to check. Open the IDC inspector and set your own class in TextField, the preferred font weight attribute will appear in the attribute inspector, set the required value, build and get the result.
import AppKit @IBDesignable public class TextField: NSTextField { @IBInspectable public var preferredFontWeight: Int = 0 override public func awakeFromNib() { if #available(OSX 10.11, *) { return } guard let weight: Int = self.preferredFontWeight where weight > 0, let font: NSFont = self.font, let name: String = font.familyName, let manager: NSFontManager = NSFontManager.sharedFontManager() else { return } // Full details here β https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSFontManager_Class/#//apple_ref/occ/instm/NSFontManager/convertWeight:ofFont: // // 1 β ultralight // 2 β thin // 3 β light, extralight // 4 β book // 5 β regular, display // 6 β medium // 7 β demi, demibold // 8 β semi, semibold // 9 β bold // 10 β extra, extrabold // 11 β heavy // 12 β black // 13 β ultrablack // 14 β extrablack if let font: NSFont = manager.fontWithFamily(name, traits: manager.traitsOfFont(font), weight: weight, size: font.pointSize) { self.font = font } } }
If you donβt like the styles, use a regular font for all the text, it should solve the problem, see my previous answer for the available options.
Ian bytchek
source share