ios - How to save the properties of UILable in UIView in swift? -
import uikit
class aboutview: uiview{
@iboutlet var aboutview: uiview! @iboutlet weak var studiotxt: uilabel! @iboutlet weak var closebtn: uibutton! var studiotxtto : cgfloat override init(frame: cgrect) { super.init(frame: frame) initializeviews() } required init?(coder adecoder: nscoder) { super.init(coder: adecoder) initializeviews() } private func initializeviews(){ bundle.main.loadnibnamed("aboutview", owner: self) addsubview(aboutview) studiotxtto = self.studiotxt.frame.origin.y self.studiotxt.frame.origin.y = self.studiotxt.frame.origin.y + 55 } @ibaction func onin(_ sender: any) { in() } func in(){ uiview.animate(withduration: 0.5, delay: 0, usingspringwithdamping: 0.7, initialspringvelocity: 0.0, options: .curveeaseinout, animations: { self.studiotxt.frame.origin.y = self.studiotxtto }, completion: { _ in // }) }
}
i need save origin y peropertie of label create animation, error in super.init(frame: frame) , super.init(coder: adecoder) studiotxtto
you need provide initial value studiotxtto, example change definition to:
var studiotxtto : cgfloat = 0.0
Comments
Post a Comment