- Add (void) dismissViewControllerAnimated:(BOOL)animated completion:(void (^ _Nullable)(void))completion
This commit is contained in:
parent
7b2184a5e0
commit
60b14b37a7
@ -1,15 +1,16 @@
|
||||
PODS:
|
||||
- DGActivityIndicatorView (2.0)
|
||||
- Expecta (1.0.5)
|
||||
- Expecta+Snapshots (2.0.0):
|
||||
- Expecta+Snapshots (3.0.0):
|
||||
- Expecta (~> 1.0)
|
||||
- FBSnapshotTestCase/Core (~> 2.0.3)
|
||||
- FBSnapshotTestCase (2.0.7):
|
||||
- FBSnapshotTestCase/SwiftSupport (= 2.0.7)
|
||||
- FBSnapshotTestCase/Core (2.0.7)
|
||||
- FBSnapshotTestCase/SwiftSupport (2.0.7):
|
||||
- FBSnapshotTestCase/Core (~> 2.0)
|
||||
- Specta (~> 1.0)
|
||||
- FBSnapshotTestCase (2.1.0):
|
||||
- FBSnapshotTestCase/SwiftSupport (= 2.1.0)
|
||||
- FBSnapshotTestCase/Core (2.1.0)
|
||||
- FBSnapshotTestCase/SwiftSupport (2.1.0):
|
||||
- FBSnapshotTestCase/Core
|
||||
- PNImagePickerViewController (0.1.1):
|
||||
- PNImagePickerViewController (0.1.6):
|
||||
- DGActivityIndicatorView
|
||||
- PureLayout
|
||||
- PureLayout (3.0.1)
|
||||
@ -25,14 +26,14 @@ DEPENDENCIES:
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
PNImagePickerViewController:
|
||||
:path: "../"
|
||||
:path: ../
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
DGActivityIndicatorView: 52875b025a6ccf6a431a905285c12e2bb95eb559
|
||||
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
||||
Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba
|
||||
FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
|
||||
PNImagePickerViewController: c3059a8ce0352a54a0fcdb06b5acdc0516129fa5
|
||||
Expecta+Snapshots: c343f410c7a6392f3e22e78f94c44b6c0749a516
|
||||
FBSnapshotTestCase: 366ecd378511d7716c79991cd8067d1eed23578d
|
||||
PNImagePickerViewController: 0848e21228883cb9ed88d1acda011343874159bf
|
||||
PureLayout: f35f5384c9c4e4479df041dbe33ad7577b71ddfb
|
||||
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
//
|
||||
// EXPMatchers+FBSnapshotTest.h
|
||||
// Artsy
|
||||
//
|
||||
// Created by Daniel Doubrovkine on 1/14/14.
|
||||
// Copyright (c) 2014 Artsy Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Expecta/Expecta.h>
|
||||
#import "ExpectaObject+FBSnapshotTest.h"
|
||||
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
//
|
||||
// EXPMatchers+FBSnapshotTest.h
|
||||
// Artsy
|
||||
//
|
||||
// Created by Daniel Doubrovkine on 1/14/14.
|
||||
// Copyright (c) 2014 Artsy Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import "EXPMatchers+FBSnapshotTest.h"
|
||||
#import <Expecta/EXPMatcherHelpers.h>
|
||||
#import <FBSnapshotTestCase/FBSnapshotTestController.h>
|
||||
@ -102,11 +94,6 @@ void setGlobalReferenceImageDir(char *reference) {
|
||||
@end
|
||||
|
||||
|
||||
|
||||
// If you're bringing in Speca via CocoaPods
|
||||
// use the test path to get the test's image file URL
|
||||
|
||||
#if __has_include(<Specta/Specta.h>)
|
||||
#import <Specta/Specta.h>
|
||||
#import <Specta/SpectaUtility.h>
|
||||
#import <Specta/SPTExample.h>
|
||||
@ -130,6 +117,11 @@ NSString *sanitizedTestPath(){
|
||||
EXPMatcherImplementationBegin(haveValidSnapshot, (void)){
|
||||
__block NSError *error = nil;
|
||||
|
||||
prerequisite(^BOOL{
|
||||
return actual;
|
||||
});
|
||||
|
||||
|
||||
match(^BOOL{
|
||||
NSString *referenceImageDir = [self _getDefaultReferenceDirectory];
|
||||
NSString *name = sanitizedTestPath();
|
||||
@ -144,6 +136,10 @@ EXPMatcherImplementationBegin(haveValidSnapshot, (void)){
|
||||
});
|
||||
|
||||
failureMessageForTo(^NSString *{
|
||||
if (!actual) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Nil was passed into haveValidSnapshot." test:sanitizedTestPath() error:nil];
|
||||
}
|
||||
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"expected a matching snapshot in" test:sanitizedTestPath() error:error];
|
||||
});
|
||||
|
||||
@ -159,7 +155,7 @@ EXPMatcherImplementationBegin(recordSnapshot, (void)) {
|
||||
BOOL actualIsViewLayerOrViewController = ([actual isKindOfClass:UIView.class] || [actual isKindOfClass:CALayer.class] || [actual isKindOfClass:UIViewController.class]);
|
||||
|
||||
prerequisite(^BOOL{
|
||||
return actualIsViewLayerOrViewController;
|
||||
return actual && actualIsViewLayerOrViewController;
|
||||
});
|
||||
|
||||
match(^BOOL{
|
||||
@ -178,6 +174,10 @@ EXPMatcherImplementationBegin(recordSnapshot, (void)) {
|
||||
});
|
||||
|
||||
failureMessageForTo(^NSString *{
|
||||
if (!actual) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Nil was passed into recordSnapshot." test:sanitizedTestPath() error:nil];
|
||||
}
|
||||
|
||||
if (!actualIsViewLayerOrViewController) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Expected a View, Layer or View Controller." test:sanitizedTestPath() error:nil];
|
||||
}
|
||||
@ -198,54 +198,12 @@ EXPMatcherImplementationBegin(recordSnapshot, (void)) {
|
||||
}
|
||||
EXPMatcherImplementationEnd
|
||||
|
||||
#else
|
||||
|
||||
// If you don't have Speca stub the functions
|
||||
|
||||
EXPMatcherImplementationBegin(haveValidSnapshot, (void)){
|
||||
|
||||
prerequisite(^BOOL{
|
||||
return NO;
|
||||
});
|
||||
|
||||
failureMessageForTo(^NSString *{
|
||||
return @"you need Specta installed via CocoaPods to use haveValidSnapshot, use haveValidSnapshotNamed instead";
|
||||
});
|
||||
|
||||
failureMessageForNotTo(^NSString *{
|
||||
return @"you need Specta installed via CocoaPods to use haveValidSnapshot, use haveValidSnapshotNamed instead";
|
||||
});
|
||||
}
|
||||
EXPMatcherImplementationEnd
|
||||
|
||||
|
||||
EXPMatcherImplementationBegin(recordSnapshot, (void)) {
|
||||
|
||||
prerequisite(^BOOL{
|
||||
return NO;
|
||||
});
|
||||
|
||||
failureMessageForTo(^NSString *{
|
||||
return @"you need Specta installed via CocoaPods to use recordSnapshot, use recordSnapshotNamed instead";
|
||||
});
|
||||
|
||||
failureMessageForNotTo(^NSString *{
|
||||
return @"you need Specta installed via CocoaPods to use recordSnapshot, use recordSnapshotNamed instead";
|
||||
});
|
||||
}
|
||||
EXPMatcherImplementationEnd
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
EXPMatcherImplementationBegin(haveValidSnapshotNamed, (NSString *snapshot)){
|
||||
BOOL snapshotIsNil = (snapshot == nil);
|
||||
__block NSError *error = nil;
|
||||
|
||||
prerequisite(^BOOL{
|
||||
return !(snapshotIsNil);
|
||||
return actual && !(snapshotIsNil);
|
||||
});
|
||||
|
||||
match(^BOOL{
|
||||
@ -260,6 +218,10 @@ EXPMatcherImplementationBegin(haveValidSnapshotNamed, (NSString *snapshot)){
|
||||
});
|
||||
|
||||
failureMessageForTo(^NSString *{
|
||||
if (!actual) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Nil was passed into haveValidSnapshotNamed." test:sanitizedTestPath() error:nil];
|
||||
}
|
||||
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"expected a matching snapshot named" test:snapshot error:error];
|
||||
|
||||
});
|
||||
@ -295,6 +257,9 @@ EXPMatcherImplementationBegin(recordSnapshotNamed, (NSString *snapshot)) {
|
||||
});
|
||||
|
||||
failureMessageForTo(^NSString *{
|
||||
if (!actual) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Nil was passed into recordSnapshotNamed." test:sanitizedTestPath() error:nil];
|
||||
}
|
||||
if (!actualIsViewLayerOrViewController) {
|
||||
return [EXPExpectFBSnapshotTest combinedError:@"Expected a View, Layer or View Controller." test:snapshot error:nil];
|
||||
}
|
||||
|
||||
20
Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIApplication+StrictKeyWindow.h
generated
Normal file
20
Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIApplication+StrictKeyWindow.h
generated
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UIApplication (StrictKeyWindow)
|
||||
|
||||
/**
|
||||
@return The receiver's @c keyWindow. Raises an assertion if @c nil.
|
||||
*/
|
||||
- (UIWindow *)fb_strictKeyWindow;
|
||||
|
||||
@end
|
||||
27
Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIApplication+StrictKeyWindow.m
generated
Normal file
27
Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIApplication+StrictKeyWindow.m
generated
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <FBSnapshotTestCase/UIApplication+StrictKeyWindow.h>
|
||||
|
||||
@implementation UIApplication (StrictKeyWindow)
|
||||
|
||||
- (UIWindow *)fb_strictKeyWindow
|
||||
{
|
||||
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
|
||||
if (!keyWindow) {
|
||||
[NSException raise:@"FBSnapshotTestCaseNilKeyWindowException"
|
||||
format:@"Snapshot tests must be hosted by an application with a key window. Please ensure your test"
|
||||
" host sets up a key window at launch (either via storyboards or programmatically) and doesn't"
|
||||
" do anything to remove it while snapshot tests are running."];
|
||||
}
|
||||
return keyWindow;
|
||||
}
|
||||
|
||||
@end
|
||||
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#import <FBSnapshotTestCase/UIImage+Snapshot.h>
|
||||
#import <FBSnapshotTestCase/UIApplication+StrictKeyWindow.h>
|
||||
|
||||
@implementation UIImage (Snapshot)
|
||||
|
||||
@ -41,21 +42,31 @@
|
||||
{
|
||||
CGRect bounds = view.bounds;
|
||||
NSAssert1(CGRectGetWidth(bounds), @"Zero width for view %@", view);
|
||||
NSAssert1(CGRectGetHeight(bounds), @"Zero height for view %@", view);
|
||||
NSAssert1(CGRectGetHeight(bounds), @"Zero height for view %@", view);
|
||||
|
||||
UIWindow *window = view.window;
|
||||
if (window == nil) {
|
||||
window = [[UIWindow alloc] initWithFrame:bounds];
|
||||
[window addSubview:view];
|
||||
[window makeKeyAndVisible];
|
||||
// If the input view is already a UIWindow, then just use that. Otherwise wrap in a window.
|
||||
UIWindow *window = [view isKindOfClass:[UIWindow class]] ? (UIWindow *)view : view.window;
|
||||
BOOL removeFromSuperview = NO;
|
||||
if (!window) {
|
||||
window = [[UIApplication sharedApplication] fb_strictKeyWindow];
|
||||
}
|
||||
|
||||
|
||||
if (!view.window && view != window) {
|
||||
[window addSubview:view];
|
||||
removeFromSuperview = YES;
|
||||
}
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
|
||||
[view layoutIfNeeded];
|
||||
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
|
||||
|
||||
UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
if (removeFromSuperview) {
|
||||
[view removeFromSuperview];
|
||||
}
|
||||
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#import <FBSnapshotTestCase/FBSnapshotTestCasePlatform.h>
|
||||
#import <FBSnapshotTestCase/FBSnapshotTestController.h>
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@ -48,7 +49,7 @@
|
||||
/**
|
||||
Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though.
|
||||
@param layer The layer to snapshot
|
||||
@param identifier An optional identifier, used is there are multiple snapshot tests in a given -test method.
|
||||
@param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method.
|
||||
@param suffixes An NSOrderedSet of strings for the different suffixes
|
||||
@param tolerance The percentage of pixels that can differ and still count as an 'identical' layer
|
||||
*/
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#import <FBSnapshotTestCase/FBSnapshotTestCasePlatform.h>
|
||||
#import <FBSnapshotTestCase/UIApplication+StrictKeyWindow.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
BOOL FBSnapshotTestCaseIs64Bit(void)
|
||||
@ -34,7 +35,8 @@ NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void)
|
||||
NSString *FBDeviceAgnosticNormalizedFileName(NSString *fileName)
|
||||
{
|
||||
UIDevice *device = [UIDevice currentDevice];
|
||||
CGSize screenSize = [[UIApplication sharedApplication] keyWindow].bounds.size;
|
||||
UIWindow *keyWindow = [[UIApplication sharedApplication] fb_strictKeyWindow];
|
||||
CGSize screenSize = keyWindow.bounds.size;
|
||||
NSString *os = device.systemVersion;
|
||||
|
||||
fileName = [NSString stringWithFormat:@"%@_%@%@_%.0fx%.0f", fileName, device.model, os, screenSize.width, screenSize.height];
|
||||
|
||||
@ -28,6 +28,21 @@ extern NSString *const FBSnapshotTestControllerErrorDomain;
|
||||
*/
|
||||
extern NSString *const FBReferenceImageFilePathKey;
|
||||
|
||||
/**
|
||||
Errors returned by the methods of FBSnapshotTestController sometimes contain this key in the `userInfo` dictionary.
|
||||
*/
|
||||
extern NSString *const FBReferenceImageKey;
|
||||
|
||||
/**
|
||||
Errors returned by the methods of FBSnapshotTestController sometimes contain this key in the `userInfo` dictionary.
|
||||
*/
|
||||
extern NSString *const FBCapturedImageKey;
|
||||
|
||||
/**
|
||||
Errors returned by the methods of FBSnapshotTestController sometimes contain this key in the `userInfo` dictionary.
|
||||
*/
|
||||
extern NSString *const FBDiffedImageKey;
|
||||
|
||||
/**
|
||||
Provides the heavy-lifting for FBSnapshotTestCase. It loads and saves images, along with performing the actual pixel-
|
||||
by-pixel comparison of images.
|
||||
|
||||
@ -18,6 +18,9 @@
|
||||
|
||||
NSString *const FBSnapshotTestControllerErrorDomain = @"FBSnapshotTestControllerErrorDomain";
|
||||
NSString *const FBReferenceImageFilePathKey = @"FBReferenceImageFilePathKey";
|
||||
NSString *const FBReferenceImageKey = @"FBReferenceImageKey";
|
||||
NSString *const FBCapturedImageKey = @"FBCapturedImageKey";
|
||||
NSString *const FBDiffedImageKey = @"FBDiffedImageKey";
|
||||
|
||||
typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
||||
FBTestSnapshotFileNameTypeReference,
|
||||
@ -126,25 +129,25 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
||||
tolerance:(CGFloat)tolerance
|
||||
error:(NSError **)errorPtr
|
||||
{
|
||||
if (CGSizeEqualToSize(referenceImage.size, image.size)) {
|
||||
BOOL imagesEqual = [referenceImage fb_compareWithImage:image tolerance:tolerance];
|
||||
if (NULL != errorPtr) {
|
||||
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
|
||||
code:FBSnapshotTestControllerErrorCodeImagesDifferent
|
||||
userInfo:@{
|
||||
NSLocalizedDescriptionKey: @"Images different",
|
||||
}];
|
||||
}
|
||||
return imagesEqual;
|
||||
BOOL sameImageDimensions = CGSizeEqualToSize(referenceImage.size, image.size);
|
||||
if (sameImageDimensions && [referenceImage fb_compareWithImage:image tolerance:tolerance]) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
if (NULL != errorPtr) {
|
||||
NSString *errorDescription = sameImageDimensions ? @"Images different" : @"Images different sizes";
|
||||
NSString *errorReason = sameImageDimensions ? [NSString stringWithFormat:@"image pixels differed by more than %.2f%% from the reference image", tolerance * 100]
|
||||
: [NSString stringWithFormat:@"referenceImage:%@, image:%@", NSStringFromCGSize(referenceImage.size), NSStringFromCGSize(image.size)];
|
||||
FBSnapshotTestControllerErrorCode errorCode = sameImageDimensions ? FBSnapshotTestControllerErrorCodeImagesDifferent : FBSnapshotTestControllerErrorCodeImagesDifferentSizes;
|
||||
|
||||
*errorPtr = [NSError errorWithDomain:FBSnapshotTestControllerErrorDomain
|
||||
code:FBSnapshotTestControllerErrorCodeImagesDifferentSizes
|
||||
code:errorCode
|
||||
userInfo:@{
|
||||
NSLocalizedDescriptionKey: @"Images different sizes",
|
||||
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"referenceImage:%@, image:%@",
|
||||
NSStringFromCGSize(referenceImage.size),
|
||||
NSStringFromCGSize(image.size)],
|
||||
NSLocalizedDescriptionKey: errorDescription,
|
||||
NSLocalizedFailureReasonErrorKey: errorReason,
|
||||
FBReferenceImageKey: referenceImage,
|
||||
FBCapturedImageKey: image,
|
||||
FBDiffedImageKey: [referenceImage fb_diffWithImage:image],
|
||||
}];
|
||||
}
|
||||
return NO;
|
||||
@ -279,11 +282,10 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
||||
UIImage *snapshot = [self _imageForViewOrLayer:viewOrLayer];
|
||||
BOOL imagesSame = [self compareReferenceImage:referenceImage toImage:snapshot tolerance:tolerance error:errorPtr];
|
||||
if (!imagesSame) {
|
||||
[self saveFailedReferenceImage:referenceImage
|
||||
testImage:snapshot
|
||||
selector:selector
|
||||
identifier:identifier
|
||||
error:errorPtr];
|
||||
NSError *saveError = nil;
|
||||
if ([self saveFailedReferenceImage:referenceImage testImage:snapshot selector:selector identifier:identifier error:&saveError] == NO) {
|
||||
NSLog(@"Error saving test images: %@", saveError);
|
||||
}
|
||||
}
|
||||
return imagesSame;
|
||||
}
|
||||
|
||||
@ -9,15 +9,15 @@
|
||||
*/
|
||||
|
||||
public extension FBSnapshotTestCase {
|
||||
public func FBSnapshotVerifyView(view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
|
||||
FBSnapshotVerifyViewOrLayer(view, identifier: identifier, suffixes: suffixes)
|
||||
public func FBSnapshotVerifyView(view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) {
|
||||
FBSnapshotVerifyViewOrLayer(view, identifier: identifier, suffixes: suffixes, tolerance: tolerance, file: file, line: line)
|
||||
}
|
||||
|
||||
public func FBSnapshotVerifyLayer(layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
|
||||
FBSnapshotVerifyViewOrLayer(layer, identifier: identifier, suffixes: suffixes)
|
||||
public func FBSnapshotVerifyLayer(layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) {
|
||||
FBSnapshotVerifyViewOrLayer(layer, identifier: identifier, suffixes: suffixes, tolerance: tolerance, file: file, line: line)
|
||||
}
|
||||
|
||||
private func FBSnapshotVerifyViewOrLayer(viewOrLayer: AnyObject, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), file: String = __FILE__, line: UInt = __LINE__) {
|
||||
private func FBSnapshotVerifyViewOrLayer(viewOrLayer: AnyObject, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) {
|
||||
let envReferenceImageDirectory = self.getReferenceImageDirectoryWithDefault(FB_REFERENCE_IMAGE_DIR)
|
||||
var error: NSError?
|
||||
var comparisonSuccess = false
|
||||
@ -27,7 +27,7 @@ public extension FBSnapshotTestCase {
|
||||
let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)"
|
||||
if viewOrLayer.isKindOfClass(UIView) {
|
||||
do {
|
||||
try compareSnapshotOfView(viewOrLayer as! UIView, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0)
|
||||
try compareSnapshotOfView(viewOrLayer as! UIView, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: tolerance)
|
||||
comparisonSuccess = true
|
||||
} catch let error1 as NSError {
|
||||
error = error1
|
||||
@ -35,7 +35,7 @@ public extension FBSnapshotTestCase {
|
||||
}
|
||||
} else if viewOrLayer.isKindOfClass(CALayer) {
|
||||
do {
|
||||
try compareSnapshotOfLayer(viewOrLayer as! CALayer, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: 0)
|
||||
try compareSnapshotOfLayer(viewOrLayer as! CALayer, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: tolerance)
|
||||
comparisonSuccess = true
|
||||
} catch let error1 as NSError {
|
||||
error = error1
|
||||
@ -58,7 +58,7 @@ public extension FBSnapshotTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
func assert(assertion: Bool, message: String, file: String, line: UInt) {
|
||||
func assert(assertion: Bool, message: String, file: StaticString, line: UInt) {
|
||||
if !assertion {
|
||||
XCTFail(message, file: file, line: line)
|
||||
}
|
||||
|
||||
1
Example/Pods/Headers/Private/FBSnapshotTestCase/UIApplication+StrictKeyWindow.h
generated
Symbolic link
1
Example/Pods/Headers/Private/FBSnapshotTestCase/UIApplication+StrictKeyWindow.h
generated
Symbolic link
@ -0,0 +1 @@
|
||||
../../../FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIApplication+StrictKeyWindow.h
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "PNImagePickerViewController",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.6",
|
||||
"summary": "PNImagePickerViewController is a fork of jacobsieradzki/JSImagePickerController with iOS8+ PhotoKit support.",
|
||||
"homepage": "https://github.com/giuseppenucifora/PNImagePickerViewController",
|
||||
"license": "MIT",
|
||||
@ -9,7 +9,7 @@
|
||||
},
|
||||
"source": {
|
||||
"git": "https://github.com/giuseppenucifora/PNImagePickerViewController.git",
|
||||
"tag": "0.1.1"
|
||||
"tag": "0.1.6"
|
||||
},
|
||||
"platforms": {
|
||||
"ios": "8.0"
|
||||
|
||||
23
Example/Pods/Manifest.lock
generated
23
Example/Pods/Manifest.lock
generated
@ -1,15 +1,16 @@
|
||||
PODS:
|
||||
- DGActivityIndicatorView (2.0)
|
||||
- Expecta (1.0.5)
|
||||
- Expecta+Snapshots (2.0.0):
|
||||
- Expecta+Snapshots (3.0.0):
|
||||
- Expecta (~> 1.0)
|
||||
- FBSnapshotTestCase/Core (~> 2.0.3)
|
||||
- FBSnapshotTestCase (2.0.7):
|
||||
- FBSnapshotTestCase/SwiftSupport (= 2.0.7)
|
||||
- FBSnapshotTestCase/Core (2.0.7)
|
||||
- FBSnapshotTestCase/SwiftSupport (2.0.7):
|
||||
- FBSnapshotTestCase/Core (~> 2.0)
|
||||
- Specta (~> 1.0)
|
||||
- FBSnapshotTestCase (2.1.0):
|
||||
- FBSnapshotTestCase/SwiftSupport (= 2.1.0)
|
||||
- FBSnapshotTestCase/Core (2.1.0)
|
||||
- FBSnapshotTestCase/SwiftSupport (2.1.0):
|
||||
- FBSnapshotTestCase/Core
|
||||
- PNImagePickerViewController (0.1.1):
|
||||
- PNImagePickerViewController (0.1.6):
|
||||
- DGActivityIndicatorView
|
||||
- PureLayout
|
||||
- PureLayout (3.0.1)
|
||||
@ -25,14 +26,14 @@ DEPENDENCIES:
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
PNImagePickerViewController:
|
||||
:path: "../"
|
||||
:path: ../
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
DGActivityIndicatorView: 52875b025a6ccf6a431a905285c12e2bb95eb559
|
||||
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
||||
Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba
|
||||
FBSnapshotTestCase: 7e85180d0d141a0cf472352edda7e80d7eaeb547
|
||||
PNImagePickerViewController: c3059a8ce0352a54a0fcdb06b5acdc0516129fa5
|
||||
Expecta+Snapshots: c343f410c7a6392f3e22e78f94c44b6c0749a516
|
||||
FBSnapshotTestCase: 366ecd378511d7716c79991cd8067d1eed23578d
|
||||
PNImagePickerViewController: 0848e21228883cb9ed88d1acda011343874159bf
|
||||
PureLayout: f35f5384c9c4e4479df041dbe33ad7577b71ddfb
|
||||
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
||||
|
||||
|
||||
12502
Example/Pods/Pods.xcodeproj/project.pbxproj
generated
12502
Example/Pods/Pods.xcodeproj/project.pbxproj
generated
File diff suppressed because it is too large
Load Diff
@ -14,7 +14,7 @@
|
||||
buildForArchiving = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = 'primary'
|
||||
BlueprintIdentifier = 'B7AF5B1A47658360559D0921'
|
||||
BlueprintIdentifier = 'AFAC46D282AE9DD022D83BFB'
|
||||
BlueprintName = 'PNImagePickerViewController'
|
||||
ReferencedContainer = 'container:Pods.xcodeproj'
|
||||
BuildableName = 'PNImagePickerViewController.framework'>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0.0</string>
|
||||
<string>3.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0.7</string>
|
||||
<string>2.1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.1.1</string>
|
||||
<string>0.1.6</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "PNImagePickerViewController"
|
||||
s.version = "0.1.5"
|
||||
s.version = "0.1.6"
|
||||
s.summary = "PNImagePickerViewController is a fork of jacobsieradzki/JSImagePickerController with iOS8+ PhotoKit support."
|
||||
|
||||
# This description is used to generate tags and improve search results.
|
||||
|
||||
@ -478,7 +478,8 @@
|
||||
}
|
||||
[_imagePickerView setNeedsUpdateConstraints];
|
||||
[_imagePickerView updateConstraintsIfNeeded];
|
||||
|
||||
|
||||
_isVisible = NO;
|
||||
if (animated) {
|
||||
|
||||
[UIView animateWithDuration:_animationTime
|
||||
@ -519,6 +520,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void) dismissViewControllerAnimated:(BOOL)animated completion:(void (^ _Nullable)(void))completion {
|
||||
[self dismissAnimated:animated];
|
||||
if (completion) {
|
||||
completion();
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user