Skip to content

Commit

Permalink
Solve conflict with Dictionary extension and update IOS 7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyli508 committed Oct 28, 2015
1 parent 1ba554f commit 02f43d3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cartography.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@
);
INFOPLIST_FILE = Cartography/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Cartography;
Expand All @@ -753,6 +754,7 @@
);
INFOPLIST_FILE = Cartography/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Cartography;
Expand Down
13 changes: 11 additions & 2 deletions Cartography/Constrain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,17 @@ public func constrain(views: [View], replace group: ConstraintGroup = Constraint
///
public func constrain<T: Hashable>(views: [T: View], replace group: ConstraintGroup = ConstraintGroup(), @noescape block: ([T : LayoutProxy] -> ())) -> ConstraintGroup {
let context = Context()
let proxies = views.map { ($0, LayoutProxy(context, $1)) }
block(Dictionary(proxies))

// this conflict with ObjectMapper Dictionary extension
// let proxies = views.map { ($0, LayoutProxy(context, $1)) }

var proxies = [T : LayoutProxy]()

for view in views {
proxies.updateValue(LayoutProxy(context, view.1), forKey: view.0)
}

block(proxies)
group.replaceConstraints(context.constraints)

return group
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Cartography :iphone::triangular_ruler:

## IOS 7 Support
This fork is mainly for IOS 7 support, for how to use Swift pods visit [IOS 7 Support](https://github.com/tonyli508/ForkmanForSwiftPodsWithIOS7)

<a href="https://travis-ci.org/robb/Cartography?branch=master">
<img src="https://travis-ci.org/robb/Cartography.svg?branch=master" hspace="6px" align="right" vspace="2px">
</a>
Expand Down

0 comments on commit 02f43d3

Please sign in to comment.