Skip to content

Commit

Permalink
Merge pull request #15 from rosberry/swift-package-compatibility
Browse files Browse the repository at this point in the history
Swift package compatibility
  • Loading branch information
ntunin committed Oct 17, 2022
2 parents a97ceec + a2c36ee commit 4743eb2
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 65 deletions.
Binary file added .DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Deboogger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
2EED8CC52386421E00738BD8 /* PluginItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EED8CC42386421E00738BD8 /* PluginItem.swift */; };
2EED8CC92386445E00738BD8 /* NavigationPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EED8CC82386445E00738BD8 /* NavigationPlugin.swift */; };
629A64CAA8FD70B7A8258DD6 /* DebooggerButtonPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 629A6A2E6D28EB4A26442696 /* DebooggerButtonPlugin.swift */; };
629A65CBC829B940726B0CD3 /* UIWindow+Deboogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 629A65FCE423F310729E625C /* UIWindow+Deboogger.h */; };
629A673D3EBDAFECC1593719 /* UIWindow+Deboogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 629A6936E1B391DE557214E9 /* UIWindow+Deboogger.swift */; };
629A6C724D7EE0C256CD9035 /* UIWindow+Deboogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 629A63D44E7C17FA7B5D3789 /* UIWindow+Deboogger.m */; };
840870401FD7B238007741AB /* SegmentTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840870351FD7B237007741AB /* SegmentTableViewCell.swift */; };
840870421FD7B238007741AB /* DescriptionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840870381FD7B237007741AB /* DescriptionTableViewCell.swift */; };
840870441FD7B238007741AB /* SwitchTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8408703B1FD7B238007741AB /* SwitchTableViewCell.swift */; };
Expand Down Expand Up @@ -55,8 +53,6 @@
2EED8CA5238512A400738BD8 /* SectionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionTableViewCell.swift; sourceTree = "<group>"; };
2EED8CC42386421E00738BD8 /* PluginItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginItem.swift; sourceTree = "<group>"; };
2EED8CC82386445E00738BD8 /* NavigationPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationPlugin.swift; sourceTree = "<group>"; };
629A63D44E7C17FA7B5D3789 /* UIWindow+Deboogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWindow+Deboogger.m"; sourceTree = "<group>"; };
629A65FCE423F310729E625C /* UIWindow+Deboogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWindow+Deboogger.h"; sourceTree = "<group>"; };
629A6936E1B391DE557214E9 /* UIWindow+Deboogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIWindow+Deboogger.swift"; sourceTree = "<group>"; };
629A6A2E6D28EB4A26442696 /* DebooggerButtonPlugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DebooggerButtonPlugin.swift; sourceTree = "<group>"; };
840870351FD7B237007741AB /* SegmentTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SegmentTableViewCell.swift; sourceTree = "<group>"; };
Expand Down
Binary file added Example/.DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion Example/DebooggerExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
]

if let window = window {
Deboogger.configure(with: sectionTree, window: window)
Deboogger.configure(with: sectionTree,
gesture: .init(numberOfTouches: 2, numberOfTaps: 2),
window: window)
}

return true
Expand Down
24 changes: 24 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Deboogger",
platforms: [.iOS(.v11)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "Deboogger",
targets: ["Deboogger"]),
],
dependencies: [
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "Deboogger",
path: "Sources"),
]
)
3 changes: 3 additions & 0 deletions Sources/Deboogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ public final class Deboogger {
private func setup(_ gesture: DebooggerGesture) {
self.gesture = gesture
for window in UIApplication.shared.windows {
if window.debooggerGestureRecognizer == nil {
window.setupGestureRecognizer()
}
if let recognizer = window.debooggerGestureRecognizer {
setup(recognizer, with: gesture)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/DefaultPlugins/DebooggerButtonPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) 2019 Rosberry. All rights reserved.
//

import Foundation
import UIKit

final class DebooggerButtonPlugin: SwitchPlugin {

Expand Down
2 changes: 1 addition & 1 deletion Sources/DefaultPlugins/SectionPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public final class SectionPlugin: NavigationPlugin {
}
}

@_functionBuilder
@resultBuilder
public struct SectionPluginsBuilder {

public static func buildBlock(_ plugins: Plugin...) -> [Plugin] {
Expand Down
11 changes: 0 additions & 11 deletions Sources/Extensions/UIWindow+Deboogger.h

This file was deleted.

43 changes: 0 additions & 43 deletions Sources/Extensions/UIWindow+Deboogger.m

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/Extensions/UIWindow+Deboogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extension UIWindow {
}
}

@objc private func setupGestureRecognizer() {
func setupGestureRecognizer() {
#if targetEnvironment(simulator)
return
#endif
Expand Down
2 changes: 2 additions & 0 deletions Sources/PerformanceMonitor/PerformanceMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright © 2019 Rosberry. All rights reserved.
//

import UIKit

typealias MemoryUsage = (used: UInt64, total: UInt64)

final class PerformanceMonitor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright © 2019 Rosberry. All rights reserved.
//

import UIKit

final class PerformanceMonitorPlugin: SwitchPlugin {

var isOn: Bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// Copyright © 2019 Rosberry. All rights reserved.
//

import UIKit

protocol ConfigurationDelegate: class {
func configuration(_ sender: Configuration, didRequest childConfiguration: Configuration, withTitle title: String?)
}
Expand All @@ -12,5 +14,5 @@ protocol Configuration: UITableViewDataSource, UITableViewDelegate {
var delegate: ConfigurationDelegate? { get set }

var tableView: UITableView? { get set }
func configure()
func configure()
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// Copyright © 2020 Nikita Ermolenko. All rights reserved.
//

import Foundation

final class FavoriteService {

enum NotificationName {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright © 2019 Rosberry. All rights reserved.
//

import Foundation
import UIKit

final class SectionsConfiguration: NSObject, Configuration {

Expand Down
2 changes: 1 addition & 1 deletion Sources/Plugins/SliderPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright © 2019 Rosberry. All rights reserved.
//

import Foundation
import UIKit
import ObjectiveC

public protocol SliderPlugin: TextPlugin {
Expand Down
2 changes: 2 additions & 0 deletions Sources/Plugins/TextFieldPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright © 2020 Rosberry. All rights reserved.
//

import UIKit

public protocol TextFieldPlugin: Plugin {

var placeholder: String { get }
Expand Down

0 comments on commit 4743eb2

Please sign in to comment.