ios - EXC_BAD_ACCESS with viewWillTransitionToSize and Xcode 6.3 -
this code used work in our today extension, exc_bad_access using xcode 6.3. new problem?
override func viewwilltransitiontosize(size: cgsize, withtransitioncoordinator coordinator: uiviewcontrollertransitioncoordinator) { coordinator.animatealongsidetransition({ context in self.tableview.frame = cgrectmake(0, 0, size.width, size.height) }, completion: nil) }
someone mentioned me think apple bug. here's workaround (or solution):
override func viewwilltransitiontosize(size: cgsize, withtransitioncoordinator coordinator: uiviewcontrollertransitioncoordinator) { super.viewwilltransitiontosize(size, withtransitioncoordinator: coordinator) if let safecoordinator = coordinator uiviewcontrollertransitioncoordinator? { println("coordinator != nil") safecoordinator.animatealongsidetransition({ context in self.tableview.frame = cgrectmake(0, 0, size.width, size.height) }, completion: nil) } else { println("coordinator == nil") } }
Comments
Post a Comment