Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #106 from natmark/support-swift-4.2
Browse files Browse the repository at this point in the history
Support swift 4.2
  • Loading branch information
natmark authored Nov 30, 2018
2 parents 7730d13 + 6da41b9 commit a3847be
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.2
4.2.1
2 changes: 1 addition & 1 deletion ProcessingKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ProcessingKit"
s.version = "1.2.0"
s.version = "1.3.0"
s.summary = "Visual Designing library for iOS."
s.description = <<-DESC
ProcessingKit is a Visual Designing library for iOS.
Expand Down
20 changes: 10 additions & 10 deletions ProcessingKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -931,7 +931,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -945,7 +945,7 @@
PRODUCT_BUNDLE_IDENTIFIER = io.github.natmark.ProcessingKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -959,7 +959,7 @@
PRODUCT_BUNDLE_IDENTIFIER = io.github.natmark.ProcessingKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -984,7 +984,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1008,7 +1008,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down Expand Up @@ -1042,7 +1042,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand Down Expand Up @@ -1076,7 +1076,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down Expand Up @@ -1109,7 +1109,7 @@
PRODUCT_NAME = ProcessingKit;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand Down Expand Up @@ -1142,7 +1142,7 @@
PRODUCT_NAME = ProcessingKit;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion ProcessingKit/Core/Extensions/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Cocoa
extension String {
func height(withConstrainedWidth width: CGFloat, font: UIFont) -> CGFloat {
let constraintRect = CGSize(width: width, height: .greatestFiniteMagnitude)
let boundingBox = self.boundingRect(with: constraintRect, options: .usesLineFragmentOrigin, attributes: [NSAttributedStringKey.font: font], context: nil)
let boundingBox = self.boundingRect(with: constraintRect, options: .usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font: font], context: nil)

return ceil(boundingBox.height)
}
Expand Down
2 changes: 1 addition & 1 deletion ProcessingKit/Core/Input/Gesture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum GestureEvent {
case didTap
case didRelease
case didDrag
case didSwipe(direction: UISwipeGestureRecognizerDirection)
case didSwipe(direction: UISwipeGestureRecognizer.Direction)
case didPinch(scale: CGFloat, velocity: CGFloat)
case didRotate(rotation: CGFloat, velocity: CGFloat)
case didLongPress
Expand Down
4 changes: 2 additions & 2 deletions ProcessingKit/Core/Typography/Text.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public struct TextModel: TextModelContract {
let paragraph = NSMutableParagraphStyle()
paragraph.alignment = self.textComponents.textAlignX

let attributes: [NSAttributedStringKey: Any] = [NSAttributedStringKey.paragraphStyle: paragraph]
let attributes: [NSAttributedString.Key: Any] = [NSAttributedString.Key.paragraphStyle: paragraph]

let attrString = NSMutableAttributedString(string: str, attributes: attributes)

Expand All @@ -96,7 +96,7 @@ public struct TextModel: TextModelContract {
}

public func textWidth(_ str: String) -> CGFloat {
let size = str.size(withAttributes: [NSAttributedStringKey.font: self.textComponents.textFont])
let size = str.size(withAttributes: [NSAttributedString.Key.font: self.textComponents.textFont])
return size.width
}

Expand Down
2 changes: 1 addition & 1 deletion ProcessingKit/ProcessingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Cocoa
@objc optional func didTap()
@objc optional func didRelease()
@objc optional func didDrag() //Pan
@objc optional func didSwipe(direction: UISwipeGestureRecognizerDirection)
@objc optional func didSwipe(direction: UISwipeGestureRecognizer.Direction)
@objc optional func didPinch(scale: CGFloat, velocity: CGFloat)
@objc optional func didRotate(rotation: CGFloat, velocity: CGFloat)
@objc optional func didLongPress()
Expand Down

0 comments on commit a3847be

Please sign in to comment.