Skip to content

Instantly share code, notes, and snippets.

@haruair
Created November 29, 2016 05:23
Show Gist options
  • Save haruair/6ff87b156106bba8b2e993b3eeedf851 to your computer and use it in GitHub Desktop.
Save haruair/6ff87b156106bba8b2e993b3eeedf851 to your computer and use it in GitHub Desktop.
비스무리하게 구현하면
class DefaultLayout : Layout {
let definitions = [
Definition(PickButton.self, BottomButtonRepresentation.self),
Definition(CameraView.self, FullScreenRepresentation.self),
Definition(OverlayFlashView.self, FullScreenRepresentation.self),
]
}
class Definition {
var elementType : Any?
var representationType : Any?
init (_ ele: Any, _ rep: Any) {
if ele is UIView {
elementType = ele
} else {
print("Error")
return
}
if rep is Representation {
representationType = rep
} else {
print("Error")
return
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment