Skip to content

Commit

Permalink
Merge pull request #3 from blanksblanks/master
Browse files Browse the repository at this point in the history
Version 1.1.0
  • Loading branch information
adamkaplan committed May 9, 2018
2 parents beafe9a + 44f764a commit 3452f3e
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 90 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

1.1.0 (2018-05-09)
--------------------
- Support for Swift 4 and Objective-C clients (@blanksblanks)

1.0.0 (2017-08-30)
--------------------
- Initial public release of library (@adamkaplan)
Expand Down
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ DEPENDENCIES:

EXTERNAL SOURCES:
YMTreeMap:
:path: ../
:path: "../"

SPEC CHECKSUMS:
YMTreeMap: 87470851456ee94c5a49fb9a1bcfb124de7247d8
YMTreeMap: 081acc163d168e0222a4bcaea6287be5187f6bf8

PODFILE CHECKSUM: e64f2109a76ff95ef0d9fc88ddab5cb6976da1bf

COCOAPODS: 1.3.1
COCOAPODS: 1.5.0
103 changes: 27 additions & 76 deletions Example/YMTreeMap.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@
607FACCD1AFB9204008FA782 /* Frameworks */,
607FACCE1AFB9204008FA782 /* Resources */,
C7E33BD8DFB367E03E8C8C81 /* [CP] Embed Pods Frameworks */,
8DD1673F2A0B341A281488F0 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -275,8 +274,6 @@
607FACE11AFB9204008FA782 /* Sources */,
607FACE21AFB9204008FA782 /* Frameworks */,
607FACE31AFB9204008FA782 /* Resources */,
75E5016D89016BED72A9E884 /* [CP] Embed Pods Frameworks */,
DF25CF7B0F27E22391C47D9F /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -297,7 +294,6 @@
FC0410F21F562BC500748888 /* Frameworks */,
FC0410F31F562BC500748888 /* Resources */,
BC16D2FBD9503AC4534AE389 /* [CP] Embed Pods Frameworks */,
6912D1D46BC3773781F6EA1E /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -315,18 +311,18 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0900;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "Yahoo Holdings Inc.";
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = Z38H54X949;
LastSwiftMigration = 0900;
LastSwiftMigration = 0930;
ProvisioningStyle = Automatic;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0820;
LastSwiftMigration = 0930;
TestTargetID = 607FACCF1AFB9204008FA782;
};
FC0410F41F562BC500748888 = {
Expand Down Expand Up @@ -422,56 +418,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
6912D1D46BC3773781F6EA1E /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YMTreeMap-macOS/Pods-YMTreeMap-macOS-resources.sh\"\n";
showEnvVarsInLog = 0;
};
75E5016D89016BED72A9E884 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-YMTreeMap_Tests/Pods-YMTreeMap_Tests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework",
"${BUILT_PRODUCTS_DIR}/Quick/Quick.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YMTreeMap_Tests/Pods-YMTreeMap_Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
8DD1673F2A0B341A281488F0 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YMTreeMap-iOS/Pods-YMTreeMap-iOS-resources.sh\"\n";
showEnvVarsInLog = 0;
};
A05F39751F8301430B10344F /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -526,21 +472,6 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YMTreeMap-iOS/Pods-YMTreeMap-iOS-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
DF25CF7B0F27E22391C47D9F /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YMTreeMap_Tests/Pods-YMTreeMap_Tests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -620,14 +551,22 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -667,14 +606,22 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -717,7 +664,8 @@
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "YMTreeMap/YMTreeMap-Bridging-Header.h";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -739,7 +687,8 @@
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "YMTreeMap/YMTreeMap-Bridging-Header.h";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -759,7 +708,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -775,7 +725,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -70,7 +69,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -46,7 +45,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Example/YMTreeMap/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Layout: UICollectionViewLayout {

override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
var index = 0
return rects.flatMap { (itemRect: CGRect) -> UICollectionViewLayoutAttributes? in
return rects.compactMap { (itemRect: CGRect) -> UICollectionViewLayoutAttributes? in
let attrs = rect.intersects(itemRect) ? self.layoutAttributesForItem(at: IndexPath(item: index, section: 0)) : nil
index += 1
return attrs
Expand Down
2 changes: 1 addition & 1 deletion YMTreeMap.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'YMTreeMap'
s.version = '1.0.0'
s.version = '1.1.0'
s.summary = 'A simple tree map generator for iOS and macOS.'
s.description = <<-DESC
YMTreeMap is a high performance treemap layout engine for iOS and macOS, written in Swift.
Expand Down
6 changes: 3 additions & 3 deletions YMTreeMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ import Foundation
@objc public var alignment = FrameAlignment.RetinaSubPixel

/// The tree map values provided during initialization
public let values: [Double]
@objc public let values: [Double]

lazy var allWeights: [Double] = {
@objc lazy var allWeights: [Double] = {
// Compute the total of all of the values
let total = self.values.reduce(0) { $0 + $1 }

Expand All @@ -101,7 +101,7 @@ import Foundation
/// always contain the same number of items as the `values` list provided here.
///
/// - Parameter values: A list of positive double values
public init(withValues values: [Double]) {
@objc public init(withValues values: [Double]) {
// Negative numbers are not supported or recoverable.
values.forEach { (value) in
if value < 0 {
Expand Down

0 comments on commit 3452f3e

Please sign in to comment.