Skip to content
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

[Add] Package.swift #126

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion KVNProgress.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Pod::Spec.new do |s|
}

s.source_files = "KVNProgress/Classes", "KVNProgress/Classes/**/*.{h,m}", "KVNProgress/Categories", "KVNProgress/Categories/**/*.{h,m}"
s.resources = "KVNProgress/Resources/*.{png,xib}"
s.resources = "KVNProgress/*.{png,xib}"

s.frameworks = "QuartzCore", "GLKit"
s.requires_arc = true
Expand Down
8 changes: 7 additions & 1 deletion KVNProgress/Classes/KVNProgress.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,15 @@ + (KVNProgress *)sharedView
static KVNProgress *sharedView = nil;
static dispatch_once_t onceToken;

#if SWIFT_PACKAGE
NSBundle *bundle = SWIFTPM_MODULE_BUNDLE;
#else
NSBundle *bundle = [NSBundle bundleForClass:[KVNProgress class]];
#endif

dispatch_once(&onceToken, ^{
UINib *nib = [UINib nibWithNibName:@"KVNProgressView"
bundle:[NSBundle bundleForClass:[KVNProgress class]]];
bundle:bundle];
NSArray *nibViews = [nib instantiateWithOwner:self
options:0];

Expand Down
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.6
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "KVNProgress",
defaultLocalization: "en",
platforms: [.iOS(.v13)],
products: [
.library(
name: "KVNProgress",
targets: ["KVNProgress"]),
],
targets: [
.target(
name: "KVNProgress",
dependencies: [
"KVNProgressCategories",
],
path: "KVNProgress/Classes",
resources: [.process("../Resources")],
publicHeadersPath: "."
),
.target(
name: "KVNProgressCategories",
path: "KVNProgress/Categories",
publicHeadersPath: "."
),
],
swiftLanguageVersions: [.v5]
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ If you want to try it yourself, just download/checkout this repository and launc
### Source files

1. Download the [latest code version](http://github.com/kevin-hirsch/KVNProgress/archive/master.zip) or add the repository as a git submodule to your git-tracked project.
2. Drag and drop the **Classes**, **Categories** and also the **Resources** directory from the archive in your project navigator. Make sure to select *Copy items* when asked if you extracted the code archive outside of your project.
2. Drag and drop the **Classes**, **Categories** directory from the archive in your project navigator. Make sure to select *Copy items* when asked if you extracted the code archive outside of your project.
3. Include KVNProgress wherever you need it with `#import <KVNProgress/KVNProgress.h>`.

## Usage
Expand Down