I originally asked this question. I had assumed that the reason for the slow load time of my custom view was because of layering multiple views on top of each other or perha
downloaded your code from github, why don't you just write a subclass of UITextView instead of the UIView?
//
// UIMongolTextView-A.swift
// Mongol App Componants
//
// Created by Allen Zhang on 12/13/15.
// Copyright © 2015 MongolSuragch. All rights reserved.
//
import UIKit
class UIMongolTextView_A: UITextView {
override func awakeFromNib() {
super.awakeFromNib()
self.setup()
}
func setup() {
// 1-10: ᠨᠢᠭᠡ ᠬᠤᠶᠠᠷ ᠭᠤᠷᠪᠠ ᠳᠦᠷᠪᠡ ᠲᠠᠪᠤ ᠵᠢᠷᠭᠤᠭᠠ ᠳᠤᠯᠤᠭᠠ ᠨᠠᠢ᠌ᠮᠠ ᠶᠢᠰᠦ ᠠᠷᠪᠠ
self.transform = translateRotateFlip()
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func drawRect(rect: CGRect) {
// Drawing code
}
*/
func translateRotateFlip() -> CGAffineTransform {
var transform = CGAffineTransformIdentity
// translate to new center
transform = CGAffineTransformTranslate(transform, (self.bounds.width / 2)-(self.bounds.height / 2), (self.bounds.height / 2)-(self.bounds.width / 2))
// rotate counterclockwise around center
transform = CGAffineTransformRotate(transform, CGFloat(-M_PI_2))
// flip vertically
transform = CGAffineTransformScale(transform, -1, 1)
return transform
}
}