1
프로젝트에 사용자 지정 글꼴을 추가하고 "번들 리소스 복사 "빌드 단계에서. 나는 또한이 PLIST 파일에 제대로 추가되었습니다 확인했다 : 프로젝트에 사용자 지정 글꼴을 추가했지만 사용하려고 할 때 "치명적인 오류가 발생합니다 : 선택 값을 래핑하는 동안 예기치 않게 nil이 발견되었습니다"
을하지만 자리 표시 자 텍스트에 대한 기능을 설정할 때 다음에 대한
fatal error: unexpectedly found nil while unwrapping an Optional value
:
let attributes = [
NSForegroundColorAttributeName: UIColor.white,
NSFontAttributeName : UIFont(name: "NeutraText-Bold", size: 17)!
]
func placeHolder(_ text: String) -> (NSAttributedString){
return NSAttributedString(string: text, attributes:attributes)
}
signUpTextField.attributedPlaceholder = placeHolder("Sign Up")
을 나는 오류 line
NSFontAttributeName : UIFont(name: "NeutraText-Bold", size: 17)!
모든 글꼴 이름을 인쇄 할 수 있습니까? http://stackoverflow.com/questions/33891959/available-fonts-on-ios 당신의 글꼴이 앱에 올바르게 추가되었는지 확인하고 실제로 사용할 실제 이름을 제공하는 데 도움이됩니다 (실제로 포스트 스크립트 이름). 글꼴은 "상업용 글꼴"과 다를 수 있음). – Larme
인쇄 할 때 목록에 나타나지 않습니다. 그 이유는 무엇입니까? – SwiftyJD
거기에서 모든 단계를 확인하십시오 : http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/? – Larme