Permalink
Browse files

Migrate to Swift 4.2

  • Loading branch information...
danielsaidi committed Sep 25, 2018
1 parent d44167c commit 52cdc2fe442d55e4b4d89b4a5bfa2da6cdbe0e7d
@@ -1 +1 @@
4.0
4.2
@@ -15,6 +15,8 @@ excluded:
variable_name:
excluded:
- id
- ok
- vc
- x
- y
@@ -2,7 +2,7 @@
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage
osx_image: xcode9
osx_image: xcode10
language: swift
before_install:
@@ -1,2 +1,2 @@
github "Quick/Nimble" "v7.0.3"
github "Quick/Quick" "v1.2.0"
github "Quick/Nimble" "v7.3.1"
github "Quick/Quick" "v1.3.2"
@@ -7,6 +7,12 @@ minor version bumps, but not on revision bumps.
## 1.2.2
This version migrates `Tutti` to Swift 4.2 and makes it Xcode 10 ready.
## 1.2.1
In this version, the previously `public` standard deferred classes are now `open`
@@ -572,20 +572,22 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0910;
LastUpgradeCheck = 0910;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Daniel Saidi";
TargetAttributes = {
4537E87D1FD3DF950007501C = {
CreatedOnToolsVersion = 9.1;
LastSwiftMigration = 0910;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
4537E88C1FD3DFAC0007501C = {
CreatedOnToolsVersion = 9.1;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
4537E8A21FD3DFC40007501C = {
CreatedOnToolsVersion = 9.1;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
TestTargetID = 4537E88C1FD3DFAC0007501C;
};
@@ -785,13 +787,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;
@@ -845,13 +849,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;
@@ -902,7 +908,7 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
@@ -924,7 +930,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.danielsaidi.Tutti;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
@@ -944,7 +950,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.danielsaidi.TuttiExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
@@ -964,7 +970,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.danielsaidi.TuttiExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
@@ -983,7 +989,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.danielsaidi.TuttiTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TuttiExample.app/TuttiExample";
};
@@ -1003,7 +1009,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.danielsaidi.TuttiTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TuttiExample.app/TuttiExample";
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -70,7 +69,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -80,9 +80,8 @@ public extension CalloutView {
- parameter delegate: The delegate.
*/
public class func show(animated: Bool = true, forView view: UIView, withinSuperview superview: UIView? = nil, text: String, preferences: Preferences = CalloutView.globalPreferences, delegate: CalloutViewDelegate? = nil) {
let ev = CalloutView(text: text, preferences: preferences, delegate: delegate)
ev.show(animated: animated, forView: view, withinSuperview: superview)
let calloutView = CalloutView(text: text, preferences: preferences, delegate: delegate)
calloutView.show(animated: animated, forView: view, withinSuperview: superview)
}
// MARK: - Instance methods -
@@ -252,12 +251,12 @@ open class CalloutView: UIView {
fileprivate weak var delegate: CalloutViewDelegate?
fileprivate var arrowTip = CGPoint.zero
fileprivate(set) open var preferences: Preferences
open let text: String
public let text: String
// MARK: - Lazy variables -
fileprivate lazy var textSize: CGSize = { [unowned self] in
var attributes = [NSAttributedStringKey.font: self.preferences.drawing.font]
var attributes = [NSAttributedString.Key.font: self.preferences.drawing.font]
var textSize = self.text.boundingRect(with: CGSize(width: self.preferences.positioning.maxWidth, height: CGFloat.greatestFiniteMagnitude), options: NSStringDrawingOptions.usesLineFragmentOrigin, attributes: attributes, context: nil).size
textSize.width = ceil(textSize.width)
textSize.height = ceil(textSize.height)
@@ -276,7 +275,7 @@ open class CalloutView: UIView {
// MARK: - Static variables
open static var globalPreferences = Preferences()
public static var globalPreferences = Preferences()
// MARK: - Initializer
@@ -290,7 +289,7 @@ open class CalloutView: UIView {
super.init(frame: CGRect.zero)
self.backgroundColor = UIColor.clear
NotificationCenter.default.addObserver(self, selector: #selector(handleRotation), name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleRotation), name: UIDevice.orientationDidChangeNotification, object: nil)
}
deinit {
@@ -519,7 +518,7 @@ open class CalloutView: UIView {
paragraphStyle.alignment = preferences.drawing.textAlignment
paragraphStyle.lineBreakMode = NSLineBreakMode.byWordWrapping
let textRect = CGRect(x: bubbleFrame.origin.x + (bubbleFrame.size.width - textSize.width) / 2, y: bubbleFrame.origin.y + (bubbleFrame.size.height - textSize.height) / 2, width: textSize.width, height: textSize.height)
text.draw(in: textRect, withAttributes: [NSAttributedStringKey.font: preferences.drawing.font, NSAttributedStringKey.foregroundColor: preferences.drawing.foregroundColor, NSAttributedStringKey.paragraphStyle: paragraphStyle])
text.draw(in: textRect, withAttributes: [NSAttributedString.Key.font: preferences.drawing.font, NSAttributedString.Key.foregroundColor: preferences.drawing.foregroundColor, NSAttributedString.Key.paragraphStyle: paragraphStyle])
}
override open func draw(_ rect: CGRect) {

0 comments on commit 52cdc2f

Please sign in to comment.