Skip to content

Commit

Permalink
Swift 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Pchelnikov committed May 19, 2019
1 parent 42c3464 commit 48a4c06
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 20 deletions.
5 changes: 3 additions & 2 deletions MarkerKit.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
Pod::Spec.new do |s|
s.name = 'MarkerKit'
s.version = '1.3.0'
s.version = '1.4.0'
s.summary = 'Lightweight and easy to use wrapper for Auto Layout Constraints'
s.homepage = 'https://github.com/pchelnikov/MarkerKit'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Michael Pchelnikov' => 'm.pchelnikov@gmail.com' }
s.source = { :git => 'https://github.com/pchelnikov/MarkerKit.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/pchelnikov'

s.ios.deployment_target = '8.0'
s.swift_version = '4.2'
s.swift_version = '5.0'
s.source_files = 'Sources/MarkerKit.swift'
end
22 changes: 15 additions & 7 deletions MarkerKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0920;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Michael Pchelnikov";
TargetAttributes = {
C6C5CC931FF3E01000834B1B = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
C6C5CCA71FF3E01000834B1B = {
Expand All @@ -227,6 +228,7 @@
};
C6D1794B1FF6557800D0FE3A = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -340,13 +342,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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;
Expand Down Expand Up @@ -380,6 +384,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -397,13 +402,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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;
Expand All @@ -429,6 +436,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -444,7 +452,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.pchelnikov.MarkerKitiOSExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -460,7 +468,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.pchelnikov.MarkerKitiOSExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -476,7 +484,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.pchelnikov.MarkerKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOSExample.app/iOSExample";
};
Expand All @@ -493,7 +501,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.pchelnikov.MarkerKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOSExample.app/iOSExample";
};
Expand All @@ -517,7 +525,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.pchelnikov.MarkerKit;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -542,7 +550,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.pchelnikov.MarkerKit;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
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 = "0920"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
108 changes: 108 additions & 0 deletions MarkerKit.xcodeproj/xcshareddata/xcschemes/iOSExample.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C6C5CC931FF3E01000834B1B"
BuildableName = "iOSExample.app"
BlueprintName = "iOSExample"
ReferencedContainer = "container:MarkerKit.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C6C5CCA71FF3E01000834B1B"
BuildableName = "MarkerKitTests.xctest"
BlueprintName = "MarkerKitTests"
ReferencedContainer = "container:MarkerKit.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C6C5CC931FF3E01000834B1B"
BuildableName = "iOSExample.app"
BlueprintName = "iOSExample"
ReferencedContainer = "container:MarkerKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C6C5CC931FF3E01000834B1B"
BuildableName = "iOSExample.app"
BlueprintName = "iOSExample"
ReferencedContainer = "container:MarkerKit.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C6C5CC931FF3E01000834B1B"
BuildableName = "iOSExample.app"
BlueprintName = "iOSExample"
ReferencedContainer = "container:MarkerKit.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion MarkerKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<string>1.4</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
4 changes: 1 addition & 3 deletions MarkerKitTests/MarkerKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class MarkerKitTests: XCTestCase {

v2.mrk.fillSuperview()

debugPrint("COUNT: \(self.containerView.constraints.count)")

XCTAssertEqual(self.containerView.constraints.count , 6, "Should have 6 constraints installed")
XCTAssertEqual(self.containerView.constraints.count, 10, "Should have 10 constraints installed")
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ A lightweight and easy to use wrapper for Auto Layout Constraints (iOS 8+ suppor
## Requirements

- iOS 8.0+
- Xcode 9.0+
- Swift 4.0+
- Xcode 10.2+
- Swift 5.0+

## Installation

Expand Down
4 changes: 2 additions & 2 deletions Sources/MarkerKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import UIKit
public typealias MarkerView = UIView

public extension MarkerView {
public var mrk: MarkerConstraintView {
var mrk: MarkerConstraintView {
return MarkerConstraintView(view: self)
}
}
Expand All @@ -39,7 +39,7 @@ public extension MarkerConstraintView {
//MARK: convinient extensions

@discardableResult
public func fillSuperview(_ edges: UIEdgeInsets = UIEdgeInsets.zero, usingSafeArea: Bool = true) -> [NSLayoutConstraint] {
func fillSuperview(_ edges: UIEdgeInsets = UIEdgeInsets.zero, usingSafeArea: Bool = true) -> [NSLayoutConstraint] {
var constraints: [NSLayoutConstraint] = []

if let superview = self.view.superview {
Expand Down
2 changes: 1 addition & 1 deletion iOS-Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<string>1.4</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
3 changes: 2 additions & 1 deletion iOS-Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ class ViewController: UIViewController {
}

private func setupConstraints() {

let viewSafeArea: Any = {
if #available(iOS 11.0, *) {
return view.safeAreaLayoutGuide
} else {
return view
return view!
}
}()

Expand Down

0 comments on commit 48a4c06

Please sign in to comment.