Skip to content

Commit 2dc163f

Browse files
authored
Merge pull request #139 from mirego/add_objc_tvos_macos_tests
Add objective-C CI test apps for macOS and tvOS.
2 parents b2a5992 + d395185 commit 2dc163f

File tree

7 files changed

+139
-2
lines changed

7 files changed

+139
-2
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ TestProjects/cocoapods/macos/PinLayout-macOS.xcworkspace/
1919
TestProjects/cocoapods/macos/Podfile.lock
2020
TestProjects/cocoapods/tvos/PinLayout-tvOS.xcworkspace/
2121
TestProjects/cocoapods/tvos/Podfile.lock
22-
2322
TestProjects/carthage/ios/Cartfile.resolved
24-
TestProjects/carthage/ios/Carthage/
23+
TestProjects/carthage/ios/Carthage/
24+
25+
TestProjects/swift-package-manager
26+
27+
Example/PinLayoutExampleMacOS

TestProjects/cocoapods/macos/PinLayout-macOS.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
447D4B571EA571EC002FDFF4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 447D4B561EA571EC002FDFF4 /* Assets.xcassets */; };
1212
D481169C663D06B9487BD94A /* Pods_PinLayout_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD1FED5769AD72F9C3BA80B4 /* Pods_PinLayout_macOS.framework */; };
1313
DF47E42B2088F8B2008599A2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DF47E42A2088F8B2008599A2 /* Main.storyboard */; };
14+
DFF222C520B9932600AC2A84 /* TestObjectiveC.m in Sources */ = {isa = PBXBuildFile; fileRef = DFF222C420B9932600AC2A84 /* TestObjectiveC.m */; };
1415
/* End PBXBuildFile section */
1516

1617
/* Begin PBXFileReference section */
@@ -22,6 +23,8 @@
2223
5ECB97E9B35D047EBF30646A /* Pods-PinLayout-macOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PinLayout-macOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-PinLayout-macOS/Pods-PinLayout-macOS.release.xcconfig"; sourceTree = "<group>"; };
2324
AD1FED5769AD72F9C3BA80B4 /* Pods_PinLayout_macOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PinLayout_macOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2425
DF47E42A2088F8B2008599A2 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
26+
DFF222BF20B9920E00AC2A84 /* PinLayout-macOS-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PinLayout-macOS-Bridging-Header.h"; sourceTree = "<group>"; };
27+
DFF222C420B9932600AC2A84 /* TestObjectiveC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestObjectiveC.m; sourceTree = "<group>"; };
2528
/* End PBXFileReference section */
2629

