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
- (void)testThatAuthOperationBlocksGeneralOperations { | |
// given | |
XCTestExpectation *expectation = [self expectationWithDescription:@"Last operation fired"]; | |
NSMutableArray *operationNames = [NSMutableArray array]; | |
NSString *const kAuthOperationName = @"AuthOperation"; | |
NSString *const kInitialOperationName = @"InitialOperation"; | |
NSString *const kGeneralOperationName = @"GeneralOperation"; | |
NSUInteger const kGeneralOperationsCount = 5; | |
__block NSNumber *operationCounter = @0; |
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
@implementation RamblerAppDelegate | |
- (NSArray *)initialAssemblies { | |
return @[[MyAssembly class]]; | |
} | |
@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
TyphoonStoryboard *storyboard = [TyphoonStoryboard storyboardWithName:name | |
factory:factory | |
bundle:bundle]; |
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
// | |
// RCTAssemblyTestsBase.h | |
// Базовый класс для тестов Assembly | |
// | |
// Created by Egor Tolstoy on 15/05/15. | |
// Copyright (c) 2015 Rambler. All rights reserved. | |
// | |
#import <XCTest/XCTest.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
// 7. Briefly discuss pixelmap image rotation algorithms and their execution times (O(*)). If you would write an image rotation algorithm, do you find anything useful in the iOS Accelerate framework? | |
- (UIImage *)rotateImage:(UIImage *)sourceImage withDegrees:(CGFloat)degrees { | |
vImage_Buffer sourceBuffer = [self bufferFromImage:sourceImage]; | |
vImage_Buffer destinationBuffer = [self newBufferForBuffer:sourceBuffer]; | |
CGFloat radians = [self radiansFromDegrees:degrees]; | |
Pixel_8 backColor = 0; | |
vImageRotate_Planar8(&sourceBuffer, &destinationBuffer, NULL, radians, backColor, 0); |
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
- (void)prepareToRecordAudio { | |
self.lowpassResults = 0.0f; | |
NSError *error; | |
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:&error]; | |
// Setup default settings for the recorder | |
self.recorder = [[AVAudioRecorder alloc] initWithURL:[self applicationDocumentsDirectory] | |
settings:@{ | |
AVFormatIDKey : @(kAudioFormatMPEG4AAC), |
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
// 4. Write a class which does HTTP request to a service in address www.idtmessaging.com and extracts the html code inside tags <head> </head> - Discuss error handling. | |
- (void)makeRequest { | |
NSString *requestUrl = @"http://www.idtmessaging.com"; | |
NSURL *url = [NSURL URLWithString:requestUrl]; | |
[NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:url] queue:[NSOperationQueue new] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { | |
if (data && !connectionError) { | |
NSString *htmlString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; | |
NSString *headString = [self obtainHeadFromHtml:htmlString]; |
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
// 3. As a part of a ToDo -list application, write the implementation for method tableView:cellForRowAtIndexPath: constructing a UITableViewCell with a text label and disclosure indicator | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier forIndexPath:indexPath]; | |
cell = [self configureCell:cell atIndexPath:indexPath]; | |
return cell; | |
} |
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
// 2. Implement a class for linked lists. At least implement methods for add and remove. | |
#import <Foundation/Foundation.h> | |
typedef struct YDLinkedListNode YDLinkedListNode; | |
// Helper method for handy list nodes creating | |
YDLinkedListNode * YDLinkedListNodeMake(id object, YDLinkedListNode *previousNode, YDLinkedListNode *nextNode); | |
struct YDLinkedListNode { |
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
// 1. Write a function which takes a string as an argument and returns the string reversed. For example, "abcdef" becomes "fedcba" | |
- (NSString *)revertString:(NSString *)initialString { | |
NSMutableString *revertedString = [[NSMutableString alloc] initWithString:@""]; | |
for (NSInteger i = initialString.length - 1; i >= 0; i--) { | |
char currentChar = [initialString characterAtIndex:i]; | |
[revertedString appendString:[NSString stringWithFormat:@"%c", currentChar]]; | |
} | |
return revertedString; | |
} |
NewerOlder