Skip to content

Commit f3f9909

Browse files
authored
Merge pull request #178 from layoutBox/update_pod
Update pod specification
2 parents d6ce7b0 + b6865de commit f3f9909

File tree

17 files changed

+75
-38
lines changed

17 files changed

+75
-38
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
language: objective-c
22
osx_image: xcode9.4
3-
cache: bundler
3+
4+
cache:
5+
- bundler
6+
- cocoapods
47

58
install:
69
- bundle install # --deployment # to cache vendor/bundle

Example/PinLayoutSample.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@
617617
inputPaths = (
618618
"${SRCROOT}/../Pods/Target Support Files/Pods-PinLayoutSample/Pods-PinLayoutSample-frameworks.sh",
619619
"${BUILT_PRODUCTS_DIR}/PinLayout/PinLayout.framework",
620-
"${PODS_ROOT}/Reveal-SDK/RevealServer-18/iOS/RevealServer.framework",
620+
"${PODS_ROOT}/Reveal-SDK/RevealServer-17/iOS/RevealServer.framework",
621621
);
622622
name = "[CP] Embed Pods Frameworks";
623623
outputPaths = (

PinLayout.podspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Pod::Spec.new do |spec|
1616
spec.author = { "Luc Dion" => "[email protected]" }
1717
spec.source = { :git => "https://github.com/layoutBox/PinLayout.git", :tag => "#{spec.version}" }
1818
spec.source_files = "Sources/**/*.swift"
19-
spec.swift_version = '4.1'
2019

2120
spec.ios.deployment_target = '8.0'
2221
spec.ios.frameworks = 'Foundation', 'CoreGraphics', 'UIKit'

PinLayout.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@
13121312
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
13131313
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
13141314
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1315-
CODE_SIGN_IDENTITY = "Mac Developer";
1315+
CODE_SIGN_IDENTITY = "";
13161316
CODE_SIGN_STYLE = Automatic;
13171317
COMBINE_HIDPI_IMAGES = YES;
13181318
DEVELOPMENT_TEAM = 4Q596JWQC5;
@@ -1379,6 +1379,7 @@
13791379
MACOSX_DEPLOYMENT_TARGET = 10.10;
13801380
PRODUCT_BUNDLE_IDENTIFIER = "com.layoutbox.PinLayout-macOS";
13811381
PRODUCT_NAME = PinLayout;
1382+
PROVISIONING_PROFILE_SPECIFIER = "";
13821383
SDKROOT = macosx;
13831384
SKIP_INSTALL = YES;
13841385
SUPPORTED_PLATFORMS = macosx;
@@ -1411,6 +1412,7 @@
14111412
MACOSX_DEPLOYMENT_TARGET = 10.10;
14121413
PRODUCT_BUNDLE_IDENTIFIER = "com.layoutbox.PinLayout-macOS";
14131414
PRODUCT_NAME = PinLayout;
1415+
PROVISIONING_PROFILE_SPECIFIER = "";
14141416
SDKROOT = macosx;
14151417
SKIP_INSTALL = YES;
14161418
SUPPORTED_PLATFORMS = macosx;

Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PODS:
22
- Nimble (7.0.3)
3-
- PinLayout (1.8.4)
3+
- PinLayout (1.8.5)
44
- Quick (1.2.0)
5-
- Reveal-SDK (18)
5+
- Reveal-SDK (17)
66
- SwiftLint (0.27.0)
77

88
DEPENDENCIES:
@@ -25,9 +25,9 @@ EXTERNAL SOURCES:
2525

2626
SPEC CHECKSUMS:
2727
Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac
28-
PinLayout: 143506c26a2292428e86df058aae15c7c040e9f0
28+
PinLayout: a4b78dd50eb2e85c31b4418013461fa667764783
2929
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
30-
Reveal-SDK: cce79388da3fd0bbb6ae19d769b906cfc3a33a89
30+
Reveal-SDK: a6df49f47319bd19a110c960c498af32df72c0af
3131
SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073
3232

3333
PODFILE CHECKSUM: 62618887f8155abc1ed3348d9b676cf6915137e2

Sources/Impl/Coordinates.swift

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,14 @@ import UIKit
2323
import AppKit
2424
#endif
2525

26-
#if os(iOS) || os(tvOS)
27-
internal var displayScale: CGFloat = UIScreen.main.scale
28-
#elseif os(OSX)
29-
internal var displayScale: CGFloat = NSScreen.main?.backingScaleFactor ?? 2.0
30-
#endif
26+
internal var displayScale: CGFloat = getDisplayScale()
3127
internal var onePixelLength: CGFloat = 1 / displayScale
3228

3329
public func _pinlayoutSetUnitTest(scale: CGFloat?) {
3430
if let scale = scale {
3531
displayScale = scale
3632
} else {
37-
#if os(iOS) || os(tvOS)
38-
displayScale = UIScreen.main.scale
39-
#elseif os(OSX)
40-
displayScale = NSScreen.main?.backingScaleFactor ?? 2.0
41-
#endif
33+
displayScale = getDisplayScale()
4234
}
4335
}
4436

@@ -113,3 +105,15 @@ final class Coordinates<View: Layoutable> {
113105
return CGFloat(ceilf(Float(pointValue * displayScale))) / displayScale
114106
}
115107
}
108+
109+
private func getDisplayScale() -> CGFloat {
110+
#if os(iOS) || os(tvOS)
111+
return UIScreen.main.scale
112+
#elseif os(OSX)
113+
#if swift(>=4.1)
114+
return NSScreen.main?.backingScaleFactor ?? 2.0
115+
#else
116+
return NSScreen.main()?.backingScaleFactor ?? 2.0
117+
#endif
118+
#endif
119+
}

