Skip to content

Commit

Permalink
Merge pull request #5 from tinkoff-mobile-tech/spm_support
Browse files Browse the repository at this point in the history
Добавлена поддержка SPM
  • Loading branch information
ovrchk authored Jan 25, 2021
2 parents ce814ab + d1ead1c commit 2228893
Show file tree
Hide file tree
Showing 48 changed files with 53 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb
TinkoffID: 67a2c6dac8becf1417311a003814b73d39b2a567
TinkoffID: ac03552becea632de0f13d9461621770444ae0b8

PODFILE CHECKSUM: d1e73e199c553c711c8552e3d915b504119d4beb

Expand Down
28 changes: 28 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// 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: "TinkoffID",
defaultLocalization: "ru",
platforms: [.iOS(.v10)],
products: [
.library(
name: "TinkoffID",
targets: ["TinkoffID"]
),
],
targets: [
.target(
name: "TinkoffID",
dependencies: [],
path: "Sources"
),
.testTarget(
name: "TinkoffIDTests",
dependencies: ["TinkoffID"],
path: "Tests"
),
]
)
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@

## Установка

TinkoffID доступен через [CocoaPods](https://cocoapods.org). Для установки просто добавьте следующую строчку в ваш `Podfile`:
### Swift Package Manager
`TinkoffID` поддерживает Swift Package Manager. Инструкцию по настройке SPM для вашего проекта можно найти [здесь](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app).
После настройки проекта просто добавьте ссылку на репозиторий как зависимость:

```
https://github.com/tinkoff-mobile-tech/TinkoffID-iOS
```

### Cocoapods
Для установки `TinkoffID` с помощью [CocoaPods](https://cocoapods.org) необходимо добавить следующую строчку в ваш `Podfile`:

```ruby
pod 'TinkoffID'
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import UIKit

/// Роутер URL
protocol IURLRouter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
//

import Foundation
import UIKit

extension Bundle {
static var resourcesBundle: Bundle? {
let bundle = Bundle(for: TinkoffIDButton.self)

guard let resourcesBundleUrl = bundle.resourceURL?.appendingPathComponent("TinkoffIdResources.bundle") else {
return nil
}

return Bundle(url: resourcesBundleUrl)
#if SWIFT_PACKAGE
return Bundle.module
#else
return Bundle(for: TinkoffIDButton.self)
.resourceURL
.flatMap(Bundle.init(url:))
#endif
}

func imageNamed(_ name: String) -> UIImage? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import UIKit

public final class TinkoffIDBuilder {

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Dmitry on 17.12.2020.
//

import Foundation
import UIKit

final class TinkoffIDButton: UIButton {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Dmitry on 18.12.2020.
//

import Foundation
import UIKit

/// Стиль кнопки входа
public enum TinkoffIDButtonStyle {
Expand Down
6 changes: 2 additions & 4 deletions TinkoffID.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/tinkoff-mobile-tech/TinkoffID.git', :tag => s.version.to_s }
s.ios.deployment_target = '10.0'
s.swift_version = '5.0'
s.source_files = 'Development/Source/**/*'
s.resource_bundles = {
'TinkoffIdResources' => ['Development/Resources/**/*.{strings,xcassets}']
}
s.source_files = 'Sources/**/*.swift'
s.resources = 'Sources/**/*.{xcassets,lproj}'

s.test_spec 'Tests' do |test_spec|
test_spec.source_files = 'Tests/**/*.{swift}'
Expand Down

0 comments on commit 2228893

Please sign in to comment.