Skip to content

Commit

Permalink
🛠 Migrate to Swift 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaelIsaev committed Sep 22, 2021
1 parent 216d37e commit 5587ce4
Show file tree
Hide file tree
Showing 51 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion Classes/Controllers/BaseApp/LifeCycle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit

public var Lifecycle: LifecycleBuilderProtocol { LifecycleBuilder() }

public protocol LifecycleBuilderProtocol: class, AppBuilderContent {
public protocol LifecycleBuilderProtocol: AnyObject, AppBuilderContent {
func didFinishLaunching(_ handler: @escaping () -> Void) -> Self
func willFinishLaunching(_ handler: @escaping (_ launchOptions: [UIApplication.LaunchOptionsKey: Any]) -> Bool) -> Self
func didFinishLaunching(_ handler: @escaping (_ launchOptions: [UIApplication.LaunchOptionsKey: Any]) -> Bool) -> Self
Expand Down
4 changes: 2 additions & 2 deletions Classes/Controllers/MacApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ open class App: NSApplication, NSApplicationDelegate {
// let windowsBuilderContent: WindowsBuilderItem
//}
//
//@_functionBuilder public struct WindowsBuilder {
//@resultBuilder public struct WindowsBuilder {
// public typealias Block = () -> WindowsBuilderContent
//
// public static func buildBlock() -> WindowsBuilderContent {
Expand Down Expand Up @@ -188,7 +188,7 @@ struct _AppContent: AppBuilderContent {
let appBuilderContent: AppBuilderItem
}

@_functionBuilder public struct AppBuilder {
@resultBuilder public struct AppBuilder {
public typealias Block = () -> AppBuilderContent

public static func buildBlock() -> AppBuilderContent {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controllers/Menu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct _MenuContent: MenuBuilderContent {
let menuBuilderContent: MenuBuilderItem
}

@_functionBuilder public struct MenuBuilder {
@resultBuilder public struct MenuBuilder {
public typealias Block = () -> MenuBuilderContent

public static func buildBlock() -> MenuBuilderContent {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Objects/ParagraphStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import AppKit
import UIKit
#endif

protocol ParagraphStyleDelegate: class {
protocol ParagraphStyleDelegate: AnyObject {
func onParagraphUpdate(_ p: ParagraphStyle)
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Alternateable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Alternateable: class {
public protocol Alternateable: AnyObject {
@discardableResult
func alternate() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/AnyScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if !os(macOS)
import UIKit

public protocol AnyScene: class {
public protocol AnyScene: AnyObject {
var persistentIdentifier: String { get }
var stateRestorationActivity: NSUserActivity? { get }
var userInfo: [String : Any]? { get }
Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/ArrowPositionable.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if os(macOS)
import AppKit

public protocol ArrowPositionable: class {
public protocol ArrowPositionable: AnyObject {
@discardableResult
func arrowPosition(_ value: NSPopUpButton.ArrowPosition) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/BackgroundColorable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol BackgroundColorable: class {
public protocol BackgroundColorable: AnyObject {
@discardableResult
func background(_ color: UColor) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/BezelStyleable.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if os(macOS)
import Cocoa

public protocol BezelStyleable: class {
public protocol BezelStyleable: AnyObject {
@discardableResult
func style(_ value: NSButton.BezelStyle) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Bezeledable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Bezeledable: class {
public protocol Bezeledable: AnyObject {
@discardableResult
func bezeled() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Borderedable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Borderedable: class {
public protocol Borderedable: AnyObject {
@discardableResult
func bordered() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Cellable.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public protocol Cellable: class {}
public protocol Cellable: AnyObject {}

extension Cellable {
public static var reuseIdentifier: String { String(describing: self) }
Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Colorable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Colorable: class {
public protocol Colorable: AnyObject {
@discardableResult
func color(_ color: UColor) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Continuousable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Continuousable: class {
public protocol Continuousable: AnyObject {
@discardableResult
func continuous() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/ControlStateable.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if os(macOS)
import Cocoa

public protocol ControlStateable: class {
public protocol ControlStateable: AnyObject {
@discardableResult
func state(_ value: NSControl.StateValue) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/DeclarativeProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol DeclarativeProtocol: class {
public protocol DeclarativeProtocol: AnyObject {
associatedtype V: BaseView, DeclarativeProtocol = Self

var declarativeView: V { get }
Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/EditableStackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

protocol EditableStackView: class {
protocol EditableStackView: AnyObject {
var arrangedSubviews: [BaseView] { get }
func addArrangedSubview(_ view: BaseView)
func add(arrangedView: BaseView, at index: Int)
Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Editableable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Editableable: class {
public protocol Editableable: AnyObject {
@discardableResult
func editable() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Enableable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Enableable: class {
public protocol Enableable: AnyObject {
@discardableResult
func enabled() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/FirstResponderRefusable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol FirstResponderRefusable: class {
public protocol FirstResponderRefusable: AnyObject {
@discardableResult
func refuseFirstResponder() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/FocusRingTypeable.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if os(macOS)
import AppKit

public protocol FocusRingTypeable: class {
public protocol FocusRingTypeable: AnyObject {
@discardableResult
func focusRingType(_ value: NSFocusRingType) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Fontable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Fontable: class {
public protocol Fontable: AnyObject {
@discardableResult
func font(v: UFont?) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/GestureDelegatorable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol GestureDelegatorable: class {}
public protocol GestureDelegatorable: AnyObject {}

protocol _GestureDelegatorable: GestureDelegatorable {
var _delegator: _GestureDelegator { get set }
Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/GestureRecognizerable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol GestureRecognizerable: class {
public protocol GestureRecognizerable: AnyObject {
@discardableResult
func delegate(_ v: UGestureRecognizerDelegate) -> Self
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/GestureTrackable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol GestureTrackable: class {
public protocol GestureTrackable: AnyObject {
@discardableResult
func trackState(_ action: @escaping (UGestureRecognizer.State) -> Void) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/KeyMaskable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if os(macOS)
import Cocoa

public protocol KeyMaskable: class {
public protocol KeyMaskable: AnyObject {
@discardableResult
func keyMask(_ mask: NSEvent.ModifierFlags) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Keyable.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if os(macOS)
import Cocoa

public protocol Keyable: class {
public protocol Keyable: AnyObject {
@discardableResult
func key(_ text: String) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Messageable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Messageable: class {
public protocol Messageable: AnyObject {
#if !os(macOS)
@discardableResult
func messageChangeTransition(_ value: UIView.AnimationOptions) -> Self
Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/MixedStateAllowable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol MixedStateAllowable: class {
public protocol MixedStateAllowable: AnyObject {
@discardableResult
func allowMixedState() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/MultiClickIgnorable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol MultiClickIgnorable: class {
public protocol MultiClickIgnorable: AnyObject {
@discardableResult
func ignoreMultiClick() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/NavigationControllerable.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
public protocol NavigationControllerable: class {
public protocol NavigationControllerable: AnyObject {
var isSwipeBackEnabled: Bool { get set }
}
2 changes: 1 addition & 1 deletion Classes/Protocols/Placeholderable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Placeholderable: class {
public protocol Placeholderable: AnyObject {
#if !os(macOS)
@discardableResult
func placeholderChangeTransition(_ value: UIView.AnimationOptions) -> Self
Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/PullsDownable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol PullsDownable: class {
public protocol PullsDownable: AnyObject {
@discardableResult
func pullsDown() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Refreshable.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public protocol Refreshable: class {
public protocol Refreshable: AnyObject {
func refresh()
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Secureable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Secureable: class {
public protocol Secureable: AnyObject {
@discardableResult
func secure() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Soundable.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if os(macOS)
import AppKit

public protocol Soundable: class {
public protocol Soundable: AnyObject {
@discardableResult
func sound(_ value: NSSound?) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Taggable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import AppKit
import UIKit
#endif

public protocol Taggable: class {
public protocol Taggable: AnyObject {
var tag: Int { get set }

@discardableResult
Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/TextAdjustsFontSizeable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol TextAdjustsFontSizeable: class {
public protocol TextAdjustsFontSizeable: AnyObject {
@discardableResult
func adjustsFontSizeToFitWidth() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/TextAttributesEditingAllowable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol TextAttributesEditingAllowable: class {
public protocol TextAttributesEditingAllowable: AnyObject {
@discardableResult
func allowEditingTextAttributes() -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Textable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Textable: class {
public protocol Textable: AnyObject {
#if !os(macOS)
@discardableResult
func textChangeTransition(_ value: UIView.AnimationOptions) -> Self
Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Tintable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Tintable: class {
public protocol Tintable: AnyObject {
@discardableResult
func tint(_ color: UColor) -> Self

Expand Down
2 changes: 1 addition & 1 deletion Classes/Protocols/Titleable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

public protocol Titleable: class {
public protocol Titleable: AnyObject {
#if !os(macOS)
@discardableResult
func titleChangeTransition(_ value: UIView.AnimationOptions) -> Self
Expand Down
2 changes: 1 addition & 1 deletion Classes/Structs/AppBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct _AppContent: AppBuilderContent {
let appBuilderContent: AppBuilderItem
}

@_functionBuilder public struct AppBuilder {
@resultBuilder public struct AppBuilder {
public typealias Block = () -> AppBuilderContent

public static func buildBlock() -> AppBuilderContent {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Structs/BodyBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import UIKit
@available(*, deprecated, renamed: "BodyBuilder")
public typealias ViewBuilder = BodyBuilder

@_functionBuilder public struct BodyBuilder {
@resultBuilder public struct BodyBuilder {
public typealias Result = BodyBuilderItemable
public typealias SingleView = () -> Result

Expand Down
Loading

0 comments on commit 5587ce4

Please sign in to comment.