I'm new to Swift, come from Obj-C
I'm looking at the net, but to no avail ....
Obj-C in my project I created a class UIView (served as a notification that appeared red from the bottom) with a custom instancetype because through this allocavo the UIView directly in viewController with the parameters that I was interested .. Now I can not absolutely to create the translation of my code in Obj-C swift was trying to find a tutorial or something visual that I could figure out how to create a class with swift UIView without using a xib ...
Does anyone know any tutorial or example of class UIView without XIB in Swift?
My problem is that when I insert this custom init
init (title:String, message:String) {
// init
}
first of all it returns an error because the compiler wants this also included
required init (coder aDecoder: NSCoder) {
super.init (coder: aDecoder)
}
My first question is this:
initWithCoder in obj-c was used only if my custom view was inserted in the storyboard ...
however in my case I would call all my custom view, in my view controller, through a simple line of code as I did in obj-c and that I was not allowed in because obj-c I used a custom instancetype without specifying them a initWithCoder it initWithFrame
I can not understand how this thing