ios - Put UIView fixed on a UITableViewController -
i'm new in ios app development , i'm trying put uiview fixed on top of uitableviewcontroller (like header). i'm facing difficulties swift syntax. searching solution, found usage of function scrollviewdidscroll, that:
-(void)scrollviewdidscroll:(uiscrollview *)scrollview { cgrect fixedframe = self.uitopview.frame; fixedframe.origin.y = 0 + scrollview.contentoffset.y; self.menuviewrelative.frame = fixedframe; }
this not work due wrong syntax. so, did that:
override func scrollviewdidscroll (scrollview: uiscrollview) { cgrect fixedframe = self.uitopview.frame; fixedframe.origin.y = 0 + scrollview.contentoffset.y; self.menuviewrelative.frame = fixedframe; }
however i'm getting error on cgrect code line: "consecutive statements on line must separated ;". said, i'm new in ios development, , can't figure out wrong syntax. me?
so in swift declare variable keywords var or let.
override func scrollviewdidscroll (scrollview: uiscrollview) { var fixedframe = self.uitopview.frame; fixedframe.origin.y = 0 + scrollview.contentoffset.y; self.menuviewrelative.frame = fixedframe; }
hope helps.
Comments
Post a Comment