Skip to content

Commit

Permalink
Support Swift Package Manager (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamanyan authored Jun 8, 2021
1 parent cbcef3c commit 3556871
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 20 deletions.
32 changes: 32 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// 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: "SwiftPageMenu",
platforms: [
.iOS(.v12),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "SwiftPageMenu",
targets: ["SwiftPageMenu"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
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: "SwiftPageMenu",
dependencies: [],
path: "Sources"),
.testTarget(
name: "SwiftPageMenuTests",
dependencies: ["SwiftPageMenu"]),
]
)
12 changes: 7 additions & 5 deletions PageMenuExample/PageMenuExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1250;
ORGANIZATIONNAME = Tamanyan;
TargetAttributes = {
23C1D23A1E73099D00A4A491 = {
Expand Down Expand Up @@ -288,6 +288,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -312,7 +313,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -348,6 +349,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -366,7 +368,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -383,7 +385,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = XRWP5VMS4D;
INFOPLIST_FILE = PageMenuExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tamanyan.SwiftPageMenu.PageMenuExample;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -398,7 +400,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = XRWP5VMS4D;
INFOPLIST_FILE = PageMenuExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tamanyan.SwiftPageMenu.PageMenuExample;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ This library is inspired by [msaps/Pageboy](https://github.com/msaps/Pageboy), [

## Requirements

- iOS 10.0+
- Swift 4.2+
- iOS 12.0+
- Swift 5+

## How to use

Expand Down Expand Up @@ -190,6 +190,14 @@ struct RoundRectPagerOption: PageMenuOptions {
}
```

### Swift Package Manager

SwiftPageMenu is available through Swift Package Manager. Add SwiftPageMenu as a dependency to your Package.swift

```swift
.package(url: "https://github.com/tamanyan/SwiftPageMenu", from: "1.5.0")
```

### Carthage

To integrate SwiftPageMenu into your Xcode project using Carthage, specify it in your Cartfile:
Expand Down
3 changes: 2 additions & 1 deletion Sources/PageMenuControllerDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
//

import Foundation
import UIKit

@objc public protocol PageMenuControllerDataSource: class {
@objc public protocol PageMenuControllerDataSource: AnyObject {

/// The view controllers to display in the page menu view controller.
func viewControllers(forPageMenuController pageMenuController: PageMenuController) -> [UIViewController]
Expand Down
3 changes: 2 additions & 1 deletion Sources/PageMenuControllerDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
//

import Foundation
import UIKit

@objc public protocol PageMenuControllerDelegate: class {
@objc public protocol PageMenuControllerDelegate: AnyObject {

/// The page view controller will begin scrolling to a new page.
@objc optional func pageMenuController(_ pageMenuController: PageMenuController,
Expand Down
3 changes: 2 additions & 1 deletion Sources/TabMenu/TabMenuItemCursor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
//

import Foundation
import UIKit

protocol TabMenuItemCursor: class {
protocol TabMenuItemCursor: AnyObject {

var isHidden: Bool { get set }

Expand Down
1 change: 1 addition & 0 deletions Sources/Util/UIColor+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import UIKit

extension UIColor {

Expand Down
12 changes: 7 additions & 5 deletions SwiftPageMenu.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
23C1D1D91E73054600A4A491 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1250;
ORGANIZATIONNAME = Tamanyan;
TargetAttributes = {
23C1D1E11E73054600A4A491 = {
Expand All @@ -177,11 +177,11 @@
};
buildConfigurationList = 23C1D1DC1E73054600A4A491 /* Build configuration list for PBXProject "SwiftPageMenu" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
mainGroup = 23C1D1D81E73054600A4A491;
productRefGroup = 23C1D1E31E73054600A4A491 /* Products */;
Expand Down Expand Up @@ -253,6 +253,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -316,6 +317,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -358,7 +360,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SwiftPageMenu/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tamanyan.SwiftPageMenu;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -378,7 +380,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SwiftPageMenu/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tamanyan.SwiftPageMenu;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -51,8 +49,6 @@
ReferencedContainer = "container:SwiftPageMenu.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
10 changes: 10 additions & 0 deletions Tests/SwiftPageMenuTests/SwiftPageMenuTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import XCTest
@testable import SwiftPageMenu

final class SwiftPageMenuTests: XCTestCase {
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
}
}

0 comments on commit 3556871

Please sign in to comment.