Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class data{
- static var products=[
- "grills":[
- "X5 - RED":["grill x5 red","2990"],
- "spider":["grill spider","3290"]
- ],
- "acoAreas":[
- "Pleasure":["pleasure","7990"],
- "Toscana":["toscana","8900"],
- "Vioal":["viola","8900"]
- ]
- ];
- }
- Array(data.products["grills"]!.keys)//Array of all grills
- Array(data.products["acoAreas"]!.keys)//Array of all acoAreas
- //first check - calling instance method within initializer
- class Elad{
- init(){
- doSome();//works fine ;-)
- }
- func doSome(){
- print("Doing some");
- }
- }
- //second check - calling super's initializer & instance method
- class A {
- init(must:Int){}
- }
- class B: A {
- init(){
- super.init(must: 1);
- doSome();//also works just in Java ;-)
- }
- func doSome(){}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement