I would like to create text overlay on my images. The problem is that if you try to add a second text, such as a subtitle, it ignores my font size.
titleLayer.frame = CGRectMake(0, 80, imageView.bounds.width, 50) subTitleLayer.frame = CGRectMake(0, 130, imageView.bounds.width, 40) titleLayer.string = "Title" subTitleLayer.string = "Subtitle" let fontName: CFStringRef = "HelveticaNeue" let fontSubName: CFStringRef = "HelveticaNeue-Thin" titleLayer.font = CTFontCreateWithName(fontName, 16, nil) subTitleLayer.font = CTFontCreateWithName(fontSubName, 10, nil)
The new font is correct, but it is always the same size (16) as the titleFont. How to change the font size?
source share