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
| self.tableView.tableFooterView = UIView(frame: CGRect.zero) |
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
| @interface ChildClass : NSObject | |
| - (NSInteger)read; | |
| @end | |
| // *.h | |
| @interface MyDecorator : NSObject | |
| + (instancetype)decoratedInstanceOf:(ChildClass *)instance; | |
| @end | |
| // *.m |
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
| - (NSArray *)arrayFromObjectsCollectedWithBlock:(id(^)(id object))block | |
| { | |
| __block NSMutableArray *collection = [NSMutableArray arrayWithCapacity:[self count]]; | |
| [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { | |
| [collection addObject:block(obj)]; | |
| }]; | |
| return collection; | |
| } |
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
| struct APTestCase { | |
| let studentsNumber: Int! | |
| let cancelTreshold: Int! | |
| } | |
| func parsedRowTestCase(stringInput: String!) -> APTestCase { | |
| let spaceStartIndex = stringInput.rangeOfString(" ")!.startIndex | |
| let studentsNumber = Int(stringInput.substringWithRange(stringInput.startIndex..<spaceStartIndex)) | |
| let cancelTreshold = Int(stringInput.substringWithRange(spaceStartIndex.advancedBy(1)..<stringInput.endIndex)) |
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
| let xConstraint = NSLayoutConstraint(item: activity, attribute: .CenterX, relatedBy: .Equal, toItem: view, attribute: .CenterX, multiplier: 1.0, constant: 0) | |
| let yConstraint = NSLayoutConstraint(item: activity, attribute: .CenterY, relatedBy: .Equal, toItem: view, attribute: .CenterY, multiplier: 1.0, constant: 0) | |
| let widthConstraint = NSLayoutConstraint(item: activity, attribute: .Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1.0, constant: 100) | |
| let heightConstraint = NSLayoutConstraint(item: activity, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .Height, multiplier: 1.0, constant: 100) |
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
| let rotation = CATransform3DMakeRotation(CGFloat(45.0 * M_PI / 180.0), 0, 0, 1) | |
| leftSquare.transform = CATransform3DTranslate(rotation, 0, 0, 1) |
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
| NSArray *horizontalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[superview]-(<=1)-[label]" options:NSLayoutFormatAlignAllCenterX metrics:nil views:@{@"superview": self, @"label" : self.timeLabel}]; | |
| NSArray *verticalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[superview]-(<=1)-[label]" options: NSLayoutFormatAlignAllCenterY metrics: nil views:@{@"superview": self, @"label" : self.timeLabel}]; |
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
| [view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[stackView]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(stackView)]]; | |
| [view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[stackView]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(stackView)]]; |
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
| # Xcode | |
| # | |
| # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore | |
| ## Build generated | |
| build/ | |
| DerivedData/ | |
| ## Various settings | |
| *.pbxuser |
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
| <key>NSAppTransportSecurity</key> | |
| <dict> | |
| <key>NSAllowsArbitraryLoads</key> | |
| <true/> | |
| </dict> |