This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | iMac-Apps:UUUPS alex$ ls *.h | |
| Bridge.h | |
| iMac-Apps:UUUPS alex$ pwd | |
| /Users/alex/Projects RW/iOS/UUUPS/UUUPS | |
| iMac-Apps:UUUPS alex$ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
| UIApplication.sharedApplication().statusBarStyle = .LightContent | |
| return true | |
| } | |
| Inside a VC | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| setNeedsStatusBarAppearanceUpdate() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class ListCommentsCells: UITableViewCell { | |
| @IBOutlet weak var tableView: UITableView! | |
| var comments: [Comment]? { | |
| didSet { | |
| println("WHEN SETTING COUNT HERE \(comments?.count)") | |
| tableView.reloadData() | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | extension MainViewController: UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { | |
| func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { | |
| let friend:Friend? = friends[indexPath.row] | |
| var cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as UserCell | |
| cell.setInitial(friend: friend) | |
| return cell | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | if friend.photo != nil { | |
| userImageView.image = UIImage(data: friend.photo) | |
| } | |
| Model.updateChangingFriend(friend, completion: { (displayName, image) -> () in | |
| println("\(UIImageJPEGRepresentation(image, 1).length) y \(UIImageJPEGRepresentation(self.userImageView.image, 1).length) ") | |
| dispatch_async(dispatch_get_main_queue(), { () -> Void in | |
| self.userImageView.image = image //TODO WTF? | |
| }) | |
| }) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Model.updateImage(friend, completion: { (image) -> () in | |
| println("\(UIImageJPEGRepresentation(image, 1).length) y \(UIImageJPEGRepresentation(self.userImageView.image, 1).length) ") | |
| dispatch_async(dispatch_get_main_queue(), { () -> Void in | |
| //self.userImageView.image = image //TODO WTF? | |
| }) | |
| }) | |
| So in my console if i remove the comment of the #4 line i get in my three cells: | |
| 241191 y 241191 | |
| 298551 y 298551 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class func getCenterWithId(id: Int?) -> Center? { | |
| let level = (model?.centers.filter() { $0.id == id })?.first? | |
| if level == nil { | |
| println("Error, could not find level with id!") | |
| return nil | |
| } | |
| return level | |
| } | |
| class func getFamilyWithId(id: Int?) -> Family? { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class Incident { | |
| var idIncident: Int | |
| var title: String | |
| var description: String | |
| var familyId: Int | |
| var cancelationCause: String | |
| var cancelationDate: String | |
| var levelId: Int | |
| var statusId: Int | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import Foundation | |
| import CoreData | |
| class Friend: NSManagedObject { | |
| @NSManaged var currentUsername: String! | |
| @NSManaged var displayName: String! | |
| @NSManaged var photo: NSData! | |
| @NSManaged var username: String! | |
| @NSManaged var messages: NSOrderedSet | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @objc protocol ModelProtocol { | |
| class func getById<A>(id: Int) -> A | |
| } | |
| class Class1: ModelProtocol { | |
| class func getById<A>(id: Int) -> A { | |
| return Class1() | |
| } | |
| } |