master 永远处于稳定状态,这个分支代码可以随时用来部署。不允许在该分支直接提交代码。
开发分支,包含了项目最新的功能和代码,所有开发都在 develop 上进行。一般情况下小的修改直接在这个分支上提交代码。
dispatch_semaphore_t semaphore = dispatch_semaphore_create(1); | |
// Then in some loop ... | |
if(dispatch_semaphore_wait(semaphore, DISPATCH_TIME_NOW) == 0) { | |
dispatch_async(queue, ^{ | |
// Some code that needs to run but doesn't need to fill up the queue. | |
// | |
dispatch_semaphore_signal(semaphore); | |
}); |
public struct Distance :NumericType { | |
public var value :Double | |
public init(_ value: Double) { | |
self.value = value | |
} | |
} | |
extension Distance :IntegerLiteralConvertible { | |
public init(integerLiteral: IntegerLiteralType) { | |
self.init(Double(integerLiteral)) |
protocol LoginProvider { | |
func login() | |
} | |
class EmailLoginProvider: LoginProvider { | |
var email: String | |
var password: String | |
init(email: String, password: String) { | |
self.email = email | |
self.password = password |
// | |
// LoadImage.h | |
// AssetsFromPDF | |
// | |
// Created by Jeffrey Sambells on 2012-03-02. | |
// | |
#import <Foundation/Foundation.h> | |
@interface LoadImage : NSObject |
import Foundation | |
import WebKit | |
typealias ClosureType = @convention(c) (Any, Selector, UnsafeRawPointer, Bool, Bool, Bool, Any?) -> Void | |
extension WKWebView{ | |
var keyboardDisplayRequiresUserAction: Bool? { | |
get { | |
return self.keyboardDisplayRequiresUserAction | |
} |
+(CGFloat)pixelToPoints:(CGFloat)px { | |
CGFloat pointsPerInch = 72.0; // see: http://en.wikipedia.org/wiki/Point%5Fsize#Current%5FDTP%5Fpoint%5Fsystem | |
CGFloat scale = 1; // We dont't use [[UIScreen mainScreen] scale] as we don't want the native pixel, we want pixels for UIFont - it does the retina scaling for us | |
float pixelPerInch; // aka dpi | |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { | |
pixelPerInch = 132 * scale; | |
} else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { | |
pixelPerInch = 163 * scale; | |
} else { | |
pixelPerInch = 160 * scale; |
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1 | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
if [ "true" == ${ALREADYINVOKED:-false} ] | |
then | |
echo "RECURSION: Detected, stopping" | |
else | |
export ALREADYINVOKED="true" |
git diff --cached --name-status | while read st file; do | |
# skip deleted files | |
if [ "$st" == 'D' ]; then continue; fi | |
# do a check only on the puppet files | |
if [[ "$file" =~ ".pp" ]]· | |
then | |
echo "syntax checking \"$file\""· | |
if ! puppet --confdir=/tmp --vardir=/tmp --parseonly --ignoreimport "$file" | |
then | |
echo "puppet syntax check failed for file: $file" |
post_install do |installer| | |
installer.project.targets.each do |target| | |
target.build_configurations.each do |config| | |
if config.name == 'BREnterprise' | |
config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = 'iPhone Distribution: The Carter Group LLC' | |
config.build_settings['PROVISIONING_PROFILE'] = '${BR_ENTERPRISE_PROVISIONING_PROFILE}' | |
end | |
end | |
end |