Advertisement
NikitaKurtin

Untitled

Jan 10th, 2016
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.79 KB | None | 0 0
  1. class data{
  2.     static var products=[
  3.         "grills":[
  4.             "X5 - RED":["grill x5 red","2990"],
  5.             "spider":["grill spider","3290"]
  6.         ],
  7.         "acoAreas":[
  8.             "Pleasure":["pleasure","7990"],
  9.             "Toscana":["toscana","8900"],
  10.             "Vioal":["viola","8900"]
  11.         ]
  12.     ];
  13. }
  14.  
  15. Array(data.products["grills"]!.keys)//Array of all grills
  16. Array(data.products["acoAreas"]!.keys)//Array of all acoAreas
  17.  
  18.  
  19. //first check - calling instance method within initializer
  20. class Elad{
  21.     init(){
  22.         doSome();//works fine ;-)
  23.     }
  24.     func doSome(){
  25.         print("Doing some");
  26.     }
  27. }
  28. //second check - calling super's initializer & instance method
  29. class A {
  30.     init(must:Int){}
  31. }
  32. class B: A {
  33.     init(){
  34.         super.init(must: 1);
  35.         doSome();//also works just in Java ;-)
  36.     }
  37.     func doSome(){}
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement