mirror of
https://github.com/exyte/Macaw.git
synced 2024-09-11 05:05:23 +03:00
Merge pull request #556 from amarunko/swift_5_initializers_fix
Swift 5 initializers fix
This commit is contained in:
commit
669161a3a0
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="pJi-Pa-uLB">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="pJi-Pa-uLB">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
|
@ -1,10 +1,6 @@
|
||||
// TODO: Implement better hash
|
||||
|
||||
extension Node: Hashable {
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(Unmanaged.passUnretained(self).toOpaque())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public func == (lhs: Node, rhs: Node) -> Bool {
|
||||
return lhs === rhs
|
||||
|
@ -1,4 +1,6 @@
|
||||
open class Drawable {
|
||||
import Foundation
|
||||
|
||||
open class Drawable: NSObject {
|
||||
|
||||
public let visible: Bool
|
||||
public let tag: [String]
|
||||
|
@ -307,4 +307,18 @@ open class Node: Drawable {
|
||||
return .none
|
||||
}
|
||||
|
||||
// MARK: - Hash
|
||||
|
||||
override open var hash: Int {
|
||||
var hasher = Hasher()
|
||||
hasher.combine(Unmanaged.passUnretained(self).toOpaque())
|
||||
return hasher.finalize()
|
||||
}
|
||||
|
||||
override open func isEqual(_ object: Any?) -> Bool {
|
||||
guard let object = object as? Node else {
|
||||
return false
|
||||
}
|
||||
return Unmanaged.passUnretained(self).toOpaque() == Unmanaged.passUnretained(object).toOpaque()
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ open class SVGView: MacawView {
|
||||
self.node = node
|
||||
}
|
||||
|
||||
override public init?(node: Node, coder aDecoder: NSCoder) {
|
||||
@objc override public init?(node: Node, coder aDecoder: NSCoder) {
|
||||
super.init(node: node, coder: aDecoder)
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ open class MacawView: MView, MGestureRecognizerDelegate {
|
||||
}
|
||||
#endif
|
||||
|
||||
public init?(node: Node, coder aDecoder: NSCoder) {
|
||||
@objc public init?(node: Node, coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
|
||||
initializeView()
|
||||
@ -132,7 +132,7 @@ open class MacawView: MView, MGestureRecognizerDelegate {
|
||||
initializeView()
|
||||
}
|
||||
|
||||
public convenience required init?(coder aDecoder: NSCoder) {
|
||||
@objc public convenience required init?(coder aDecoder: NSCoder) {
|
||||
self.init(node: Group(), coder: aDecoder)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user