1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-09-11 05:05:23 +03:00

Update macOS version to use Swift 4.2

This commit is contained in:
Yuri Strot 2018-10-04 14:43:11 +07:00
parent 34f442f11a
commit 3aa1f88605
11 changed files with 36 additions and 40 deletions

View File

@ -1679,6 +1679,9 @@
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = Exyte;
TargetAttributes = {
57614AFB1F83D15600875933 = {
LastSwiftMigration = 1000;
};
57FCD26B1D76EA4600CC0FB6 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
@ -1686,7 +1689,7 @@
57FCD2751D76EA4600CC0FB6 = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 7T95R85V93;
LastSwiftMigration = 0800;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
};
@ -2314,9 +2317,8 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = macosx;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VALID_ARCHS = "i386 x86_64";
};
name = Debug;
};
@ -2340,9 +2342,8 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = macosx;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VALID_ARCHS = "i386 x86_64";
};
name = Release;
};
@ -2405,7 +2406,6 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "x86_64 i386";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@ -2464,7 +2464,6 @@
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VALID_ARCHS = "x86_64 i386";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@ -2492,7 +2491,6 @@
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VALID_ARCHS = "arm64 armv7";
};
name = Debug;
};
@ -2518,7 +2516,6 @@
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VALID_ARCHS = "arm64 armv7";
};
name = Release;
};
@ -2539,7 +2536,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VALID_ARCHS = "x86_64 i386";
};
@ -2562,7 +2559,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VALID_ARCHS = "x86_64 i386";
};

View File

@ -160,7 +160,7 @@ class NodeBoundsTests: XCTestCase {
texts.forEach { text in
let text = Text(text: text)
let stringAttributes = [NSAttributedStringKey.font: MFont.systemFont(ofSize: MFont.systemFontSize)]
let stringAttributes = [NSAttributedString.Key.font: MFont.systemFont(ofSize: MFont.systemFontSize)]
let size = text.text.size(withAttributes: stringAttributes)
let targetRect = Rect(x: 0.0, y: 0.0, w: size.width.doubleValue, h: size.height.doubleValue)

View File

@ -12,10 +12,10 @@ import Foundation
import AppKit
public struct MCAMediaTimingFillMode {
public static let forwards = kCAFillModeForwards
public static let backwards = kCAFillModeBackwards
public static let both = kCAFillModeBoth
public static let removed = kCAFillModeRemoved
public static let forwards = CAMediaTimingFillMode.forwards
public static let backwards = CAMediaTimingFillMode.backwards
public static let both = CAMediaTimingFillMode.both
public static let removed = CAMediaTimingFillMode.removed
}
#endif

View File

@ -14,11 +14,11 @@ import Foundation
import AppKit
public struct MCAMediaTimingFunctionName {
static let linear = kCAMediaTimingFunctionDefault
static let easeIn = kCAMediaTimingFunctionEaseIn
static let easeOut = kCAMediaTimingFunctionEaseOut
static let easeInEaseOut = kCAMediaTimingFunctionEaseInEaseOut
static let `default` = kCAMediaTimingFunctionDefault
static let linear = CAMediaTimingFunctionName.default
static let easeIn = CAMediaTimingFunctionName.easeIn
static let easeOut = CAMediaTimingFunctionName.easeOut
static let easeInEaseOut = CAMediaTimingFunctionName.easeInEaseOut
static let `default` = CAMediaTimingFunctionName.default
}
#endif

View File

@ -12,11 +12,11 @@ import Foundation
import AppKit
public struct MCAShapeLayerLineCap {
static let butt = kCALineCapButt
static let round = kCALineCapRound
static let square = kCALineCapSquare
static let butt = CAShapeLayerLineCap.butt
static let round = CAShapeLayerLineCap.round
static let square = CAShapeLayerLineCap.square
static func mapToGraphics(model: LineCap) -> String {
static func mapToGraphics(model: LineCap) -> CAShapeLayerLineCap {
switch model {
case .butt:
return MCAShapeLayerLineCap.butt

View File

@ -12,11 +12,11 @@ import Foundation
import AppKit
public struct MCAShapeLayerLineJoin {
public static let miter = kCALineJoinMiter
public static let round = kCALineJoinRound
public static let bevel = kCALineJoinBevel
public static let miter = CAShapeLayerLineJoin.miter
public static let round = CAShapeLayerLineJoin.round
public static let bevel = CAShapeLayerLineJoin.bevel
static func mapToGraphics(model: LineJoin) -> String {
static func mapToGraphics(model: LineJoin) -> CAShapeLayerLineJoin {
switch model {
case .miter:
return MCAShapeLayerLineJoin.miter

View File

@ -159,7 +159,7 @@ open class Image: Node {
#if os(iOS)
return MImage(named: src)
#elseif os(OSX)
return MImage(named: NSImage.Name(rawValue: src))
return MImage(named: src)
#endif
}
}

View File

@ -30,7 +30,7 @@ public typealias MRotationGestureRecognizer = NSRotationGestureRecognizer
public typealias MScreen = NSScreen
func MDefaultRunLoopMode() -> RunLoop.Mode {
return RunLoop.Mode.defaultRunLoopMode
return RunLoop.Mode.default
}
extension MGestureRecognizer {
@ -125,7 +125,7 @@ extension NSTouch {
extension NSString {
@nonobjc
func size(attributes attrs: [NSAttributedStringKey: Any]? = nil) -> NSSize {
func size(attributes attrs: [NSAttributedString.Key: Any]? = nil) -> NSSize {
return size(withAttributes: attrs)
}
}

View File

@ -38,19 +38,19 @@ extension MBezierPath {
let type = self.element(at: i, associatedPoints: &points)
switch type {
case .moveToBezierPathElement:
case .moveTo:
path.move(to: CGPoint(x: points[0].x, y: points[0].y))
case .lineToBezierPathElement:
case .lineTo:
path.addLine(to: CGPoint(x: points[0].x, y: points[0].y))
case .curveToBezierPathElement:
case .curveTo:
path.addCurve(
to: CGPoint(x: points[2].x, y: points[2].y),
control1: CGPoint(x: points[0].x, y: points[0].y),
control2: CGPoint(x: points[1].x, y: points[1].y))
case .closePathBezierPathElement:
case .closePath:
path.closeSubpath()
}
}

View File

@ -71,7 +71,7 @@ class ImageRenderer: NodeRenderer {
#if os(iOS)
let osImage = MImage(named: image.src)
#elseif os(OSX)
let osImage = MImage(named: NSImage.Name(rawValue: image.src))
let osImage = MImage(named: image.src)
#endif
if let mImage = osImage,

View File

@ -55,9 +55,8 @@ open class SVGSerializer {
fileprivate let SVGDefaultOpacityValueAsAlpha = 1 * 255
fileprivate func tag(_ tag: String, _ args: [String: String]=[:], close: Bool = false) -> String {
let attrs = args.sorted(by: { a1, a2 -> Bool in
a1.key < a2.key
}).map { "\($0)=\"\($1)\"" }.joined(separator: " ")
let attrs = args.sorted { a1, a2 -> Bool in a1.key < a2.key }
.map { "\($0)=\"\($1)\"" }.joined(separator: " ")
let closeTag = close ? " />" : ""
return "\(tag) \(attrs) \(closeTag)"
}