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
// | |
// NSLayoutConstraint+StandardMetrics.swift | |
// | |
// Created by Ryan Poolos on 4/22/15. | |
// Copyright (c) 2015 Frozen Fire Studios, Inc. All rights reserved. | |
// | |
import UIKit | |
extension Double { |
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
- (UILabel *)titleLabel | |
{ | |
if (!_titleLabel) { | |
CGFloat width = CGRectGetMinX(_detailLabel.frame); | |
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, width, CGRectGetHeight(self.infoView.bounds))]; | |
[self.infoView addSubview:_titleLabel]; | |
} | |
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
- (id)initWithProperty:(id)property | |
{ | |
self = [super init]; | |
if (self) { | |
self.property = property; | |
} | |
return self; | |
} | |
- (id)initWithProperty:(id)property otherProperty:(id)otherProperty |
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
// By Erik Andersson | |
// Please help with this method to bring support for more UILineBreakModes and text alignment | |
@implementation UILabel (Fix) | |
- (CGRect)rectForLetterAtIndex:(NSUInteger)index | |
{ | |
NSAssert(self.lineBreakMode != UILineBreakModeClip, @"UILabel.lineBreakMode cannot be UILineBreakModeClip to calculate the rect of a character. You might think that it's possible, seeing as UILineBreakModeWordWrap is supported, and they are almost the same. But the semantics are weird. Sorry."); | |
NSAssert(self.lineBreakMode != UILineBreakModeHeadTruncation, @"UILabel.lineBreakMode cannot be UILineBreakModeHeadTruncation to calculate the rect of a character. We can't have everything you know."); | |
NSAssert(self.lineBreakMode != UILineBreakModeMiddleTruncation, @"UILabel.lineBreakMode cannot be UILineBreakModeMiddleTruncation to calculate the rect of a character. We can't have everything you know."); |