2730
/* Begin PBXFrameworksBuildPhase section */
@@ -69,6 +72,8 @@
6972
447D4B561EA571EC002FDFF4 /* Assets.xcassets */,
7073
447D4B5B1EA571EC002FDFF4 /* Info.plist */,
7174
DF47E42A2088F8B2008599A2 /* Main.storyboard */,
75+
DFF222C420B9932600AC2A84 /* TestObjectiveC.m */,
76+
DFF222BF20B9920E00AC2A84 /* PinLayout-macOS-Bridging-Header.h */,
7277
);
7378
path = "PinLayout-macOS";
7479
sourceTree = "<group>";
@@ -116,6 +121,7 @@
116121
TargetAttributes = {
117122
447D4B4E1EA571EC002FDFF4 = {
118123
CreatedOnToolsVersion = 8.3.1;
124+
LastSwiftMigration = 0930;
119125
ProvisioningStyle = Automatic;
120126
};
121127
};
@@ -195,6 +201,7 @@
195201
buildActionMask = 2147483647;
196202
files = (
197203
447D4B531EA571EC002FDFF4 /* AppDelegate.swift in Sources */,
204+
DFF222C520B9932600AC2A84 /* TestObjectiveC.m in Sources */,
198205
);
199206
runOnlyForDeploymentPostprocessing = 0;
200207
};
@@ -298,12 +305,15 @@
298305
baseConfigurationReference = 039104F30404DFF00E9EE3EC /* Pods-PinLayout-macOS.debug.xcconfig */;
299306
buildSettings = {
300307
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
308+
CLANG_ENABLE_MODULES = YES;
301309
COMBINE_HIDPI_IMAGES = YES;
302310
INFOPLIST_FILE = "PinLayout-macOS/Info.plist";
303311
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
304312
MACOSX_DEPLOYMENT_TARGET = 10.11;
305313
PRODUCT_BUNDLE_IDENTIFIER = "com.mirego.project.PinLayout-macOS";
306314
PRODUCT_NAME = "$(TARGET_NAME)";
315+
SWIFT_OBJC_BRIDGING_HEADER = "PinLayout-macOS/PinLayout-macOS-Bridging-Header.h";
316+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
307317
SWIFT_VERSION = 3.0;
308318
};
309319
name = Debug;
@@ -313,12 +323,14 @@
313323
baseConfigurationReference = 5ECB97E9B35D047EBF30646A /* Pods-PinLayout-macOS.release.xcconfig */;
314324
buildSettings = {
315325
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
326+
CLANG_ENABLE_MODULES = YES;
316327
COMBINE_HIDPI_IMAGES = YES;
317328
INFOPLIST_FILE = "PinLayout-macOS/Info.plist";
318329
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
319330
MACOSX_DEPLOYMENT_TARGET = 10.11;
320331
PRODUCT_BUNDLE_IDENTIFIER = "com.mirego.project.PinLayout-macOS";
321332
PRODUCT_NAME = "$(TARGET_NAME)";
333+
SWIFT_OBJC_BRIDGING_HEADER = "PinLayout-macOS/PinLayout-macOS-Bridging-Header.h";
322334
SWIFT_VERSION = 3.0;
323335
};
324336
name = Release;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//
2+
// Use this file to import your target's public headers that you would like to expose to Swift.
3+
//
4+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// TestObjectiveC.m
3+
// PinLayoutPodTester
4+
//
5+
// Created by DION, Luc (MTL) on 2017-10-12.
6+
// Copyright © 2017 Mirego. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@import AppKit;
12+
@import PinLayout;
13+
14+
@interface IntroObjectiveCView: NSView {
15+
}
16+
@end
17+
18+
@implementation IntroObjectiveCView {
19+
CGFloat topLayoutGuide;
20+
NSImageView* logo;
21+
NSView* separatorView;
22+
}
23+
24+
- (id)initWithFrame:(CGRect)frame {
25+
if ((self = [super initWithFrame:frame])) {
26+
topLayoutGuide = 0;
27+
28+
logo = [[NSImageView alloc] init];
29+
separatorView = [[NSView alloc] init];
30+
}
31+
return self;
32+
}
33+
34+
- (void)layout {
35+
[super layout];
36+
37+
[[[[[logo.pinObjc top] left] width:100] marginWithTop:topLayoutGuide + 10 horizontal:10 bottom:10] layout];
38+
[[[[separatorView.pinObjc belowOfViews:logo aligned:HorizontalAlignLeft] height:1] marginTop:10] layout];
39+
}
40+
41+
@end

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
448160371EA5A76A00FBA809 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 448160361EA5A76A00FBA809 /* AppDelegate.swift */; };
1212
DF4C0F5A2088FBAA00B4C060 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DF4C0F592088FBAA00B4C060 /* Main.storyboard */; };
1313
DF4C0F5C2088FBC300B4C060 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF4C0F5B2088FBC300B4C060 /* ViewController.swift */; };
14+
DFF222C720B993A900AC2A84 /* TestObjectiveC.m in Sources */ = {isa = PBXBuildFile; fileRef = DFF222C620B993A900AC2A84 /* TestObjectiveC.m */; };
1415
/* End PBXBuildFile section */
1516

1617
/* Begin PBXFileReference section */
@@ -22,6 +23,8 @@
2223
779A6A4C5B9EC1AC279D6A24 /* libPods-PinLayout-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PinLayout-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
2324
DF4C0F592088FBAA00B4C060 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
2425
DF4C0F5B2088FBC300B4C060 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
26+
DFF222BC20B991CF00AC2A84 /* PinLayout-tvOS-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PinLayout-tvOS-Bridging-Header.h"; sourceTree = "<group>"; };
27+
DFF222C620B993A900AC2A84 /* TestObjectiveC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestObjectiveC.m; sourceTree = "<group>"; };
2528
/* End PBXFileReference section */
2629

