Skip to content

Chore/swift package #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Package migration WIP
  • Loading branch information
shivam-heady committed Sep 10, 2024
commit 71e7d9864d8f6968dc5e24cc96a79857cabc5ab6

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

2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEPENDENCIES:
- Yoshi/QAKit (from `../`)

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
https://github.com/CocoaPods/specs.git:
- Instabug

EXTERNAL SOURCES:
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.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Yoshi",
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "Yoshi",
targets: ["Yoshi"]),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "Yoshi"
),
.testTarget(
name: "YoshiTests",
dependencies: ["Yoshi"]),
]
)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2017 Prolific Interactive. All rights reserved.
//

import UIKit

/// A normal cell data source defining the layout for YoshiMenu's cell.
/// By default it helps dequeue a system UITableViewCell with the given title, subtitle and the accessoryType.
public struct YoshiMenuCellDataSource: YoshiReusableCellDataSource {
Expand All @@ -14,14 +16,14 @@ public struct YoshiMenuCellDataSource: YoshiReusableCellDataSource {

private let subtitle: String?

private let accessoryType: UITableViewCellAccessoryType
private let accessoryType: UITableViewCell.AccessoryType

/// Initalize the YoshiMenuCellDataSource instance
///
/// - Parameters:
/// - title: Main title for the cell
/// - subtitle: Subtitle for the cell
public init(title: String, subtitle: String?, accessoryType: UITableViewCellAccessoryType = .none) {
public init(title: String, subtitle: String?, accessoryType: UITableViewCell.AccessoryType = .none) {
self.title = title
self.subtitle = subtitle
self.accessoryType = accessoryType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import UIKit

/// A submenu that contains an array of options.
/// Once selected, Yoshi will push the navigation stack to display these options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright © 2016 Prolific Interactive. All rights reserved.
//

import Foundation
import UIKit

/**
Protocol for defining a menu option for choosing a date.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright © 2017 Prolific Interactive. All rights reserved.
//

import Foundation
import UIKit

/// Cell data source defining the layout for YoshiDateSelectorMenu's cell
internal struct YoshiDateSelectorMenuCellDataSource: YoshiReusableCellDataSource {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
// Copyright © 2017 Prolific Interactive. All rights reserved.
//

import Foundation

/// A tuple with a title and an optional subtitle representing a single selection.
public typealias YoshiSingleSelection = (title: String, subtitle: String?)

/// A YoshiSubmenu implementation used to host a group of single selection.
/// Once provided with initial selection and options, Yoshi will maintain the selection and present them in a tableview.
open class YoshiSingleSelectionMenu: YoshiSubmenu {

open let title: String
public let title: String

open var subtitle: String? {
return availableSelections[selectedIndex].title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright © 2016 Prolific Interactive. All rights reserved.
//

import Foundation
import UIKit

/// Utility for retrieving items from the App Bundle
internal class AppBundleUtility: NSObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2016 Prolific Interactive. All rights reserved.
//

import UIKit

/**
A color object
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension UIWindow {
return 60
}

override open func motionBegan(_ motion: UIEventSubtype, with event: UIEvent?) {
override open func motionBegan(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
Yoshi.motionBegan(motion, withEvent: event)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2015 Prolific Interactive. All rights reserved.
//

import UIKit

/// The date picker view controller.
internal class DebugDatePickerViewController: UIViewController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2016 Prolific Interactive. All rights reserved.
//

import UIKit

internal typealias VoidCompletionBlock = () -> Void

/// A debug menu.
Expand Down
File renamed without changes.
5 changes: 4 additions & 1 deletion Yoshi/Yoshi/Yoshi.swift → Sources/Yoshi/Yoshi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright © 2015 Prolific Interactive. All rights reserved.
//

import Foundation
import UIKit

/// The Debug Menu interface.
public final class Yoshi {

Expand All @@ -29,7 +32,7 @@ public final class Yoshi {
- parameter motion: (UIEventSubtype) the motion captured by the original motionBegan call
- parameter event: (UIEvent) the event captured by the original motionBegan call
*/
public class func motionBegan(_ motion: UIEventSubtype, withEvent event: UIEvent?) {
public class func motionBegan(_ motion: UIEvent.EventSubtype, withEvent event: UIEvent?) {
guard motion == .motionShake
&& YoshiConfigurationManager.sharedInstance.shouldShow(.shakeMotionGesture) else {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2016 Prolific Interactive. All rights reserved.
//

import UIKit

/// The result types for a debug menu action.
///
/// - handled: Indicates that the action was handled and nothing else is required.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2015 Prolific Interactive. All rights reserved.
//

import UIKit

/// The configuration manager for the debug menu.
internal final class YoshiConfigurationManager {

Expand Down Expand Up @@ -54,7 +56,7 @@ internal final class YoshiConfigurationManager {
}

let window = UIWindow(frame: UIScreen.main.bounds)
window.windowLevel = UIWindowLevelNormal
window.windowLevel = UIWindow.Level.normal

// Use a dummy view controller with clear background.
// This way, we can make the actual view controller we want to present a form sheet on the iPad.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright © 2017 Prolific Interactive. All rights reserved.
//

import UIKit


/// Object helps YoshiGenericMenu define cell's UI when presented in Yoshi.
public protocol YoshiReusableCellDataSource {

Expand Down
12 changes: 12 additions & 0 deletions Tests/YoshiTests/YoshiTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import XCTest
@testable import Yoshi

final class YoshiTests: XCTestCase {
func testExample() throws {
// XCTest Documentation
// https://developer.apple.com/documentation/xctest

// Defining Test Cases and Test Methods
// https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods
}
}
12 changes: 6 additions & 6 deletions Yoshi.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "Yoshi"
s.version = "3.0.0-beta.2"
s.version = "3.1.0"
s.summary = "A helpful companion for your iOS app."

# This description is used to generate tags and improve search results.
Expand All @@ -20,19 +20,19 @@ Pod::Spec.new do |s|
Yoshi is a convenient wrapper around the UI code that is often needed for displaying debug menus. Out of the box, Yoshi provides easy-to-implement date, list and custom menus.
DESC

s.homepage = "https://github.com/prolificinteractive/Yoshi"
s.homepage = "https://github.com/makeitheady/Yoshi"
s.screenshots = "https://raw.githubusercontent.com/prolificinteractive/Yoshi/a6e85e87cbd67f2bb3bfe60157e7b13281d80f20/Images/Yoshi.png", "https://raw.githubusercontent.com/prolificinteractive/Yoshi/c66cdf8dc2ab643fe57996d20d3cd37b8b70ceff/Images/Yoshi_iPad.png"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Michael Campbell" => "[email protected]" , "Quentin Ribierre" => "[email protected]" , "Kanglei Fang" => "[email protected]" }
s.source = { :git => "https://github.com/prolificinteractive/Yoshi.git", :tag => s.version.to_s }
s.source = { :git => "https://github.com/makeitheady/Yoshi.git", :branch => "chore/swift-package" }

s.platform = :ios, '14.0'
s.platform = :ios, '12.0'
s.requires_arc = true

# Default subspec that contains all shared code files for the library
# All subspecs must declare this as a dependency.
s.subspec "Core" do |ss|
ss.source_files = "Yoshi/Yoshi/**/*.{swift}"
ss.source_files = "Sources/Yoshi/**/*.{swift}"
ss.resources = 'Yoshi/**/*.{png,jpeg,jpg,storyboard,xib}'
end

Expand All @@ -46,7 +46,7 @@ Pod::Spec.new do |s|

# Define a Cocoapods subspec
s.subspec spec[:name] do |sp|
sp.source_files = "Yoshi/#{spec[:name]}/**/*.swift"
sp.source_files = "Sources/#{spec[:name]}/**/*.swift"
sp.dependency "Yoshi/Core"
end
end
Expand Down
33 changes: 0 additions & 33 deletions Yoshi/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions Yoshi/.swiftlint.yml

This file was deleted.

Loading