Skip to content

Commit

Permalink
Merge pull request #19 from emirandm/master
Browse files Browse the repository at this point in the history
SPM Support
  • Loading branch information
bradhilton authored Nov 9, 2020
2 parents 333a44f + dc44ab2 commit f889574
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 10 deletions.
33 changes: 33 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Swiftstraints",
platforms: [.iOS(.v9), .tvOS(.v9)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "Swiftstraints",
targets: ["Swiftstraints"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "Swiftstraints",
dependencies: [],
path: "Sources",
exclude: ["Info.plist"]
),
.testTarget(
name: "SwiftstraintsTests",
dependencies: ["Swiftstraints"],
path: "Tests"),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import UIKit

@available(iOS 9.0, *)
public protocol AxisAnchor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import UIKit

@available(iOS 9.0, *)
public protocol DimensionAnchor {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2016 Skyvive. All rights reserved.
//

import UIKit

public enum LayoutPriority {

case required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2016 Skyvive. All rights reserved.
//

import UIKit

extension NSLayoutConstraint {

func priority(_ priority: LayoutPriority) -> Self {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import UIKit

private func vflKey(_ object: AnyObject) -> String {
return "A\(UInt(bitPattern: Unmanaged.passUnretained(object).toOpaque().hashValue))B"
Expand Down
2 changes: 1 addition & 1 deletion Swiftstraints.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Swiftstraints"
s.version = "5.0.0"
s.version = "5.1.0"
s.summary = "Auto Layout Made Easy"
s.description = <<-DESC
Write auto layout constraints in a single line of code.
Expand Down
32 changes: 24 additions & 8 deletions Swiftstraints.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@
A2611A661B01B2980032CB53 = {
isa = PBXGroup;
children = (
C79AC63025599BBE003DF3A7 /* Sources */,
C79AC63125599BCD003DF3A7 /* Tests */,
A2C4CA0D1B02865C00A4DC56 /* Swiftstraints.podspec */,
A2611A721B01B2980032CB53 /* Swiftstraints */,
A2611A7F1B01B2980032CB53 /* SwiftstraintsTests */,
A2611A711B01B2980032CB53 /* Products */,
);
sourceTree = "<group>";
Expand Down Expand Up @@ -144,6 +144,22 @@
name = "Supporting Files";
sourceTree = "<group>";
};
C79AC63025599BBE003DF3A7 /* Sources */ = {
isa = PBXGroup;
children = (
A2611A721B01B2980032CB53 /* Swiftstraints */,
);
path = Sources;
sourceTree = "<group>";
};
C79AC63125599BCD003DF3A7 /* Tests */ = {
isa = PBXGroup;
children = (
A2611A7F1B01B2980032CB53 /* SwiftstraintsTests */,
);
path = Tests;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -458,7 +474,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Swiftstraints/Info.plist;
INFOPLIST_FILE = Sources/Swiftstraints/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand All @@ -480,7 +496,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Swiftstraints/Info.plist;
INFOPLIST_FILE = Sources/Swiftstraints/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand All @@ -500,7 +516,7 @@
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = SwiftstraintsTests/Info.plist;
INFOPLIST_FILE = Tests/SwiftstraintsTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.skyvive.$(PRODUCT_NAME:rfc1034identifier)";
Expand All @@ -513,7 +529,7 @@
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = "";
INFOPLIST_FILE = SwiftstraintsTests/Info.plist;
INFOPLIST_FILE = Tests/SwiftstraintsTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.skyvive.$(PRODUCT_NAME:rfc1034identifier)";
Expand All @@ -532,7 +548,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Swiftstraints/Info.plist;
INFOPLIST_FILE = Sources/Swiftstraints/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand All @@ -557,7 +573,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Swiftstraints/Info.plist;
INFOPLIST_FILE = Sources/Swiftstraints/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
// Created by Bradley Hilton on 5/11/15.
// Copyright (c) 2015 Skyvive. All rights reserved.
//
#if canImport(UIKit)

import UIKit
import XCTest
import Swiftstraints
@testable import Swiftstraints

func == (lh: NSLayoutConstraint, rh: NSLayoutConstraint) -> Bool {
return lh.firstItem === rh.firstItem &&
Expand Down Expand Up @@ -139,3 +140,4 @@ class SwiftstraintsTests: XCTestCase {
}

}
#endif

0 comments on commit f889574

Please sign in to comment.