- Amazing talks by Andy Matushak (Controlling complexity in Swift & Making friends with value types) made her dive into value types more. Every time she made a value type she needed to subclass and she turned out using a class anyway. Then the talk about POP at WWDC 2015 happened. “Swift is protocol-oriented programming language” -Dave Abrahams.
- The power of protocols is know to most because of stuff like
UITableViewDataSource
,UITableViewDelegate
and more. These patterns are beautiful and we all love them. But at work it’s hard to suddenly transition to a new paradigm. - Reading: MVVM in Swift. MVVM is all about abstracting model, formatting and other data related things out of your ViewController. View models are very testable and clean. The view controller should keep track of the view model state. When view models are static the view controller will determine what is displayed to the user, the view m
This file contains 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
// | |
// ViewController.swift | |
// TestSwift | |
// | |
// Created by Jameson Quave on 6/2/14. | |
// Copyright (c) 2014 JQ Software LLC. All rights reserved. | |
// | |
import UIKit | |
This file contains 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/Foundation.h> | |
@interface Book : NSObject | |
{ | |
NSMutableDictionary *data; | |
} | |
@property (retain) NSString *title; | |
@property (retain) NSString *author; | |
@end |
This file contains 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
// NSString_stripHtml.h | |
// Copyright 2011 Leigh McCulloch. Released under the MIT license. | |
#import <Foundation/Foundation.h> | |
@interface NSString (stripHtml) | |
- (NSString*)stripHtml; | |
@end |
This file contains 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
// | |
// UIImage+ImageSplitting.h | |
// Test | |
// | |
// Created by Robert Saunders on 03/02/2012. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains 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
- (UIImage *)compressImage:(UIImage *)image{ | |
float actualHeight = image.size.height; | |
float actualWidth = image.size.width; | |
float maxHeight = 600.0; | |
float maxWidth = 800.0; | |
float imgRatio = actualWidth/actualHeight; | |
float maxRatio = maxWidth/maxHeight; | |
float compressionQuality = 0.5;//50 percent compression | |
if (actualHeight > maxHeight || actualWidth > maxWidth) { |
NewerOlder