Skip to content

Commit

Permalink
Fixed f*cking ghost bug with renaming generic label.
Browse files Browse the repository at this point in the history
  • Loading branch information
k-o-d-e-n committed Jun 29, 2018
1 parent a2a713b commit 19a02ca
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 158 deletions.
35 changes: 17 additions & 18 deletions CGLayout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
objects = {

/* Begin PBXAggregateTarget section */
CGLayout::CGLayoutPackageTests::ProductTarget /* CGLayoutPackageTests */ = {
"CGLayout::CGLayoutPackageTests::ProductTarget" /* CGLayoutPackageTests */ = {
isa = PBXAggregateTarget;
buildConfigurationList = OBJ_61 /* Build configuration list for PBXAggregateTarget "CGLayoutPackageTests" */;
buildPhases = (
Expand Down Expand Up @@ -39,7 +39,7 @@
OBJ_70 /* CGLayoutTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_25 /* CGLayoutTests.swift */; };
OBJ_71 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_26 /* Tests.swift */; };
OBJ_72 /* support_linux.tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_27 /* support_linux.tests.swift */; };
OBJ_74 /* CGLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CGLayout::CGLayout::Product /* CGLayout.framework */; };
OBJ_74 /* CGLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = "CGLayout::CGLayout::Product" /* CGLayout.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -60,8 +60,8 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
CGLayout::CGLayout::Product /* CGLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CGLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CGLayout::CGLayoutTests::Product /* CGLayoutTests.xctest */ = {isa = PBXFileReference; lastKnownFileType = file; path = CGLayoutTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
"CGLayout::CGLayout::Product" /* CGLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CGLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; };
"CGLayout::CGLayoutTests::Product" /* CGLayoutTests.xctest */ = {isa = PBXFileReference; lastKnownFileType = file; path = CGLayoutTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_10 /* coordinate.cglayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = coordinate.cglayout.swift; sourceTree = "<group>"; };
OBJ_11 /* core.cglayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = core.cglayout.swift; sourceTree = "<group>"; };
OBJ_12 /* deprecated.cglayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = deprecated.cglayout.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -142,8 +142,8 @@
OBJ_31 /* Products */ = {
isa = PBXGroup;
children = (
CGLayout::CGLayout::Product /* CGLayout.framework */,
CGLayout::CGLayoutTests::Product /* CGLayoutTests.xctest */,
"CGLayout::CGLayout::Product" /* CGLayout.framework */,
"CGLayout::CGLayoutTests::Product" /* CGLayoutTests.xctest */,
);
name = Products;
sourceTree = BUILT_PRODUCTS_DIR;
Expand All @@ -159,7 +159,6 @@
OBJ_30 /* Resources */,
OBJ_31 /* Products */,
);
name = "";
sourceTree = "<group>";
};
OBJ_7 /* Sources */ = {
Expand All @@ -186,7 +185,7 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
CGLayout::CGLayout /* CGLayout */ = {
"CGLayout::CGLayout" /* CGLayout */ = {
isa = PBXNativeTarget;
buildConfigurationList = OBJ_35 /* Build configuration list for PBXNativeTarget "CGLayout" */;
buildPhases = (
Expand All @@ -199,10 +198,10 @@
);
name = CGLayout;
productName = CGLayout;
productReference = CGLayout::CGLayout::Product /* CGLayout.framework */;
productReference = "CGLayout::CGLayout::Product" /* CGLayout.framework */;
productType = "com.apple.product-type.framework";
};
CGLayout::CGLayoutTests /* CGLayoutTests */ = {
"CGLayout::CGLayoutTests" /* CGLayoutTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = OBJ_66 /* Build configuration list for PBXNativeTarget "CGLayoutTests" */;
buildPhases = (
Expand All @@ -216,10 +215,10 @@
);
name = CGLayoutTests;
productName = CGLayoutTests;
productReference = CGLayout::CGLayoutTests::Product /* CGLayoutTests.xctest */;
productReference = "CGLayout::CGLayoutTests::Product" /* CGLayoutTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
CGLayout::SwiftPMPackageDescription /* CGLayoutPackageDescription */ = {
"CGLayout::SwiftPMPackageDescription" /* CGLayoutPackageDescription */ = {
isa = PBXNativeTarget;
buildConfigurationList = OBJ_55 /* Build configuration list for PBXNativeTarget "CGLayoutPackageDescription" */;
buildPhases = (
Expand Down Expand Up @@ -254,10 +253,10 @@
projectDirPath = "";
projectRoot = "";
targets = (
CGLayout::CGLayout /* CGLayout */,
CGLayout::SwiftPMPackageDescription /* CGLayoutPackageDescription */,
CGLayout::CGLayoutPackageTests::ProductTarget /* CGLayoutPackageTests */,
CGLayout::CGLayoutTests /* CGLayoutTests */,
"CGLayout::CGLayout" /* CGLayout */,
"CGLayout::SwiftPMPackageDescription" /* CGLayoutPackageDescription */,
"CGLayout::CGLayoutPackageTests::ProductTarget" /* CGLayoutPackageTests */,
"CGLayout::CGLayoutTests" /* CGLayoutTests */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -307,12 +306,12 @@
/* Begin PBXTargetDependency section */
OBJ_64 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = CGLayout::CGLayoutTests /* CGLayoutTests */;
target = "CGLayout::CGLayoutTests" /* CGLayoutTests */;
targetProxy = A43DA79D20E6CEB400EDFF46 /* PBXContainerItemProxy */;
};
OBJ_75 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = CGLayout::CGLayout /* CGLayout */;
target = "CGLayout::CGLayout" /* CGLayout */;
targetProxy = A43DA79C20E6CEB300EDFF46 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
10 changes: 4 additions & 6 deletions Example/CGLayout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
A40485A71F978A1C00DB38E4 /* CONTRIBUTING.md in Sources */ = {isa = PBXBuildFile; fileRef = A40485A61F978A1C00DB38E4 /* CONTRIBUTING.md */; };
A4232A181F82D20C00016A8A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
A4232A191F82D21100016A8A /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4579C341F59E86800893AB2 /* SecondViewController.swift */; };
A4232A1A1F82D21500016A8A /* SecondViewControllerAutolayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A43D53961F6FDEE300A92425 /* SecondViewControllerAutolayout.swift */; };
Expand All @@ -33,7 +32,6 @@
A47A6F271F5F2A3400673999 /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4579C341F59E86800893AB2 /* SecondViewController.swift */; };
A4879D0D1F93A4B400BCBF0E /* ScrollLayoutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4879D0C1F93A4B400BCBF0E /* ScrollLayoutViewController.swift */; };
A4B96E6E20D6D9CF003C7803 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4B96E6C20D6D9CF003C7803 /* Tests.swift */; };
A4DE587E20E65178002B7678 /* support_linux.tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4B96E6B20D6D9CF003C7803 /* support_linux.tests.swift */; };
A4DECF99206FFA76006933C4 /* CGLayoutTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4DECF97206FFA76006933C4 /* CGLayoutTests.swift */; };
AA207DB93A95FD0B83A04761 /* Pods_CGLayout_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18AF282E152D179C9353E356 /* Pods_CGLayout_Tests.framework */; };
B635776618CF077E9FE44524 /* Pods_CGLayout_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 229950F7B0B7736994BF5766 /* Pods_CGLayout_tvOS.framework */; };
Expand Down Expand Up @@ -798,7 +796,6 @@
A4579C351F59E86800893AB2 /* SecondViewController.swift in Sources */,
A43D53971F6FDEE300A92425 /* SecondViewControllerAutolayout.swift in Sources */,
A42E170E20B2FE1100E1985C /* LayoutViewController.swift in Sources */,
A40485A71F978A1C00DB38E4 /* CONTRIBUTING.md in Sources */,
A4879D0D1F93A4B400BCBF0E /* ScrollLayoutViewController.swift in Sources */,
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
A44646BC1F74132A009601DA /* TableViewController.swift in Sources */,
Expand All @@ -811,7 +808,6 @@
buildActionMask = 2147483647;
files = (
A47A6F271F5F2A3400673999 /* SecondViewController.swift in Sources */,
A4DE587E20E65178002B7678 /* support_linux.tests.swift in Sources */,
A4B96E6E20D6D9CF003C7803 /* Tests.swift in Sources */,
A4DECF99206FFA76006933C4 /* CGLayoutTests.swift in Sources */,
);
Expand Down Expand Up @@ -941,7 +937,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -981,7 +978,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down

