// same with each other
NS_AVAILABLE_IOS(10.0)
__IOS_AVAILABLE(10.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
// see my comments |
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. Use openssl | |
openssl smime -in /path/to/your.mobileprovision -inform der -verify | |
2. Use security command | |
security cms -Di /path/to/your.mobileprovision |
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
#!/bin/zsh | |
# 必须用 zsh,否则后面的数组操作可能失败 | |
# 需要编译的 scheme,可以改为你自己的,或者给脚本传递 -s 参数 | |
scheme="T4" | |
configuration=Release | |
usesFramework=1 # 是否以 framework 为容器。framework 装的也可能是静态库 |
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
protocol MakeSelf { | |
init() | |
} | |
class MS: MakeSelf { | |
static let shared = MS() | |
required init() { | |
// | |
} | |
} |
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 | |
// MARK: - FindHostView | |
protocol FindHostView { | |
associatedtype T | |
var hostView: T? { get } | |
} |
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
copy these files from Xcode 9 to Xcode 10 like this: | |
1. copy stdc++*.tbd to | |
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/ | |
2. copy stdc++*.dylib to | |
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/ |
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
// in header file | |
extern struct LALIMtopAPI { | |
__unsafe_unretained NSString *logout; | |
__unsafe_unretained NSString *login; | |
} const kLALIMtopAPI; | |
// implementation file |
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
textView.attributedText = originalContent | |
let lineLimit = 5 | |
textView.isEditable = true | |
textView.isScrollEnabled = false | |
// eliminate inner paddings, when right is minus number, it seems useless. | |
// textView.contentInset = UIEdgeInsets(top: 0, left: -5, bottom: 0, right: 0) | |
textView.textContainer.lineFragmentPadding = 0; // better way | |
textView.textContainerInset = .zero // default is (8, 0, 8, 0) | |
textView.textContainer.maximumNumberOfLines = lineLimit // Important condition |
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. 多行文本 | |
let label = UILabel() | |
label.font = Font.f14 | |
label.numberOfLines = 2 // 若此处的行数限定为0(即可无数行),则以下面的 limitedToNumberOfLines 为准;否则两个行数中较小的那个会生效 | |
label.text = model.svideoInfo.svideoTitle // 多行文本 | |
let titleRect = label.textRect(forBounds: CGRect(origin: .zero, size: CGSize(width: cellWidth - margins.xInset, height: CGFloat.greatestFiniteMagnitude)), limitedToNumberOfLines: 0) | |
// 事实上,用sizeThatFits(_:)就好了。 |
NewerOlder