2730
/* Begin PBXFrameworksBuildPhase section */
@@ -60,7 +63,9 @@
6063
448160361EA5A76A00FBA809 /* AppDelegate.swift */,
6164
DF4C0F592088FBAA00B4C060 /* Main.storyboard */,
6265
DF4C0F5B2088FBC300B4C060 /* ViewController.swift */,
66+
DFF222C620B993A900AC2A84 /* TestObjectiveC.m */,
6367
4481603F1EA5A76B00FBA809 /* Info.plist */,
68+
DFF222BC20B991CF00AC2A84 /* PinLayout-tvOS-Bridging-Header.h */,
6469
);
6570
path = "PinLayout-tvOS";
6671
sourceTree = "<group>";
@@ -115,6 +120,7 @@
115120
TargetAttributes = {
116121
448160321EA5A76A00FBA809 = {
117122
CreatedOnToolsVersion = 8.3.1;
123+
LastSwiftMigration = 0930;
118124
ProvisioningStyle = Automatic;
119125
};
120126
};
@@ -175,6 +181,7 @@
175181
buildActionMask = 2147483647;
176182
files = (
177183
DF4C0F5C2088FBC300B4C060 /* ViewController.swift in Sources */,
184+
DFF222C720B993A900AC2A84 /* TestObjectiveC.m in Sources */,
178185
448160371EA5A76A00FBA809 /* AppDelegate.swift in Sources */,
179186
);
180187
runOnlyForDeploymentPostprocessing = 0;
@@ -279,11 +286,14 @@
279286
isa = XCBuildConfiguration;
280287
baseConfigurationReference = 3ACDA03AB2AD6F178CB4A934 /* Pods-PinLayout-tvOS.debug.xcconfig */;
281288
buildSettings = {
289+
CLANG_ENABLE_MODULES = YES;
282290
DEVELOPMENT_TEAM = "";
283291
INFOPLIST_FILE = "PinLayout-tvOS/Info.plist";
284292
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
285293
PRODUCT_BUNDLE_IDENTIFIER = "com.mirego.project.PinLayout-tvOS";
286294
PRODUCT_NAME = "$(TARGET_NAME)";
295+
SWIFT_OBJC_BRIDGING_HEADER = "PinLayout-tvOS/PinLayout-tvOS-Bridging-Header.h";
296+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
287297
SWIFT_VERSION = 3.0;
288298
};
289299
name = Debug;
@@ -292,11 +302,13 @@
292302
isa = XCBuildConfiguration;
293303
baseConfigurationReference = 6D86E0FD61D49B5CC904E75C /* Pods-PinLayout-tvOS.release.xcconfig */;
294304
buildSettings = {
305+
CLANG_ENABLE_MODULES = YES;
295306
DEVELOPMENT_TEAM = "";
296307
INFOPLIST_FILE = "PinLayout-tvOS/Info.plist";
297308
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
298309
PRODUCT_BUNDLE_IDENTIFIER = "com.mirego.project.PinLayout-tvOS";
299310
PRODUCT_NAME = "$(TARGET_NAME)";
311+
SWIFT_OBJC_BRIDGING_HEADER = "PinLayout-tvOS/PinLayout-tvOS-Bridging-Header.h";
300312
SWIFT_VERSION = 3.0;
301313
};
302314
name = Release;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//
2+
// Use this file to import your target's public headers that you would like to expose to Swift.
3+
//
4+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
//
2+
// TestObjectiveC.m
3+
// PinLayoutPodTester
4+
//
5+
// Created by DION, Luc (MTL) on 2017-10-12.
6+
// Copyright © 2017 Mirego. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@import UIKit;
12+
@import PinLayout;
13+
14+
@interface IntroObjectiveCView: UIView {
15+
}
16+
@end
17+
18+
@implementation IntroObjectiveCView {
19+
CGFloat topLayoutGuide;
20+
UIImageView* logo;
21+
UISegmentedControl* segmented;
22+
UILabel* textLabel;
23+
UIView* separatorView;
24+
}
25+
26+
- (id)initWithFrame:(CGRect)frame {
27+
if ((self = [super initWithFrame:frame])) {
28+
topLayoutGuide = 0;
29+
self.backgroundColor = UIColor.whiteColor;
30+
31+
logo = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"PinLayout-logo" inBundle:nil compatibleWithTraitCollection:nil]];
32+
[self addSubview:logo];
33+
34+
segmented = [[UISegmentedControl alloc] initWithItems: @[@"Intro", @"1", @"2"]];
35+
[self addSubview:segmented];
36+
37+
textLabel = [[UILabel alloc] init];
38+
textLabel.text = @"Swift manual views layouting without auto layout, no magic, pure code, full control. Concise syntax, readable & chainable.\n\nSwift manual views layouting without auto layout, no magic, pure code, full control. Concise syntax, readable & chainable.";
39+
textLabel.font = [UIFont systemFontOfSize:14];
40+
textLabel.numberOfLines = 0;
41+
textLabel.lineBreakMode = NSLineBreakByWordWrapping;
42+
[self addSubview:textLabel];
43+
44+
separatorView = [[UIView alloc] init];
45+
separatorView.backgroundColor = UIColor.grayColor;
46+
47+
[self addSubview:separatorView];
48+
}
49+
return self;
50+
}
51+
52+
- (void) layoutSubviews {
53+
[super layoutSubviews];
54+
55+
[[[[[[logo.pinObjc top] left] width:100] aspectRatio] marginWithTop:topLayoutGuide + 10 horizontal:10 bottom:10] layout];
56+
[[[[segmented.pinObjc rightOf:logo aligned:VerticalAlignTop] right] marginHorizontal:10] layout];
57+
[[[[[[textLabel.pinObjc belowOf:segmented aligned:HorizontalAlignLeft] widthOf:segmented] pinEdges] marginTop:10] sizeToFit:FitWidth] layout];
58+
[[[[[separatorView.pinObjc belowOfViews:@[logo, textLabel] aligned:HorizontalAlignLeft] rightTo:segmented.edge.right] height:1] marginTop:10] layout];
59+
}
60+
61+
@end

0 commit comments

Comments
 (0)