Skip to content

Commit

Permalink
Delete fb_strictKeyWindow, improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
alanzeino committed Aug 28, 2018
1 parent 069d66f commit 71bbf33
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 158 deletions.
20 changes: 0 additions & 20 deletions FBSnapshotTestCase.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
827137911C63ABE900354E42 /* UIImage+Compare.h in Headers */ = {isa = PBXBuildFile; fileRef = 133564101B59C3F500A4E4BF /* UIImage+Compare.h */; };
827137921C63ABF000354E42 /* UIImage+Diff.h in Headers */ = {isa = PBXBuildFile; fileRef = 133564121B59C3F500A4E4BF /* UIImage+Diff.h */; };
827137931C63ABF000354E42 /* UIImage+Snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = 133564141B59C3F500A4E4BF /* UIImage+Snapshot.h */; };
827137941C63ABF000354E42 /* UIApplication+StrictKeyWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = BC45D51F1C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.h */; };
827137951C63ABF400354E42 /* UIImage+Compare.m in Sources */ = {isa = PBXBuildFile; fileRef = 133564111B59C3F500A4E4BF /* UIImage+Compare.m */; };
827137961C63ABF400354E42 /* UIImage+Diff.m in Sources */ = {isa = PBXBuildFile; fileRef = 133564131B59C3F500A4E4BF /* UIImage+Diff.m */; };
827137971C63ABF400354E42 /* UIImage+Snapshot.m in Sources */ = {isa = PBXBuildFile; fileRef = 133564151B59C3F500A4E4BF /* UIImage+Snapshot.m */; };
827137981C63ABF400354E42 /* UIApplication+StrictKeyWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = BC45D5201C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.m */; };
827137991C63ABF900354E42 /* FBSnapshotTestCase.h in Headers */ = {isa = PBXBuildFile; fileRef = B31988201AB7849400B0A900 /* FBSnapshotTestCase.h */; settings = {ATTRIBUTES = (Public, ); }; };
8271379A1C63ABF900354E42 /* FBSnapshotTestCasePlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = 13CBB39B1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.h */; settings = {ATTRIBUTES = (Public, ); }; };
8271379B1C63ABF900354E42 /* FBSnapshotTestController.h in Headers */ = {isa = PBXBuildFile; fileRef = B31988221AB7849400B0A900 /* FBSnapshotTestController.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand All @@ -47,11 +45,7 @@
B32447DE1AB78B5E00B1D6FF /* square.png in Resources */ = {isa = PBXBuildFile; fileRef = B32447DB1AB78B5E00B1D6FF /* square.png */; };
B76C68291C6BD6D200586E5B /* rect.png in Resources */ = {isa = PBXBuildFile; fileRef = B76C68271C6BD68100586E5B /* rect.png */; };
B76C682A1C6BD6D500586E5B /* rect.png in Resources */ = {isa = PBXBuildFile; fileRef = B76C68271C6BD68100586E5B /* rect.png */; };
BC45D5211C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = BC45D51F1C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.h */; };
BC45D5221C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = BC45D5201C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.m */; };
E5C2CD621B1F399A00669887 /* square_with_pixel.png in Resources */ = {isa = PBXBuildFile; fileRef = E5C2CD611B1F399A00669887 /* square_with_pixel.png */; };
E704DBE4202B898800A48406 /* UIControl+SendActions.h in Headers */ = {isa = PBXBuildFile; fileRef = E704DBE2202B898800A48406 /* UIControl+SendActions.h */; };
E704DBE5202B898800A48406 /* UIControl+SendActions.m in Sources */ = {isa = PBXBuildFile; fileRef = E704DBE3202B898800A48406 /* UIControl+SendActions.m */; };
F0D698F51B204E120005CAC9 /* SwiftSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0D698F41B204E120005CAC9 /* SwiftSupport.swift */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -96,11 +90,7 @@
B32447DA1AB78B5E00B1D6FF /* square-copy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "square-copy.png"; sourceTree = "<group>"; };
B32447DB1AB78B5E00B1D6FF /* square.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = square.png; sourceTree = "<group>"; };
B76C68271C6BD68100586E5B /* rect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rect.png; sourceTree = "<group>"; };
BC45D51F1C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIApplication+StrictKeyWindow.h"; sourceTree = "<group>"; };
BC45D5201C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIApplication+StrictKeyWindow.m"; sourceTree = "<group>"; };
E5C2CD611B1F399A00669887 /* square_with_pixel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = square_with_pixel.png; sourceTree = "<group>"; };
E704DBE2202B898800A48406 /* UIControl+SendActions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIControl+SendActions.h"; sourceTree = "<group>"; };
E704DBE3202B898800A48406 /* UIControl+SendActions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIControl+SendActions.m"; sourceTree = "<group>"; };
F0D698F41B204E120005CAC9 /* SwiftSupport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftSupport.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -147,10 +137,6 @@
133564131B59C3F500A4E4BF /* UIImage+Diff.m */,
133564141B59C3F500A4E4BF /* UIImage+Snapshot.h */,
133564151B59C3F500A4E4BF /* UIImage+Snapshot.m */,
BC45D51F1C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.h */,
BC45D5201C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.m */,
E704DBE2202B898800A48406 /* UIControl+SendActions.h */,
E704DBE3202B898800A48406 /* UIControl+SendActions.m */,
);
path = Categories;
sourceTree = "<group>";
Expand Down Expand Up @@ -232,7 +218,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
827137941C63ABF000354E42 /* UIApplication+StrictKeyWindow.h in Headers */,
8271379A1C63ABF900354E42 /* FBSnapshotTestCasePlatform.h in Headers */,
827137911C63ABE900354E42 /* UIImage+Compare.h in Headers */,
827137991C63ABF900354E42 /* FBSnapshotTestCase.h in Headers */,
Expand All @@ -246,9 +231,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
BC45D5211C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.h in Headers */,
B31988281AB7849400B0A900 /* FBSnapshotTestCase.h in Headers */,
E704DBE4202B898800A48406 /* UIControl+SendActions.h in Headers */,
13CBB39D1AEE013900B6ADBA /* FBSnapshotTestCasePlatform.h in Headers */,
B319882A1AB7849400B0A900 /* FBSnapshotTestController.h in Headers */,
133564181B59C3F500A4E4BF /* UIImage+Diff.h in Headers */,
Expand Down Expand Up @@ -427,7 +410,6 @@
files = (
827137961C63ABF400354E42 /* UIImage+Diff.m in Sources */,
8271379E1C63ABFD00354E42 /* FBSnapshotTestController.m in Sources */,
827137981C63ABF400354E42 /* UIApplication+StrictKeyWindow.m in Sources */,
8271379D1C63ABFD00354E42 /* FBSnapshotTestCasePlatform.m in Sources */,
8271379C1C63ABFD00354E42 /* FBSnapshotTestCase.m in Sources */,
827137951C63ABF400354E42 /* UIImage+Compare.m in Sources */,
Expand All @@ -449,8 +431,6 @@
buildActionMask = 2147483647;
files = (
133564171B59C3F500A4E4BF /* UIImage+Compare.m in Sources */,
BC45D5221C2AEFCE007C72F3 /* UIApplication+StrictKeyWindow.m in Sources */,
E704DBE5202B898800A48406 /* UIControl+SendActions.m in Sources */,
B31988291AB7849400B0A900 /* FBSnapshotTestCase.m in Sources */,
133564191B59C3F500A4E4BF /* UIImage+Diff.m in Sources */,
1335641B1B59C3F500A4E4BF /* UIImage+Snapshot.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
19 changes: 0 additions & 19 deletions FBSnapshotTestCase/Categories/UIApplication+StrictKeyWindow.h

This file was deleted.

22 changes: 0 additions & 22 deletions FBSnapshotTestCase/Categories/UIApplication+StrictKeyWindow.m

This file was deleted.

36 changes: 0 additions & 36 deletions FBSnapshotTestCase/Categories/UIControl+SendActions.h

This file was deleted.

51 changes: 0 additions & 51 deletions FBSnapshotTestCase/Categories/UIControl+SendActions.m

This file was deleted.

3 changes: 1 addition & 2 deletions FBSnapshotTestCase/Categories/UIImage+Snapshot.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

#import <FBSnapshotTestCase/UIImage+Snapshot.h>
#import <FBSnapshotTestCase/UIApplication+StrictKeyWindow.h>

@implementation UIImage (Snapshot)

Expand Down Expand Up @@ -43,7 +42,7 @@ + (UIImage *)fb_imageForView:(UIView *)view
UIWindow *window = [view isKindOfClass:[UIWindow class]] ? (UIWindow *)view : view.window;
BOOL removeFromSuperview = NO;
if (!window) {
window = [[UIApplication sharedApplication] fb_strictKeyWindow];
window = [[UIApplication sharedApplication] keyWindow];
}

if (!view.window && view != window) {
Expand Down
3 changes: 1 addition & 2 deletions FBSnapshotTestCase/FBSnapshotTestCasePlatform.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

#import <FBSnapshotTestCase/FBSnapshotTestCasePlatform.h>
#import <FBSnapshotTestCase/UIApplication+StrictKeyWindow.h>
#import <UIKit/UIKit.h>

BOOL FBSnapshotTestCaseIs64Bit(void)
Expand All @@ -34,7 +33,7 @@ BOOL FBSnapshotTestCaseIs64Bit(void)
NSString *FBDeviceAgnosticNormalizedFileName(NSString *fileName)
{
UIDevice *device = [UIDevice currentDevice];
UIWindow *keyWindow = [[UIApplication sharedApplication] fb_strictKeyWindow];
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
CGSize screenSize = keyWindow.bounds.size;
NSString *os = device.systemVersion;

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ In Xcode 5
and later new projects only offer application tests, but older projects will
have separate targets for the two types.

However, if you are writing snapshot tests inside a library/framework, you might want to keep your test bundle as a library test bundle without a Test Host or Simulator.
*However*, if you are writing snapshot tests inside a library/framework, you might want to keep your test bundle as a library test bundle without a Test Host or Simulator.

Read more on this [here](docs/LibraryVsApplicationTestBundles.md).

Expand Down
Loading

0 comments on commit 71bbf33

Please sign in to comment.