From a18fd6875cb7081a0cf2677a16ba6372f6190159 Mon Sep 17 00:00:00 2001 From: Roman Podymov Date: Wed, 29 Dec 2021 11:50:11 +0100 Subject: [PATCH 1/4] func apply(styles: [StringConvertible]) --- Sources/Mac/NSView+Styleable.swift | 11 ++++++++++- Sources/iOS/UIView+Styleable.swift | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Sources/Mac/NSView+Styleable.swift b/Sources/Mac/NSView+Styleable.swift index 2d0d44a..96003ad 100644 --- a/Sources/Mac/NSView+Styleable.swift +++ b/Sources/Mac/NSView+Styleable.swift @@ -13,13 +13,22 @@ public extension NSView { - Parameter styles: Set of style names. */ - func apply(styles: StringConvertible...) { + func apply(styles: [StringConvertible]) { self.styles = styles.map { $0.string } .joined(separator: " ") } /** Applies previously registered styles. + - Parameter styles: Set of style names. + */ + func apply(styles: StringConvertible...) { + apply(styles: styles.map { $0 }) + } + + /** + Applies previously registered styles. + - Parameter styles: Single style or multiple styles separated by whitespace. */ @IBInspectable var styles: String? { diff --git a/Sources/iOS/UIView+Styleable.swift b/Sources/iOS/UIView+Styleable.swift index e7376c3..21d7977 100644 --- a/Sources/iOS/UIView+Styleable.swift +++ b/Sources/iOS/UIView+Styleable.swift @@ -8,7 +8,7 @@ extension UIView { public convenience init(frame: CGRect = CGRect.zero, styles: [StringConvertible]) { self.init(frame: frame) - self.styles = styles.map { $0.string } .joined(separator: " ") + apply(styles: styles) } public convenience init(frame: CGRect = CGRect.zero, styles: StringConvertible) { @@ -16,6 +16,16 @@ extension UIView { apply(styles: styles) } + /** + Applies previously registered styles. + + - Parameter styles: Set of style names. + */ + + public func apply(styles: [StringConvertible]) { + self.styles = styles.map { $0.string } .joined(separator: " ") + } + /** Applies previously registered styles. @@ -23,7 +33,7 @@ extension UIView { */ public func apply(styles: StringConvertible...) { - self.styles = styles.map { $0.string } .joined(separator: " ") + apply(styles: styles.map { $0 }) } /** From 1a51a83e2e8159613e99bc42982c89a67e00a5f6 Mon Sep 17 00:00:00 2001 From: Roman Podymov Date: Wed, 29 Dec 2021 11:56:37 +0100 Subject: [PATCH 2/4] tests --- .../Mac/NSView+StyleableTests.swift | 122 ++++++++++++++++++ .../iOS/UIView+StyleableTests.swift | 56 +++++--- 2 files changed, 159 insertions(+), 19 deletions(-) create mode 100644 Tests/FashionTests/Mac/NSView+StyleableTests.swift diff --git a/Tests/FashionTests/Mac/NSView+StyleableTests.swift b/Tests/FashionTests/Mac/NSView+StyleableTests.swift new file mode 100644 index 0000000..d0a9035 --- /dev/null +++ b/Tests/FashionTests/Mac/NSView+StyleableTests.swift @@ -0,0 +1,122 @@ +#if os(macOS) +import Cocoa +import XCTest +@testable import Fashion + +final class NSViewStyleableTests: XCTestCase { + var label: NSTextField! + + override func setUp() { + super.setUp() + + label = .init() + label.backgroundColor = .red + label.textColor = .white + label.maximumNumberOfLines = 2 + + Stylist.master.register("label-1") { (label: NSTextField) in + label.textColor = .red + label.maximumNumberOfLines = 10 + } + + Stylist.master.register("label-2") { (label: NSTextField) in + label.backgroundColor = .yellow + label.maximumNumberOfLines = 3 + } + } + + override func tearDown() { + Stylist.master.styles.removeAll() + Stylist.master.sharedStyles.removeAll() + super.tearDown() + } + + func testInitFrameStyles() { + // It applies styles + label = .init() + label.apply(styles: "label-1 label-2") + + XCTAssertEqual(label.backgroundColor, .yellow) + XCTAssertEqual(label.textColor, .red) + XCTAssertEqual(label.maximumNumberOfLines, 3) + } + + func testApplyStylesWithRegisteredStyles() { + // It applies previously registered styles + label.apply(styles: "label-1", "label-2") + + XCTAssertEqual(label.backgroundColor, .yellow) + XCTAssertEqual(label.textColor, .red) + XCTAssertEqual(label.maximumNumberOfLines, 3) + } + + func testApplyStylesAsArrayWithRegisteredStyles() { + // It applies previously registered styles + label.apply(styles: ["label-1", "label-2"]) + + XCTAssertEqual(label.backgroundColor, .yellow) + XCTAssertEqual(label.textColor, .red) + XCTAssertEqual(label.maximumNumberOfLines, 3) + } + + func testApplyStylesWithNotRegisteredStyles() { + // It does not apply not registered styles + label.apply(styles: "label-3", "label-4") + + XCTAssertEqual(label.backgroundColor, .red) + XCTAssertEqual(label.textColor, .white) + XCTAssertEqual(label.maximumNumberOfLines, 2) + } + + func testApplyStylesAsArrayWithNotRegisteredStyles() { + // It does not apply not registered styles + label.apply(styles: ["label-3", "label-4"]) + + XCTAssertEqual(label.backgroundColor, .red) + XCTAssertEqual(label.textColor, .white) + XCTAssertEqual(label.maximumNumberOfLines, 2) + } + + func testStylesGetter() { + // It returns a style that has been previously set + label.styles = "label-1" + XCTAssertEqual(label.styles, "label-1") + } + + func testStylesWithSingleRegisteredStyle() { + // It applies previously registered style" + label.styles = "label-1" + + XCTAssertEqual(label.backgroundColor, .red) + XCTAssertEqual(label.textColor, .red) + XCTAssertEqual(label.maximumNumberOfLines, 10) + } + + func testStylesWithSingleNotRegisteredStyle() { + // It does not apply not registered style + label.styles = "label-3 label-4" + + XCTAssertEqual(label.backgroundColor, .red) + XCTAssertEqual(label.textColor, .white) + XCTAssertEqual(label.maximumNumberOfLines, 2) + } + + func testStylesWithMultipleRegisteredStyles() { + // It applies previously registered styles + label.styles = "label-1 label-2" + + XCTAssertEqual(label.backgroundColor, .yellow) + XCTAssertEqual(label.textColor, .red) + XCTAssertEqual(label.maximumNumberOfLines, 3) + } + + func testStylesWithMultipleNotRegisteredStyle() { + // It does not apply not registered styles + label.styles = "label-3 label-4" + + XCTAssertEqual(label.backgroundColor, .red) + XCTAssertEqual(label.textColor, .white) + XCTAssertEqual(label.maximumNumberOfLines, 2) + } +} +#endif diff --git a/Tests/FashionTests/iOS/UIView+StyleableTests.swift b/Tests/FashionTests/iOS/UIView+StyleableTests.swift index 0519f54..0b1902a 100644 --- a/Tests/FashionTests/iOS/UIView+StyleableTests.swift +++ b/Tests/FashionTests/iOS/UIView+StyleableTests.swift @@ -9,18 +9,18 @@ final class UIViewStyleableTests: XCTestCase { override func setUp() { super.setUp() - label = UILabel() - label.backgroundColor = UIColor.red - label.textColor = UIColor.white + label = .init() + label.backgroundColor = .red + label.textColor = .white label.numberOfLines = 2 Stylist.master.register("label-1") { (label: UILabel) in - label.textColor = UIColor.red + label.textColor = .red label.numberOfLines = 10 } Stylist.master.register("label-2") { (label: UILabel) in - label.backgroundColor = UIColor.yellow + label.backgroundColor = .yellow label.numberOfLines = 3 } } @@ -35,8 +35,8 @@ final class UIViewStyleableTests: XCTestCase { // It applies styles label = UILabel(styles: "label-1 label-2") - XCTAssertEqual(label.backgroundColor, UIColor.yellow) - XCTAssertEqual(label.textColor, UIColor.red) + XCTAssertEqual(label.backgroundColor, .yellow) + XCTAssertEqual(label.textColor, .red) XCTAssertEqual(label.numberOfLines, 3) } @@ -44,8 +44,17 @@ final class UIViewStyleableTests: XCTestCase { // It applies previously registered styles label.apply(styles: "label-1", "label-2") - XCTAssertEqual(label.backgroundColor, UIColor.yellow) - XCTAssertEqual(label.textColor, UIColor.red) + XCTAssertEqual(label.backgroundColor, .yellow) + XCTAssertEqual(label.textColor, .red) + XCTAssertEqual(label.numberOfLines, 3) + } + + func testApplyStylesAsArrayWithRegisteredStyles() { + // It applies previously registered styles + label.apply(styles: ["label-1", "label-2"]) + + XCTAssertEqual(label.backgroundColor, .yellow) + XCTAssertEqual(label.textColor, .red) XCTAssertEqual(label.numberOfLines, 3) } @@ -53,8 +62,17 @@ final class UIViewStyleableTests: XCTestCase { // It does not apply not registered styles label.apply(styles: "label-3", "label-4") - XCTAssertEqual(label.backgroundColor, UIColor.red) - XCTAssertEqual(label.textColor, UIColor.white) + XCTAssertEqual(label.backgroundColor, .red) + XCTAssertEqual(label.textColor, .white) + XCTAssertEqual(label.numberOfLines, 2) + } + + func testApplyStylesAsArrayWithNotRegisteredStyles() { + // It does not apply not registered styles + label.apply(styles: ["label-3", "label-4"]) + + XCTAssertEqual(label.backgroundColor, .red) + XCTAssertEqual(label.textColor, .white) XCTAssertEqual(label.numberOfLines, 2) } @@ -68,8 +86,8 @@ final class UIViewStyleableTests: XCTestCase { // It applies previously registered style" label.styles = "label-1" - XCTAssertEqual(label.backgroundColor, UIColor.red) - XCTAssertEqual(label.textColor, UIColor.red) + XCTAssertEqual(label.backgroundColor, .red) + XCTAssertEqual(label.textColor, .red) XCTAssertEqual(label.numberOfLines, 10) } @@ -77,8 +95,8 @@ final class UIViewStyleableTests: XCTestCase { // It does not apply not registered style label.styles = "label-3 label-4" - XCTAssertEqual(label.backgroundColor, UIColor.red) - XCTAssertEqual(label.textColor, UIColor.white) + XCTAssertEqual(label.backgroundColor, .red) + XCTAssertEqual(label.textColor, .white) XCTAssertEqual(label.numberOfLines, 2) } @@ -86,8 +104,8 @@ final class UIViewStyleableTests: XCTestCase { // It applies previously registered styles label.styles = "label-1 label-2" - XCTAssertEqual(label.backgroundColor, UIColor.yellow) - XCTAssertEqual(label.textColor, UIColor.red) + XCTAssertEqual(label.backgroundColor, .yellow) + XCTAssertEqual(label.textColor, .red) XCTAssertEqual(label.numberOfLines, 3) } @@ -95,8 +113,8 @@ final class UIViewStyleableTests: XCTestCase { // It does not apply not registered styles label.styles = "label-3 label-4" - XCTAssertEqual(label.backgroundColor, UIColor.red) - XCTAssertEqual(label.textColor, UIColor.white) + XCTAssertEqual(label.backgroundColor, .red) + XCTAssertEqual(label.textColor, .white) XCTAssertEqual(label.numberOfLines, 2) } } From fb51b2eaf68b8f4a77bcf4ef3eff41fd761ba84f Mon Sep 17 00:00:00 2001 From: Roman Podymov Date: Fri, 7 Jan 2022 00:33:13 +0100 Subject: [PATCH 3/4] Fix project file --- Fashion.xcodeproj/project.pbxproj | 128 +++++++++++++++++- .../xcschemes/Fashion-Mac.xcscheme | 10 ++ Sources/Mac/NSView+Styleable.swift | 8 +- 3 files changed, 136 insertions(+), 10 deletions(-) diff --git a/Fashion.xcodeproj/project.pbxproj b/Fashion.xcodeproj/project.pbxproj index 3f35d2e..b68ea84 100644 --- a/Fashion.xcodeproj/project.pbxproj +++ b/Fashion.xcodeproj/project.pbxproj @@ -7,6 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 9ECB95A22787B052002850D8 /* Fashion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5C629401C3A7FAA007F7B7C /* Fashion.framework */; }; + 9ECB95A52787B2F6002850D8 /* NSView+StyleableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ECB95A42787B2F6002850D8 /* NSView+StyleableTests.swift */; }; + 9ECB95A62787B347002850D8 /* NSView+Styleable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5C629841C3A893F007F7B7C /* NSView+Styleable.swift */; }; D270E9061E0062C3008E7C5F /* Fashion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D270E8FD1E0062C3008E7C5F /* Fashion.framework */; }; D270E9191E0063A7008E7C5F /* Styleable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D521588C1C95CBFC004EE4BE /* Styleable.swift */; }; D270E91A1E0063A7008E7C5F /* Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5C629861C3A89A8007F7B7C /* Style.swift */; }; @@ -51,7 +54,6 @@ D5A516DF1C98127E00B5442D /* UIView+StyleableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5A516D41C98127E00B5442D /* UIView+StyleableTests.swift */; }; D5B2E8AA1C3A780C00C0327D /* Fashion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5B2E89F1C3A780C00C0327D /* Fashion.framework */; }; D5C629831C3A892A007F7B7C /* UIView+Styleable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5C629821C3A892A007F7B7C /* UIView+Styleable.swift */; }; - D5C629851C3A893F007F7B7C /* NSView+Styleable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5C629841C3A893F007F7B7C /* NSView+Styleable.swift */; }; D5C629871C3A89A8007F7B7C /* Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5C629861C3A89A8007F7B7C /* Style.swift */; }; D5C629881C3A89A8007F7B7C /* Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5C629861C3A89A8007F7B7C /* Style.swift */; }; D5CD50E21D9DB8DA0031C666 /* Swizzler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5CD50E11D9DB8DA0031C666 /* Swizzler.swift */; }; @@ -61,6 +63,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 9ECB959F2787B03F002850D8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D5B2E8961C3A780C00C0327D /* Project object */; + proxyType = 1; + remoteGlobalIDString = D5C6293F1C3A7FAA007F7B7C; + remoteInfo = "Fashion-Mac"; + }; D270E9071E0062C3008E7C5F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D5B2E8961C3A780C00C0327D /* Project object */; @@ -78,6 +87,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 9ECB959C2787AF64002850D8 /* Fashion-Mac-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Fashion-Mac-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 9ECB95A42787B2F6002850D8 /* NSView+StyleableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSView+StyleableTests.swift"; sourceTree = ""; }; D270E8FD1E0062C3008E7C5F /* Fashion.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Fashion.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D270E9051E0062C3008E7C5F /* Fashion-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Fashion-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D270E9141E006321008E7C5F /* Info-tvOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = ""; }; @@ -115,6 +126,14 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 9ECB95962787AF64002850D8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9ECB95A22787B052002850D8 /* Fashion.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D270E8F91E0062C3008E7C5F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -155,6 +174,21 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 9ECB95A12787B052002850D8 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; + 9ECB95A32787B2F6002850D8 /* Mac */ = { + isa = PBXGroup; + children = ( + 9ECB95A42787B2F6002850D8 /* NSView+StyleableTests.swift */, + ); + path = Mac; + sourceTree = ""; + }; C79AC60D2559865D003DF3A7 /* Tests */ = { isa = PBXGroup; children = ( @@ -176,8 +210,9 @@ D5A516C71C98127E00B5442D /* FashionTests */ = { isa = PBXGroup; children = ( - D5A516E01C98129500B5442D /* Supporting Files */, D5A516CA1C98127E00B5442D /* iOS */, + 9ECB95A32787B2F6002850D8 /* Mac */, + D5A516E01C98129500B5442D /* Supporting Files */, ); path = FashionTests; sourceTree = ""; @@ -225,6 +260,7 @@ D5A516C21C98125100B5442D /* Fashion */, C79AC60D2559865D003DF3A7 /* Tests */, D5B2E8A01C3A780C00C0327D /* Products */, + 9ECB95A12787B052002850D8 /* Frameworks */, ); sourceTree = ""; }; @@ -236,6 +272,7 @@ D5C629401C3A7FAA007F7B7C /* Fashion.framework */, D270E8FD1E0062C3008E7C5F /* Fashion.framework */, D270E9051E0062C3008E7C5F /* Fashion-tvOSTests.xctest */, + 9ECB959C2787AF64002850D8 /* Fashion-Mac-Tests.xctest */, ); name = Products; sourceTree = ""; @@ -310,6 +347,24 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 9ECB95892787AF64002850D8 /* Fashion-Mac-Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9ECB95992787AF64002850D8 /* Build configuration list for PBXNativeTarget "Fashion-Mac-Tests" */; + buildPhases = ( + 9ECB958C2787AF64002850D8 /* Sources */, + 9ECB95962787AF64002850D8 /* Frameworks */, + 9ECB95982787AF64002850D8 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 9ECB95A02787B03F002850D8 /* PBXTargetDependency */, + ); + name = "Fashion-Mac-Tests"; + productName = FashionTests; + productReference = 9ECB959C2787AF64002850D8 /* Fashion-Mac-Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; D270E8FC1E0062C3008E7C5F /* Fashion-tvOS */ = { isa = PBXNativeTarget; buildConfigurationList = D270E9121E0062C3008E7C5F /* Build configuration list for PBXNativeTarget "Fashion-tvOS" */; @@ -450,8 +505,9 @@ projectRoot = ""; targets = ( D5B2E89E1C3A780C00C0327D /* Fashion-iOS */, - D5C6293F1C3A7FAA007F7B7C /* Fashion-Mac */, D5B2E8A81C3A780C00C0327D /* Fashion-iOS-Tests */, + D5C6293F1C3A7FAA007F7B7C /* Fashion-Mac */, + 9ECB95892787AF64002850D8 /* Fashion-Mac-Tests */, D270E8FC1E0062C3008E7C5F /* Fashion-tvOS */, D270E9041E0062C3008E7C5F /* Fashion-tvOSTests */, ); @@ -459,6 +515,13 @@ /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 9ECB95982787AF64002850D8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; D270E8FB1E0062C3008E7C5F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -528,6 +591,14 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 9ECB958C2787AF64002850D8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9ECB95A52787B2F6002850D8 /* NSView+StyleableTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D270E8F81E0062C3008E7C5F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -601,13 +672,13 @@ buildActionMask = 2147483647; files = ( D52158711C94A444004EE4BE /* Stylist.swift in Sources */, - D5C629851C3A893F007F7B7C /* NSView+Styleable.swift in Sources */, D52158751C95B117004EE4BE /* StyleManaging.swift in Sources */, D5C629881C3A89A8007F7B7C /* Style.swift in Sources */, D52158781C95B369004EE4BE /* Fashion.swift in Sources */, D52158691C948CE2004EE4BE /* Stylesheet.swift in Sources */, D5F2E6A31CC98D5200D180B9 /* StringConvertible.swift in Sources */, D521588E1C95CBFC004EE4BE /* Styleable.swift in Sources */, + 9ECB95A62787B347002850D8 /* NSView+Styleable.swift in Sources */, D5CD50E31D9DB8DA0031C666 /* Swizzler.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -615,6 +686,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 9ECB95A02787B03F002850D8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D5C6293F1C3A7FAA007F7B7C /* Fashion-Mac */; + targetProxy = 9ECB959F2787B03F002850D8 /* PBXContainerItemProxy */; + }; D270E9081E0062C3008E7C5F /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = D270E8FC1E0062C3008E7C5F /* Fashion-tvOS */; @@ -628,6 +704,37 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 9ECB959A2787AF64002850D8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + INFOPLIST_FILE = "$(SRCROOT)/Tests/FashionTests/Info-Mac.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.vadymmarkov.Fashion-MacTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 9ECB959B2787AF64002850D8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + INFOPLIST_FILE = "$(SRCROOT)/Tests/FashionTests/Info-Mac.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.vadymmarkov.Fashion-MacTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; D270E90E1E0062C3008E7C5F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -687,7 +794,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_SUSPICIOUS_MOVES = YES; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "Tests/FashionTests/Info-tvOS.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Tests/FashionTests/Info-tvOS.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.vadymmarkov.Fashion-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -707,7 +814,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_SUSPICIOUS_MOVES = YES; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "Tests/FashionTests/Info-tvOS.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Tests/FashionTests/Info-tvOS.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.vadymmarkov.Fashion-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -958,6 +1065,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 9ECB95992787AF64002850D8 /* Build configuration list for PBXNativeTarget "Fashion-Mac-Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9ECB959A2787AF64002850D8 /* Debug */, + 9ECB959B2787AF64002850D8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; D270E9121E0062C3008E7C5F /* Build configuration list for PBXNativeTarget "Fashion-tvOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Fashion.xcodeproj/xcshareddata/xcschemes/Fashion-Mac.xcscheme b/Fashion.xcodeproj/xcshareddata/xcschemes/Fashion-Mac.xcscheme index 41f9337..a08a5eb 100644 --- a/Fashion.xcodeproj/xcshareddata/xcschemes/Fashion-Mac.xcscheme +++ b/Fashion.xcodeproj/xcshareddata/xcschemes/Fashion-Mac.xcscheme @@ -37,6 +37,16 @@ + + + + Date: Fri, 7 Jan 2022 00:42:02 +0100 Subject: [PATCH 4/4] TARGETED_DEVICE_FAMILY --- Fashion.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Fashion.xcodeproj/project.pbxproj b/Fashion.xcodeproj/project.pbxproj index b68ea84..9d90edc 100644 --- a/Fashion.xcodeproj/project.pbxproj +++ b/Fashion.xcodeproj/project.pbxproj @@ -802,6 +802,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Debug; @@ -821,6 +822,7 @@ SDKROOT = appletvos; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Release; @@ -996,6 +998,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; @@ -1010,6 +1013,7 @@ PRODUCT_NAME = "Fashion-Tests-iOS"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; };