Last active
April 3, 2017 06:33
-
-
Save TheAdamBorek/404ec87069a0feb58651b3ef64ecc89e to your computer and use it in GitHub Desktop.
Revisions
-
TheAdamBorek revised this gist
Apr 3, 2017 . 2 changed files with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ enum ScreenSizes { static let threePointFiveInchesPhoneFrame = CGRect(x: 0, y: 0, width: 320, height: 480) static let fourInchesPhoneFrame = CGRect(x: 0, y: 0, width: 320, height: 568) static let fourPointSevenInchesPhoneFrame = CGRect(x: 0, y: 0, width: 375, height: 667) static let iPadPortrait = CGRect(x: 0, y: 0, width: 768, height: 1024) static let iPadLandscape = CGRect(x: 0, y: 0, width: 1024, height: 768) } File renamed without changes. -
TheAdamBorek created this gist
Apr 3, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ class SnapshotTestCase: FBSnapshotTestCase { private let frames: [String : CGRect] = [ "iPadPortraitFrame": ScreenSizes.iPadPortrait, "iPadLandscapeFrame": ScreenSizes.iPadLandscape, "threePointFivePhoneFrame": ScreenSizes.threePointFiveInchesPhoneFrame, "fourInchesPhoneFrame": ScreenSizes.fourInchesPhoneFrame, "fourPointSevenInchesPhoneFrame": ScreenSizes.fourPointSevenInchesPhoneFrame ] override func getReferenceImageDirectory(withDefault dir: String!) -> String! { return snapshotReferenceImageDirectory } func verifyForScreens(view: UIView, file: StaticString = #file, line: UInt = #line) { for (identifier, frame) in frames { verify(view: view, frame: frame, identifier: identifier, file: file, line: line) } } func verify(view: UIView, frame: CGRect? = nil, identifier: String = "", file: StaticString = #file, line: UInt = #line) { if let frame = frame { view.frame = frame } view.layoutIfNeeded() FBSnapshotVerifyView(view, identifier: identifier, file: file, line: line) FBSnapshotVerifyLayer(view.layer, identifier: identifier, file: file, line: line) } }