Sources/SupportingFiles/PinLayoutMacOS.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// THE SOFTWARE.
1919

2020
#import <Foundation/Foundation.h>
21-
//#import <Cocoa/Cocoa.h>
2221

2322
//! Project version number for PinLayoutMacOS.
2423
FOUNDATION_EXPORT double PinLayoutMacOSVersionNumber;

TestProjects/cocoapods/macos/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- PinLayout (1.8.3)
2+
- PinLayout (1.8.5)
33

44
DEPENDENCIES:
55
- PinLayout (from `../../..`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99
:path: "../../.."
1010

1111
SPEC CHECKSUMS:
12-
PinLayout: 1330ea0c6324556e7bdb9b36af32a262a97d2ff2
12+
PinLayout: a4b78dd50eb2e85c31b4418013461fa667764783
1313

1414
PODFILE CHECKSUM: e4d7a00501eec9097d00e6c5397befb6e16ccaec
1515

TestProjects/cocoapods/tvos/PinLayout-tvOS.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@
310310
PRODUCT_NAME = "$(TARGET_NAME)";
311311
SWIFT_OBJC_BRIDGING_HEADER = "PinLayout-tvOS/PinLayout-tvOS-Bridging-Header.h";
312312
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
313-
SWIFT_VERSION = 3.0;
313+
SWIFT_VERSION = 4.0;
314314
};
315315
name = Debug;
316316
};
@@ -325,7 +325,7 @@
325325
PRODUCT_BUNDLE_IDENTIFIER = "com.layoutbox.project.PinLayout-tvOS";
326326
PRODUCT_NAME = "$(TARGET_NAME)";
327327
SWIFT_OBJC_BRIDGING_HEADER = "PinLayout-tvOS/PinLayout-tvOS-Bridging-Header.h";
328-
SWIFT_VERSION = 3.0;
328+
SWIFT_VERSION = 4.0;
329329
};
330330
name = Release;
331331
};

Tests/Common/AdjustSizeSpec.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ class AdjustSizeSpec: QuickSpec {
7474
bViewChild.frame = CGRect(x: 40, y: 10, width: 60, height: 20)
7575
}
7676

77+
afterEach {
78+
_pinlayoutSetUnitTest(scale: nil)
79+
}
80+
7781
describe("the result of the width(...) methods") {
7882
it("should adjust the width of aView") {
7983
aView.pin.width(35)
@@ -858,16 +862,22 @@ class AdjustSizeSpec: QuickSpec {
858862
}
859863

860864
it("should produce the same size as the built-in sizeToFit() method") {
865+
_pinlayoutSetUnitTest(scale: nil)
866+
861867
let label = PLabel(frame: CGRect.zero)
862868
label.text = "Lorem ipsum dolor sit amet"
863869
label.pin.sizeToFit()
864870
let size = label.bounds.size
871+
865872
label.bounds.size = CGSize.zero
866873
label.sizeToFit()
874+
867875
expect(size).to(equal(label.bounds.size))
868876
}
869877

870878
it("should produce the same size as the built-in sizeToFit() method when there is a transform applied") {
879+
_pinlayoutSetUnitTest(scale: nil)
880+
871881
let label = PLabel(frame: CGRect.zero)
872882
label.text = "Lorem ipsum dolor sit amet"
873883
label.transform = CGAffineTransform(scaleX: 0.5, y: 0.5)

0 commit comments

Comments
 (0)