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 UIKit | |
// Line Height ---------------------------------------- | |
let label = UILabel(frame: CGRectMake(0, 0, 300, 100)) | |
label.numberOfLines = 0 | |
label.text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." | |
label // Raw | |
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 "UIView+TDKUtil.h" | |
@implementation UIView (TDKUtil) | |
- (void)maskByRoundingCorners:(UIRectCorner)corners | |
cornerRadius:(CGFloat)cornerRadius | |
{ | |
[self layoutIfNeeded]; | |
UIBezierPath *maskPath; |
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 "UILabel+TDKUtil.h" | |
@implementation UILabel (TDKUtil) | |
- (void)setLineHeightMultiple:(CGFloat)lineHeightMultiple | |
{ | |
NSMutableAttributedString *attributedString = [self.attributedText mutableCopy]; | |
NSMutableParagraphStyle *paragrahStyle = [NSMutableParagraphStyle new]; | |
paragrahStyle.lineHeightMultiple = lineHeightMultiple; |
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
(defun git-top-directory () | |
(file-name-as-directory | |
(replace-regexp-in-string | |
"\n" "" | |
(shell-command-to-string "git rev-parse --show-toplevel")))) | |
(defun open-current-git-top-directory-in-tmux-new-pane () | |
(interactive) | |
(let ((top-dir (git-top-directory))) | |
(unless (file-directory-p top-dir) |