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
@interface MyObject : NsObject | |
//1 | |
- (instancetype)initWithTheOtherObjectDoingSomethingElse:(MyOtherObject *)alreadyExisitingObject isNightModeOn:(BOOL)isNightMode NS_DESIGNATED_INITIALIZER; | |
/** | |
Removing the default initalize | |
*/ | |
- ( instancetype)init NS_UNAVAILABLE; |
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
@interface MyObject() | |
@property (nonatomic) BOOL isNightMode | |
@property (strong, nonatomic) MyOtherObject *theObjectDoingSomethingElse | |
@end | |
@implementation MyObject | |
#pragma mark - Initializers | |
//2 | |
- (instancetype)initWithTheOtherObjectDoingSomethingElse:(MyOtherObject *)alreadyExisitingObject isNightModeOn:(BOOL)isNightMode { |
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
@interface MyObject : NsObject | |
//1 | |
- (instancetype)initWithTheOtherObjectDoingSomethingElse:(MyOtherObject *)alreadyExisitingObject isNightModeOn:(BOOL)isNightMode NS_DESIGNATED_INITIALIZER; | |
/** | |
Removing the default initalizer | |
*/ | |
- (nullable instancetype)init NS_UNAVAILABLE; | |
@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
MyObject *myObject =[[MyObject alloc] initWithTheOtherObjectDoingSomethingElse:alreadyExisitingObject | |
isNightModeOn:isNightMode]; |
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
MyObject *myObject =[[MyObject alloc] init]; | |
myObject.isNightMode = YES; | |
myObject.theObjectDoingSomethingElse = alreadyExisitingObject; |
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 <XCTest/XCTest.h> | |
#import "PMODownloader.h" | |
#import "PMODownloadNotifications.h" | |
@interface PMODownloaderTests : XCTestCase | |
@property (strong, nonatomic) PMODownloader *downloader; | |
@end | |
@implementation PMODownloaderTests |
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 <XCTest/XCTest.h> | |
#import "PMOPictureController.h" | |
#import "PMODownloadNotifications.h" | |
@interface PMOPictureControllerTests : XCTestCase | |
@property (strong, nonatomic) PMOPictureController *pictureController; | |
@end | |
@implementation PMOPictureControllerTests |
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 "PMODownloader.h" | |
#import "PMODownloadNotifications.h" | |
@implementation PMODownloader | |
//1 | |
@synthesize receiver = _receiver; | |
//2 | |
#pragma mark - Public API / Protocol implementation |
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> | |
//1 | |
#import "PMODownloaderFromURL.h" | |
//2 | |
@interface PMODownloader : NSObject <PMODownloaderFromURL> | |
/** | |
Property to store the downloaded data in NSData format | |
*/ |
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 "PMOPictureController.h" | |
#import "PMODownloader.h" | |
#import "PMOPictureWithURL.h" | |
#import "PMODownloadNotifications.h" | |
@interface PMOPictureController() | |
/** | |
Our private data class, storing and hiding the information. |