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
extension String { | |
func height(withConstrainedWidth width: CGFloat, font: UIFont) -> CGFloat { | |
let constraintRect = CGSize(width: width, height: .greatestFiniteMagnitude) | |
let boundingBox = self.boundingRect(with: constraintRect, options: .usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font: font], context: nil) | |
return ceil(boundingBox.height) | |
} | |
func width(withConstrainedHeight height: CGFloat, font: UIFont) -> CGFloat { | |
let constraintRect = CGSize(width: .greatestFiniteMagnitude, height: height) |
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
parsers: | |
- url: https://example.com/example.yaml | |
code: | | |
module.exports.parse = (raw, { yaml }) => { | |
const rawObj = yaml.parse(raw) | |
const { 'Rule': rules = [], 'Proxy Group':groups = [], 'Proxy': proxies = [] } = rawObj | |
delete rawObj['Rule'] | |
delete rawObj['Proxy Group'] | |
delete rawObj['Proxy'] | |
return yaml.stringify({ ...rawObj, proxies, 'proxy-groups': groups, rules }) |
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
/usr/bin/xcrun xcodebuild -workspace /Users/mac/Desktop/gittub/Water/Carthage/Checkouts/Kingfisher/Kingfisher.xcworkspace -scheme Kingfisher -configuration Release -derivedDataPath /Users/mac/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/Kingfisher/5.2.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/sj/1pkf32d51sv12qw8mfr9rgcw0000gn/T/Kingfisher SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/mac/Desktop/gittub/Water/Carthage/Checkouts/Kingfisher)2019-03-14 15:47:09.696 xcodebuild[28808:36902155] WARNING: Failed to load plugin at path: "/Users/mac/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XVim2.xcplugin", skipping. Error: Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/Users/mac/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XVim2.xcplugin/Contents/MacOS/XVim2): no suitable image found. |
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
//第一种 | |
UITextField *textField = [[UITextField alloc] init]; | |
NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:@"请输入占位文字" | |
attributes:@{NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:textField.font}]; | |
textField.attributedPlaceholder = attrString; | |
//第二种 | |
UITextField *textField1 = [[UITextField alloc] init]; | |
textField1.placeholder = @"请输入占位文字"; | |
textField1.font = [UIFont systemFontOfSize:14]; |
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
hello gist |