This file was deleted.

16 changes: 8 additions & 8 deletions Sources/Classes/layoutGuide.cglayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,16 @@ public extension LayoutGuide {

/// Base class for any view placeholder that need dynamic position and/or size.
/// Used UIViewController pattern for loading target view, therefore will be very simply use him.
open class LayoutPlaceholder<Item: LayoutElement, Super: LayoutElement>: LayoutGuide<Super> {
open private(set) lazy var itemLayout: LayoutBlock<Item> = self.element.layoutBlock()
fileprivate var _item: Item?
open class LayoutPlaceholder<Element: LayoutElement, Super: LayoutElement>: LayoutGuide<Super> {
open private(set) lazy var itemLayout: LayoutBlock<Element> = self.element.layoutBlock()
fileprivate var _element: Element?

open var element: Item! {
open var element: Element! {
loadElementIfNeeded()
return elementIfLoaded
}
open var isElementLoaded: Bool { return _item != nil }
open var elementIfLoaded: Item? { return _item }
open var isElementLoaded: Bool { return _element != nil }
open var elementIfLoaded: Element? { return _element }

open func loadElement() {
// subclass override
Expand Down Expand Up @@ -231,7 +231,7 @@ open class LayoutPlaceholder<Item: LayoutElement, Super: LayoutElement>: LayoutG
/// Used UIViewController pattern for loading target view, therefore will be very simply use him.
open class LayerPlaceholder<Layer: CALayer>: LayoutPlaceholder<Layer, CALayer> {
open override func loadElement() {
_item = add(Layer.self)
_element = add(Layer.self)
}
}
#endif
Expand Down Expand Up @@ -259,7 +259,7 @@ open class ViewPlaceholder<View: UIView>: LayoutPlaceholder<View, UIView>, Adjus
}

open override func loadElement() {
_item = load?() ?? add(View.self)
_element = load?() ?? add(View.self)
}

open override func elementDidLoad() {
Expand Down
3 changes: 2 additions & 1 deletion Tests/CGLayoutTests/support_linux.tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import Cocoa
import Foundation
#endif

#if os(Linux)

@testable import CGLayout

/// The container does not know which child is being added,
/// but the child knows exactly where it is being added
#if os(Linux)

class ContainerEnterPoint {
func add(to view: View) {
Expand Down

0 comments on commit 19a02ca

Please sign in to comment.