Skip to content

Commit 8e0ede1

Browse files
committed
Fixes with privateness.
1 parent 7745e75 commit 8e0ede1

File tree

10 files changed

+42
-31
lines changed

10 files changed

+42
-31
lines changed

Example/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.0</string>
18+
<string>2.0.1</string>
1919
<key>CFBundleVersion</key>
2020
<string>1</string>
2121
<key>LSRequiresIPhoneOS</key>

NKVPhonePicker.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
Pod::Spec.new do |s|
99
s.name = 'NKVPhonePicker'
10-
s.version = '2.0.0'
10+
s.version = '2.0.1'
1111
s.summary = 'A UITextField subclass to simplify the selection of country codes.'
1212
s.description = <<-DESC
1313
With this pod you can easily select country codes with just making your textFields class - the NKVPhonePickerTextField.

NKVPhonePicker.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
EB1D35E62045F3B900DC9560 /* NKVPhonePickerPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB1D35E52045F3B900DC9560 /* NKVPhonePickerPresenter.swift */; };
1111
EB1D35E82045F74400DC9560 /* CountryCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB1D35E72045F74400DC9560 /* CountryCode.swift */; };
1212
EB1D35EA2045F76C00DC9560 /* PhoneExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB1D35E92045F76C00DC9560 /* PhoneExtension.swift */; };
13+
EB1D35F520481B4E00DC9560 /* NKVSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB1D35F420481B4E00DC9560 /* NKVSource.swift */; };
1314
EB50FA291ED8506700722C25 /* Countries.bundle in Resources */ = {isa = PBXBuildFile; fileRef = EB50FA271ED8506700722C25 /* Countries.bundle */; };
1415
EB50FA2A1ED8506700722C25 /* CountriesViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EB50FA281ED8506700722C25 /* CountriesViewController.storyboard */; };
1516
EB5621461F50B3B100398954 /* TextFieldWithPattern.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5621451F50B3B100398954 /* TextFieldWithPattern.swift */; };
@@ -31,6 +32,7 @@
3132
EB1D35E52045F3B900DC9560 /* NKVPhonePickerPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NKVPhonePickerPresenter.swift; sourceTree = "<group>"; };
3233
EB1D35E72045F74400DC9560 /* CountryCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryCode.swift; sourceTree = "<group>"; };
3334
EB1D35E92045F76C00DC9560 /* PhoneExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneExtension.swift; sourceTree = "<group>"; };
35+
EB1D35F420481B4E00DC9560 /* NKVSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NKVSource.swift; sourceTree = "<group>"; };
3436
EB50FA271ED8506700722C25 /* Countries.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Countries.bundle; path = Bundle/Countries.bundle; sourceTree = "<group>"; };
3537
EB50FA281ED8506700722C25 /* CountriesViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = CountriesViewController.storyboard; path = Bundle/CountriesViewController.storyboard; sourceTree = "<group>"; };
3638
EB5621451F50B3B100398954 /* TextFieldWithPattern.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldWithPattern.swift; sourceTree = "<group>"; };
@@ -130,6 +132,7 @@
130132
EB84919D1ED435AB0069CD20 /* Country.swift */,
131133
EB1D35E72045F74400DC9560 /* CountryCode.swift */,
132134
EB1D35E92045F76C00DC9560 /* PhoneExtension.swift */,
135+
EB1D35F420481B4E00DC9560 /* NKVSource.swift */,
133136
);
134137
path = Models;
135138
sourceTree = "<group>";
@@ -236,6 +239,7 @@
236239
EB8491E71ED4370E0069CD20 /* NKVPhonePickerTextField.swift in Sources */,
237240
EB8491B01ED435AB0069CD20 /* CountriesViewController.swift in Sources */,
238241
EB5621461F50B3B100398954 /* TextFieldWithPattern.swift in Sources */,
242+
EB1D35F520481B4E00DC9560 /* NKVSource.swift in Sources */,
239243
EB8491371ED435260069CD20 /* ExampleViewController.swift in Sources */,
240244
EBD53F561ED6E64F007510E3 /* NKVPhoneFormatter.swift in Sources */,
241245
EB1D35E62045F3B900DC9560 /* NKVPhonePickerPresenter.swift in Sources */,

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
![Cocoapods](https://img.shields.io/badge/pod-available-brightgreen.svg?style=flat)
77
![Platform](https://img.shields.io/badge/platform-ios-blue.svg?style=flat)
8-
![Version](https://img.shields.io/badge/version-2.0.0-blue.svg?style=flat)
8+
![Version](https://img.shields.io/badge/version-2.0.1-blue.svg?style=flat)
99
![Swift version](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)
1010
![License](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)
1111

Sources/Helpers/NKVSourcesHelper.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,6 @@
77

88
import UIKit
99

10-
public enum NKVSource {
11-
case country(Country)
12-
case code(CountryCode)
13-
case phoneExtension(PhoneExtension)
14-
15-
init(country: Country) {
16-
self = .country(country)
17-
}
18-
19-
init(countryCode: String) {
20-
self = .code(CountryCode(countryCode))
21-
}
22-
23-
init(phoneExtension: String) {
24-
self = .phoneExtension(PhoneExtension(phoneExtension))
25-
}
26-
}
27-
2810
struct NKVSourcesHelper {
2911

3012
/// Gives the flag image, if it exists in bundle.

Sources/Main/NKVPhonePickerTextField.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ open class NKVPhonePickerTextField: TextFieldPatternFormat {
123123
super.init(frame: CGRect.zero)
124124
}
125125

126-
override init(frame: CGRect) {
126+
override public init(frame: CGRect) {
127127
super.init(frame: frame)
128128
initialize()
129129
}

Sources/Models/Country.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
import Foundation
99
import UIKit
1010

11-
public class Country: NSObject {
11+
open class Country: NSObject {
1212

1313
// MARK: - Properties
1414

1515
/// Ex: "RU"
16-
public var countryCode: String
16+
@objc public var countryCode: String
1717
/// Ex: "7"
1818
@objc public var phoneExtension: String
1919
/// Ex: "Russia"
2020
@objc public var name: String {
2121
return NKVLocalizationHelper.countryName(by: countryCode) ?? ""
2222
}
2323
/// Ex: "### ## ######"
24-
public var formatPattern: String
24+
@objc public var formatPattern: String
2525
/// A flag image for this country. May be nil.
2626
public var flag: UIImage? {
2727
return NKVSourcesHelper.flag(for: NKVSource(country: self))

Sources/Models/CountryCode.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
//
88

99
public struct CountryCode {
10-
var code: String
10+
public var code: String
1111

12-
init?(_ source: NKVSource) {
12+
public init?(_ source: NKVSource) {
1313
switch source {
1414
case .country(let country):
1515
self.code = country.countryCode
@@ -24,7 +24,7 @@ public struct CountryCode {
2424
}
2525
}
2626

27-
init(_ countryCode: String) {
27+
public init(_ countryCode: String) {
2828
self.code = countryCode
2929
}
3030
}

Sources/Models/NKVSource.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// NKVSource.swift
3+
// NKVPhonePicker
4+
//
5+
// Created by Nik Kov on 01.03.18.
6+
// Copyright © 2018 nik.kov. All rights reserved.
7+
//
8+
9+
public enum NKVSource {
10+
case country(Country)
11+
case code(CountryCode)
12+
case phoneExtension(PhoneExtension)
13+
14+
public init(country: Country) {
15+
self = .country(country)
16+
}
17+
18+
public init(countryCode: String) {
19+
self = .code(CountryCode(countryCode))
20+
}
21+
22+
public init(phoneExtension: String) {
23+
self = .phoneExtension(PhoneExtension(phoneExtension))
24+
}
25+
}

Sources/Models/PhoneExtension.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
//
88

99
public struct PhoneExtension {
10-
var phoneExtension: String
10+
public var phoneExtension: String
1111

12-
init?(source: NKVSource) {
12+
public init?(source: NKVSource) {
1313
switch source {
1414
case .country(let country):
1515
self.phoneExtension = country.phoneExtension
@@ -24,7 +24,7 @@ public struct PhoneExtension {
2424
}
2525
}
2626

27-
init(_ phoneExtension: String) {
27+
public init(_ phoneExtension: String) {
2828
self.phoneExtension = phoneExtension
2929
}
3030
}

0 commit comments

Comments
 (0)