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

Swift Package Manager compatible #59

Open
wants to merge 5 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
29 changes: 29 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// 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: "SVPinView",
platforms: [ .iOS(.v9) ],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "SVPinView",
targets: ["SVPinView"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
],
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 which this package depends on.
.target(
name: "SVPinView",
path: "SVPinView/Source",
resources: [
.process("XIB's")
]),
]
)

15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SVPinView is a light-weight customisable library used for accepting pin numbers
[![Swift 5.1](https://img.shields.io/badge/Swift-5.1-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/SVPinView.svg)](https://developer.apple.com/swift/)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Swift PM compatible](https://img.shields.io/badge/SwiftPM-compatible-4BC51D.svg?style=flat)](https://swift.org/package-manager/)
[![Platforms iOS](https://img.shields.io/badge/Platforms-iOS-lightgray.svg?style=flat)](http://www.apple.com/ios/)
[![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg?style=flat)](https://opensource.org/licenses/MIT)

Expand Down Expand Up @@ -42,6 +43,20 @@ github xornorik/SVPinView
- Add new run script (Project>Target>Build Phases>+> New run script phase) /usr/local/bin/carthage copy-frameworks
- Add Input files $(SRCROOT)/Carthage/Build/iOS/SVPinView.framework

### Swift Package Manager
Add SVPinView as dependency in your `Package.swift`

```swift
import PackageDescription

let package = Package(
name: "YourPackage",
dependencies: [
.Package(url: "https://github.com/jvigneshcs/SVPinView.git", majorVersion: 1),
]
)
```

### Manual

Clone the repo and drag files from `SVPinView/Source` folder into your Xcode project.
Expand Down
2 changes: 1 addition & 1 deletion SVPinView/Source/Classes/SVPinView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class SVPinView: UIView {
}

private func loadView(completionHandler: (()->())? = nil) {
let podBundle = Bundle(for: SVPinView.self)
let podBundle = Bundle.module
let nib = UINib(nibName: "SVPinView", bundle: podBundle)
view = nib.instantiate(withOwner: self, options: nil)[0] as? UIView

Expand Down
2 changes: 1 addition & 1 deletion SVPinView/Source/XIB's/SVPinCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<view tag="51" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GTy-zr-AYb" userLabel="Container View">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" tag="100" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3uN-C8-dyg" customClass="SVPinField" customModule="SVPinView" customModuleProvider="target">
<textField opaque="NO" clipsSubviews="YES" tag="100" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3uN-C8-dyg" customClass="SVPinField" customModule="SVPinView">
<rect key="frame" x="0.0" y="0.0" width="50" height="47"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<textInputTraits key="textInputTraits"/>
Expand Down