@@ -10,7 +10,7 @@ import UIKit
1010import  Foundation
1111
1212
13- public  class  AppData  :  NSObject 
13+ open  class  AppData  :  NSObject 
1414{ 
1515    var  client =  JsonServiceClient ( baseUrl:  " http://techstacks.io " ) 
1616
@@ -21,20 +21,20 @@ public class AppData : NSObject
2121        static  let  AllTechnologyStacks =  " allTechnologyStacks " 
2222    } 
2323
24-     public  dynamic  var  allTiers : [ Option ]  =  [ ] 
24+     open  dynamic  var  allTiers : [ Option ]  =  [ ] 
2525
26-     public  dynamic  var  overview : AppOverviewResponse  =  AppOverviewResponse ( ) 
27-     public  dynamic  var  topTechnologies : [ TechnologyInfo ]  =  [ ] 
26+     open  dynamic  var  overview : AppOverviewResponse  =  AppOverviewResponse ( ) 
27+     open  dynamic  var  topTechnologies : [ TechnologyInfo ]  =  [ ] 
2828
29-     public  dynamic  var  allTechnologies : [ Technology ]  =  [ ] 
30-     public  dynamic  var  allTechnologyStacks : [ TechnologyStack ]  =  [ ] 
29+     open  dynamic  var  allTechnologies : [ Technology ]  =  [ ] 
30+     open  dynamic  var  allTechnologyStacks : [ TechnologyStack ]  =  [ ] 
3131
32-     public  dynamic  var  search : String ? 
33-     public  dynamic  var  filteredTechStacks : [ TechnologyStack ]  =  [ ] 
34-     public  dynamic  var  filteredTechnologies : [ Technology ]  =  [ ] 
32+     open  dynamic  var  search : String ? 
33+     open  dynamic  var  filteredTechStacks : [ TechnologyStack ]  =  [ ] 
34+     open  dynamic  var  filteredTechnologies : [ Technology ]  =  [ ] 
3535
36-     public  var  technologyStackCache : [ String : GetTechnologyStackResponse ]  =  [ : ] 
37-     public  var  technologyCache : [ String : GetTechnologyResponse ]  =  [ : ] 
36+     open  var  technologyStackCache : [ String : GetTechnologyStackResponse ]  =  [ : ] 
37+     open  var  technologyCache : [ String : GetTechnologyResponse ]  =  [ : ] 
3838
3939    override init ( ) { 
4040        super. init ( ) 
@@ -67,7 +67,7 @@ public class AppData : NSObject
6767            } 
6868    } 
6969
70-     func  loadTechnologyStack( slug: String )  ->  Promise < GetTechnologyStackResponse >  { 
70+     func  loadTechnologyStack( _  slug: String )  ->  Promise < GetTechnologyStackResponse >  { 
7171        if  let  response =  technologyStackCache [ slug]  { 
7272            return  Promise< GetTechnologyStackResponse>  {  ( complete, reject)  in  complete ( response)  } 
7373        } 
@@ -81,17 +81,17 @@ public class AppData : NSObject
8181            } 
8282    } 
8383
84-     func  searchTechStacks( query: String )  ->  Promise < FindTechStacksResponse >  { 
84+     func  searchTechStacks( _  query: String )  ->  Promise < QueryResponse < TechnologyStack > >  { 
8585        self . search =  query
8686
87-         return  client. getAsync ( FindTechStacks ( ) ,  query:  [ " NameContains " : query,  " DescriptionContains " : query] ) 
88-             . then  {  r ->  FindTechStacksResponse  in 
87+         return  client. getAsync ( FindTechStacks < TechnologyStack > ( ) ,  query:  [ " NameContains " : query,  " DescriptionContains " : query] ) 
88+             . then  {  r ->  QueryResponse < TechnologyStack >  in 
8989                self . filteredTechStacks =  r. results
9090                return  r
9191            } 
9292    } 
9393
94-     func  loadTechnology( slug: String )  ->  Promise < GetTechnologyResponse >  { 
94+     func  loadTechnology( _  slug: String )  ->  Promise < GetTechnologyResponse >  { 
9595        if  let  response =  technologyCache [ slug]  { 
9696            return  Promise< GetTechnologyResponse>  {  ( complete, reject)  in  complete ( response)  } 
9797        } 
@@ -105,11 +105,11 @@ public class AppData : NSObject
105105            } 
106106    } 
107107
108-     func  searchTechnologies( query: String )  ->  Promise < FindTechnologiesResponse >  { 
108+     func  searchTechnologies( _  query: String )  ->  Promise < QueryResponse < Technology > >  { 
109109        self . search =  query
110110
111-         return  client. getAsync ( FindTechnologies ( ) ,  query: [ " NameContains " : query,  " DescriptionContains " : query] ) 
112-             . then  {  r ->  FindTechnologiesResponse  in 
111+         return  client. getAsync ( FindTechnologies < Technology > ( ) ,  query: [ " NameContains " : query,  " DescriptionContains " : query] ) 
112+             . then  {  r ->  QueryResponse < Technology >  in 
113113                self . filteredTechnologies =  r. results
114114                return  r
115115            } 
@@ -119,12 +119,12 @@ public class AppData : NSObject
119119    func  loadDefaultImageCaches( )  { 
120120        imageCache [ " stacks " ]  =  UIImage ( named:  " stacks " ) 
121121
122-         UIGraphicsBeginImageContextWithOptions ( CGSizeMake ( 858 ,  689 ) ,  false ,  0.0 ) 
122+         UIGraphicsBeginImageContextWithOptions ( CGSize ( width :   858 ,  height :  689 ) ,  false ,  0.0 ) 
123123        imageCache [ " blankScreenshot " ]  =  UIGraphicsGetImageFromCurrentImageContext ( ) 
124124        UIGraphicsEndImageContext ( ) 
125125    } 
126126
127-     public  func  loadAllImagesAsync( urls: [ String ] )  ->  Promise < [ String : UIImage ? ] >  { 
127+     open  func  loadAllImagesAsync( _  urls: [ String ] )  ->  Promise < [ String : UIImage ? ] >  { 
128128        var  images  =  [ String: UIImage? ] ( ) 
129129        return  Promise< [ String: UIImage? ] >  {  ( complete,  reject)  in 
130130            for  url  in  urls { 
@@ -139,13 +139,13 @@ public class AppData : NSObject
139139        } 
140140    } 
141141
142-     public  func  loadImageAsync( url: String )  ->  Promise < UIImage ? >  { 
142+     open  func  loadImageAsync( _  url: String )  ->  Promise < UIImage ? >  { 
143143        if  let  image =  imageCache [ url]  { 
144144            return  Promise< UIImage?>  {  ( complete,  reject)  in  complete ( image)  } 
145145        } 
146146
147147        return  client. getDataAsync ( url) 
148-             . then  {  ( data: NSData )  ->  UIImage ? in 
148+             . then  {  ( data: Data )  ->  UIImage ? in 
149149                if  let  image =  UIImage ( data: data)  { 
150150                    self . imageCache [ url]  =  image
151151                    return  image
@@ -156,23 +156,23 @@ public class AppData : NSObject
156156
157157    /* KVO Observable helpers */
158158    var  observedProperties =  [ NSObject: [ String] ] ( ) 
159-     var  ctx : AnyObject  =  1 
159+     var  ctx : AnyObject  =  1   as   AnyObject 
160160
161-     public  func  observe( observer:  NSObject ,  properties: [ String ] )  { 
161+     open  func  observe( _  observer:  NSObject ,  properties: [ String ] )  { 
162162        for  property  in  properties { 
163163            self . observe ( observer,  property:  property) 
164164        } 
165165    } 
166166
167-     public  func  observe( observer:  NSObject ,  property: String )  { 
168-         self . addObserver ( observer,  forKeyPath:  property,  options:  [ . New  ,  . Old ] ,  context:  & ctx) 
167+     open  func  observe( _  observer:  NSObject ,  property: String )  { 
168+         self . addObserver ( observer,  forKeyPath:  property,  options:  [ . new  ,  . old ] ,  context:  & ctx) 
169169
170170        var  properties  =  observedProperties [ observer]  ??  [ String] ( ) 
171171        properties. append ( property) 
172172        observedProperties [ observer]  =  properties
173173    } 
174174
175-     public  func  unobserve( observer:  NSObject )  { 
175+     open  func  unobserve( _  observer:  NSObject )  { 
176176        if  let  properties =  observedProperties [ observer]  { 
177177            for  property  in  properties { 
178178                self . removeObserver ( observer,  forKeyPath:  property,  context:  & ctx) 
0 commit comments