Skip to content
Snippets Groups Projects
Commit 54e043db authored by Zandor Smith's avatar Zandor Smith :computer:
Browse files

Convert to a Swift Package Manager package.

parent 334102ec
No related branches found
Tags 2.0.0
1 merge request!9Draft: Convert to a Swift Package Manager package.
Showing
with 53 additions and 1358 deletions
# Created by https://www.toptal.com/developers/gitignore/api/swift,xcode,fastlane,macos,ruby,cocoapods
# Edit at https://www.toptal.com/developers/gitignore?templates=swift,xcode,fastlane,macos,ruby,cocoapods
# Created by https://www.toptal.com/developers/gitignore/api/ruby,xcode,swift,macos,fastlane,cocoapods,swiftpm,swiftpackagemanager
# Edit at https://www.toptal.com/developers/gitignore?templates=ruby,xcode,swift,macos,fastlane,cocoapods,swiftpm,swiftpackagemanager
### CocoaPods ###
## CocoaPods GitIgnore Template
......@@ -62,6 +62,10 @@ Network Trash Folder
Temporary Items
.apdisk
### macOS Patch ###
# iCloud generated files
*.icloud
### Ruby ###
*.gem
*.rbc
......@@ -118,10 +122,6 @@ build-iPhoneSimulator/
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*
### Ruby Patch ###
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*
### Swift ###
# Xcode
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
......@@ -200,22 +200,25 @@ Dependencies/
iOSInjectionProject/
### Xcode ###
# Xcode
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
### SwiftPackageManager ###
Packages
xcuserdata
*.xcodeproj
### SwiftPM ###
## Gcc Patch
/*.gcno
### Xcode ###
## Xcode 8 and earlier
### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno
**/xcshareddata/WorkspaceSettings.xcsettings
# End of https://www.toptal.com/developers/gitignore/api/swift,xcode,fastlane,macos,ruby,cocoapods
# End of https://www.toptal.com/developers/gitignore/api/ruby,xcode,swift,macos,fastlane,cocoapods,swiftpm,swiftpackagemanager
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......@@ -14,10 +14,24 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2C48A6E5FC2311EF3C228871FC6ACAF2"
BuildableName = "GeneralToolsFramework.framework"
BlueprintIdentifier = "GeneralToolsFramework"
BuildableName = "GeneralToolsFramework"
BlueprintName = "GeneralToolsFramework"
ReferencedContainer = "container:Pods.xcodeproj">
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GeneralToolsFrameworkTests"
BuildableName = "GeneralToolsFrameworkTests"
BlueprintName = "GeneralToolsFrameworkTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
......@@ -28,6 +42,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GeneralToolsFrameworkTests"
BuildableName = "GeneralToolsFrameworkTests"
BlueprintName = "GeneralToolsFrameworkTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
......@@ -40,15 +64,6 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2C48A6E5FC2311EF3C228871FC6ACAF2"
BuildableName = "GeneralToolsFramework.framework"
BlueprintName = "GeneralToolsFramework"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
......@@ -56,6 +71,15 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GeneralToolsFramework"
BuildableName = "GeneralToolsFramework"
BlueprintName = "GeneralToolsFramework"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
......
---
BUNDLE_PATH: "vendor/bundle"
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:GeneralToolsFramework.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "GeneralToolsFramework_Example.app"
BlueprintName = "GeneralToolsFramework_Example"
ReferencedContainer = "container:GeneralToolsFramework.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACE41AFB9204008FA782"
BuildableName = "GeneralToolsFramework_Tests.xctest"
BlueprintName = "GeneralToolsFramework_Tests"
ReferencedContainer = "container:GeneralToolsFramework.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "GeneralToolsFramework_Example.app"
BlueprintName = "GeneralToolsFramework_Example"
ReferencedContainer = "container:GeneralToolsFramework.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACE41AFB9204008FA782"
BuildableName = "GeneralToolsFramework_Tests.xctest"
BlueprintName = "GeneralToolsFramework_Tests"
ReferencedContainer = "container:GeneralToolsFramework.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "GeneralToolsFramework_Example.app"
BlueprintName = "GeneralToolsFramework_Example"
ReferencedContainer = "container:GeneralToolsFramework.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "GeneralToolsFramework_Example.app"
BlueprintName = "GeneralToolsFramework_Example"
ReferencedContainer = "container:GeneralToolsFramework.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:GeneralToolsFramework.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
//
// AppDelegate.swift
// GeneralToolsFramework
//
// Created by Zandor Smith on 12/10/2018.
// Copyright (c) 2018 Zandor Smith. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 CocoaPods. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GeneralToolsFramework" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="I6F-dF-6nc">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="GeneralToolsFramework_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="140" y="133"/>
</scene>
<!--View Controller-->
<scene sceneID="lwp-jl-nvi">
<objects>
<viewController id="I6F-dF-6nc" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Esx-FK-cde"/>
<viewControllerLayoutGuide type="bottom" id="Jkq-Su-JAA"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="phD-Ko-mcA">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Yqs-MG-MZW" customClass="UIBlueButton" customModule="GeneralToolsFramework">
<rect key="frame" x="44" y="313.5" width="287" height="40"/>
<color key="backgroundColor" systemColor="linkColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="JFh-fv-F2W"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" title="Button">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="5"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="Yqs-MG-MZW" firstAttribute="centerX" secondItem="phD-Ko-mcA" secondAttribute="centerX" id="4aj-kb-Tsy"/>
<constraint firstAttribute="trailingMargin" secondItem="Yqs-MG-MZW" secondAttribute="trailing" constant="28" id="96C-01-1G6"/>
<constraint firstItem="Yqs-MG-MZW" firstAttribute="centerY" secondItem="phD-Ko-mcA" secondAttribute="centerY" id="kSl-pa-8U4"/>
<constraint firstItem="Yqs-MG-MZW" firstAttribute="leading" secondItem="phD-Ko-mcA" secondAttribute="leadingMargin" constant="28" id="qeR-vq-d3s"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="qCD-7T-SLt" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="927.20000000000005" y="132.68365817091455"/>
</scene>
</scenes>
</document>
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
</dict>
</plist>
//
// ViewController.swift
// GeneralToolsFramework
//
// Created by Zandor Smith on 12/10/2018.
// Copyright (c) 2018 Zandor Smith. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
use_frameworks!
target 'GeneralToolsFramework_Example' do
pod 'GeneralToolsFramework', :path => '../'
target 'GeneralToolsFramework_Tests' do
inherit! :search_paths
#pod 'Quick', '~> 1.2.0'
#pod 'Nimble', '~> 7.0.2'
#pod 'FBSnapshotTestCase' , '~> 2.1.4'
#pod 'Nimble-Snapshots' , '~> 6.3.0'
end
end
PODS:
- AAPickerView (1.3)
- Connectivity (5.0.0)
- GeneralToolsFramework (1.10.0):
- AAPickerView (~> 1.3)
- Connectivity (~> 5.0)
- PINCache (~> 3.0)
- PINCache (3.0.3):
- PINCache/Arc-exception-safe (= 3.0.3)
- PINCache/Core (= 3.0.3)
- PINCache/Arc-exception-safe (3.0.3):
- PINCache/Core
- PINCache/Core (3.0.3):
- PINOperation (~> 1.2.1)
- PINOperation (1.2.1)
DEPENDENCIES:
- GeneralToolsFramework (from `../`)
SPEC REPOS:
trunk:
- AAPickerView
- Connectivity
- PINCache
- PINOperation
EXTERNAL SOURCES:
GeneralToolsFramework:
:path: "../"
SPEC CHECKSUMS:
AAPickerView: 98fefdd9610a982e1a344e09192906154f868e1f
Connectivity: e990703fb8d8db54649ea05facac92000cc0f3eb
GeneralToolsFramework: 26df21142b15cd6c131f93568df9c57fb15f6655
PINCache: 7a8fc1a691173d21dbddbf86cd515de6efa55086
PINOperation: 00c935935f1e8cf0d1e2d6b542e75b88fc3e5e20
PODFILE CHECKSUM: 8be6009e7d309a8d0cef2f1323298cf6b59c87c4
COCOAPODS: 1.10.0
Copyright (c) 2017 Engr. Ahsan Ali <hafiz.m.ahsan.ali@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
![](https://github.com/EngrAhsanAli/AAPickerView/blob/master/AAPickerView.png)
# Table of Contents
- [AAPickerView](#section-id-4)
- [Description](#section-id-10)
- [Demonstration](#section-id-16)
- [Requirements](#section-id-26)
- [Installation](#section-id-32)
- [CocoaPods](#section-id-37)
- [Carthage](#section-id-63)
- [Manual Installation](#section-id-82)
- [Getting Started](#section-id-87)
- [Create instance of AAPickerView](#section-id-90)
- [Define picker type](#section-id-104)
- [Customise the toolbar](#section-id-112)
- [Customise StringPicker Label](#section-id-132)
- [Customise UIDatePicker & DateFormatter](#section-id-150)
- [Listen changes thorough callbacks](#section-id-151)
- [Contributions & License](#section-id-156)
<div id='section-id-4'/>
#AAPickerView
[![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat)](https://developer.apple.com/swift/) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CocoaPods](https://img.shields.io/cocoapods/v/AAPickerView.svg)](http://cocoadocs.org/docsets/AAPickerView) [![License MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/EngrAhsanAli/AAPickerView.svg?branch=master)](https://travis-ci.org/EngrAhsanAli/AAPickerView)
![License MIT](https://img.shields.io/github/license/mashape/apistatus.svg) [![CocoaPods](https://img.shields.io/cocoapods/p/AAPickerView.svg)]()
<div id='section-id-10'/>
##Description
AAPickerView is simple and easy-to-use implementation for `UITextField` to use as `UIPickerView` and `UIDatePicker` written in swift. It allows to transform `UITextField` as `UIPickerView` and `UIDatePicker` to pick data easily. It is designed to present a picker view to select data in `UITextField`.
<div id='section-id-16'/>
##Demonstration
![](https://github.com/EngrAhsanAli/AAPickerView/blob/master/Screenshots/demo.gif)
To run the example project, clone the repo, and run `pod install` from the Example directory first.
<div id='section-id-26'/>
##Requirements
- iOS 8.0+
- Xcode 8.0+
<div id='section-id-32'/>
# Installation
`AAPickerView` can be installed using CocoaPods, Carthage, or manually.
<div id='section-id-37'/>
##CocoaPods
`AAPickerView` is available through [CocoaPods](http://cocoapods.org). To install CocoaPods, run:
`$ gem install cocoapods`
Then create a Podfile with the following contents:
```
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target '<Your Target Name>' do
// Swift 3.2+ Compatibility
pod 'AAPickerView'
// Swift 4 Compatibility
pod 'AAPickerView', '~> 1.0'
end
```
Finally, run the following command to install it:
```
$ pod install
```
<div id='section-id-63'/>
##Carthage
To install Carthage, run (using Homebrew):
```
$ brew update
$ brew install carthage
```
Then add the following line to your Cartfile:
```
github "EngrAhsanAli/AAPickerView" "master"
```
Then import the library in all files where you use it:
```swift
import AAPickerView
```
<div id='section-id-82'/>
##Manual Installation
If you prefer not to use either of the above mentioned dependency managers, you can integrate `AAPickerView` into your project manually by adding the files contained in the Classes folder to your project.
<div id='section-id-87'/>
#Getting Started
----------
<div id='section-id-90'/>
##Create instance of AAPickerView
You just need to assign `AAPickerView` class to your `UITextField` and make the outlet:
```swift
@IBOutlet weak var picker: AAPickerView!
```
Now your `UITextField` is transformed as a picker view as `AAPickerView`.
<div id='section-id-104'/>
##Define picker type
Define type of picker you want to use in your text field. There are two types of pickers available in `AAPickerView` that are:
- `StringPicker` for `UIPickerView`
- `DatePicker` for `UIDatePicker`
Assign one of them as follow:
```swift
picker1.pickerType = .string(data: #String collection#)
picker2.pickerType = .date
```
<div id='section-id-112'/>
##Customise the toolbar
You can change `UIToolbar` colours like:
```swift
picker.toolbar.barTintColor = .darkGray
picker.toolbar.tintColor = .black
```
<div id='section-id-132'/>
##Customise StringPicker Label
You can get and customise the `StringPicker` label as `UILabel`:
```swift
let label = picker.pickerRow
label.font = UIFont(name: "American Typewriter", size: 30)
```
<div id='section-id-150'/>
##Customise UIDatePicker & DateFormatter
You can get your `UIDatePicker` and `DateFormatter` which is using behind your `UITextField` as:
```swift
let datePicker = picker.datePicker
datePicker?.datePickerMode = .date
let dateFormatter = picker.dateFormatter
dateFormatter.dateFormat = "dd/MM/YYYY"
```
<div id='section-id-151'/>
##Listen changes thorough callbacks
You can listen the changes of data simply by using the following callback methods:
- StringPicker:
```swift
picker.valueDidSelected = { (index) in
print("selectedString ", stringData[index as! Int])
}
```
- DatePicker
```swift
picker.valueDidSelected = { date in
print("selectedDate ", date as! Date )
}
```
<div id='section-id-156'/>
#Contributions & License
`AAPickerView` is available under the MIT license. See the [LICENSE](./LICENSE) file for more info.
Pull requests are welcome! The best contributions will consist of substitutions or configurations for classes/methods known to block the main thread during a typical app lifecycle.
I would love to know if you are using `AAPickerView` in your app, send an email to [Engr. Ahsan Ali](mailto:hafiz.m.ahsan.ali@gmail.com)
//
// ConnectivityPublisher.swift
// Connectivity
//
// Created by Ross Butler on 05/05/2020.
//
#if canImport(Combine)
import Combine
import Foundation
@available(OSX 10.15, iOS 13.0, tvOS 13.0, *)
public struct ConnectivityPublisher: Publisher {
public typealias Output = Connectivity
public typealias Failure = Never
public init() {}
public func receive<S: Subscriber>(subscriber: S)
where ConnectivityPublisher.Failure == S.Failure, ConnectivityPublisher.Output == S.Input {
let subscription = ConnectivitySubscription(subscriber: subscriber)
subscriber.receive(subscription: subscription)
}
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment