Skip to content

Commit

Permalink
Merge pull request #1 from Flawion/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Flawion authored Dec 5, 2019
2 parents a491bfc + 389d453 commit 8f6bb42
Show file tree
Hide file tree
Showing 27 changed files with 308 additions and 166 deletions.
2 changes: 1 addition & 1 deletion KOControls.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'KOControls'
s.version = '1.2.2'
s.version = '1.2.3'

s.summary = 'Package of useful controls: pickers, presenting queue, textfield thats supports validation, showing the errors etc.'
s.homepage = 'https://github.com/Flawion/KOControls'
Expand Down
6 changes: 6 additions & 0 deletions KOControls.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
051D173022F22AB200F259C6 /* KODialogBarViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 051D172F22F22AB200F259C6 /* KODialogBarViewTests.swift */; };
052099E4214FEC8600603A5D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 052099E3214FEC8600603A5D /* Assets.xcassets */; };
05251CBD213FEA5400CA9EF3 /* KOEdgesConstraintsInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05251CBC213FEA5400CA9EF3 /* KOEdgesConstraintsInsets.swift */; };
052842962397109E00ECE23E /* UIColor+Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 052842952397109E00ECE23E /* UIColor+Theme.swift */; };
053ED24A21162C2E0016ABC4 /* KOControls.h in Headers */ = {isa = PBXBuildFile; fileRef = 053ED24821162C2E0016ABC4 /* KOControls.h */; settings = {ATTRIBUTES = (Public, ); }; };
053ED28C211638950016ABC4 /* KOErrorInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 053ED28B211638950016ABC4 /* KOErrorInfoView.swift */; };
0546FCA622704A5000EE7236 /* KOAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0546FCA522704A5000EE7236 /* KOAnimator.swift */; };
Expand Down Expand Up @@ -69,6 +70,7 @@
051D172F22F22AB200F259C6 /* KODialogBarViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KODialogBarViewTests.swift; sourceTree = "<group>"; };
052099E3214FEC8600603A5D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
05251CBC213FEA5400CA9EF3 /* KOEdgesConstraintsInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KOEdgesConstraintsInsets.swift; sourceTree = "<group>"; };
052842952397109E00ECE23E /* UIColor+Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Theme.swift"; sourceTree = "<group>"; };
053ED24521162C2E0016ABC4 /* KOControls.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = KOControls.framework; sourceTree = BUILT_PRODUCTS_DIR; };
053ED24821162C2E0016ABC4 /* KOControls.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KOControls.h; sourceTree = "<group>"; };
053ED24921162C2E0016ABC4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -167,6 +169,7 @@
058529582151161100FA36DE /* KOPopoverSettings.swift */,
0566A6A9213E75D900E87518 /* KOConstraints.swift */,
0585295A2151164000FA36DE /* UIViewController+Extensions.swift */,
052842952397109E00ECE23E /* UIColor+Theme.swift */,
053ED24821162C2E0016ABC4 /* KOControls.h */,
053ED24921162C2E0016ABC4 /* Info.plist */,
);
Expand Down Expand Up @@ -413,6 +416,7 @@
05251CBD213FEA5400CA9EF3 /* KOEdgesConstraintsInsets.swift in Sources */,
05B4DF8A21674E05002556B9 /* KOAnimation.swift in Sources */,
05A121F7227E1BF6000739D6 /* KOControlValidationFeature.swift in Sources */,
052842962397109E00ECE23E /* UIColor+Theme.swift in Sources */,
05CE5527211DAF47003EDD66 /* KOPresentationQueuesService.swift in Sources */,
05CD3798217F53C200E8EEB4 /* KOPropertyObserver.swift in Sources */,
05CDF65A227EDBF5005D82A0 /* KOControlBorderFeature.swift in Sources */,
Expand Down Expand Up @@ -606,6 +610,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.2.3;
PRODUCT_BUNDLE_IDENTIFIER = pl.KO.KOControls;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -635,6 +640,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.2.3;
PRODUCT_BUNDLE_IDENTIFIER = pl.KO.KOControls;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
17 changes: 11 additions & 6 deletions KOControlsExample/KOControlsExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 51;
objects = {

/* Begin PBXBuildFile section */
05191DC1215A237000C45D14 /* CountryCollectionsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05191DC0215A237000C45D14 /* CountryCollectionsController.swift */; };
052842942396F1BD00ECE23E /* UIColor+Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 052842932396F1BD00ECE23E /* UIColor+Theme.swift */; };
052BCFD221873E5A005578D4 /* KOControls.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 052BCFD121873E5A005578D4 /* KOControls.framework */; };
052BCFD321873E5A005578D4 /* KOControls.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 052BCFD121873E5A005578D4 /* KOControls.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
053ED26121162FAB0016ABC4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 053ED26021162FAB0016ABC4 /* AppDelegate.swift */; };
Expand Down Expand Up @@ -54,6 +55,7 @@

/* Begin PBXFileReference section */
05191DC0215A237000C45D14 /* CountryCollectionsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryCollectionsController.swift; sourceTree = "<group>"; };
052842932396F1BD00ECE23E /* UIColor+Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Theme.swift"; sourceTree = "<group>"; };
052BCFD121873E5A005578D4 /* KOControls.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = KOControls.framework; sourceTree = BUILT_PRODUCTS_DIR; };
053ED25D21162FAB0016ABC4 /* KOControlsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KOControlsExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
053ED26021162FAB0016ABC4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -128,6 +130,7 @@
05191DC0215A237000C45D14 /* CountryCollectionsController.swift */,
053ED26021162FAB0016ABC4 /* AppDelegate.swift */,
058529552150DD7400FA36DE /* AppSettings.swift */,
052842932396F1BD00ECE23E /* UIColor+Theme.swift */,
053ED26721162FAC0016ABC4 /* Assets.xcassets */,
056705BD21527C6000805BD1 /* CountriesList.txt */,
053ED26921162FAC0016ABC4 /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -349,13 +352,12 @@
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-KOControlsExample/Pods-KOControlsExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework",
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-KOControlsExample/Pods-KOControlsExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IQKeyboardManagerSwift.framework",
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-KOControlsExample/Pods-KOControlsExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand All @@ -380,6 +382,7 @@
053ED281211631B10016ABC4 /* MenuViewController.swift in Sources */,
05DC48AE2124AEBF00D0E7F6 /* PresentationQueueViewController.swift in Sources */,
05CBB2BC213D311F00EE6264 /* PickerViewController.swift in Sources */,
052842942396F1BD00ECE23E /* UIColor+Theme.swift in Sources */,
058529562150DD7400FA36DE /* AppSettings.swift in Sources */,
05C0CFF222520EED00F49E11 /* PVC+OptionPicker.swift in Sources */,
053ED28A211632EA0016ABC4 /* MenuItemTypes.swift in Sources */,
Expand Down Expand Up @@ -529,6 +532,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.3;
PRODUCT_BUNDLE_IDENTIFIER = pl.KO.KOControlsExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -549,6 +553,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.3;
PRODUCT_BUNDLE_IDENTIFIER = pl.KO.KOControlsExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
2 changes: 1 addition & 1 deletion KOControlsExample/KOControlsExample/AppSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import UIKit
import KOControls

final class AppSettings {
struct AppSettings {
static let fieldBorder = KOControlBorderSettings(color: UIColor.lightGray.cgColor, errorColor: UIColor.red.cgColor, focusedColor: UIColor.blue.cgColor, errorFocusedColor: UIColor.red.cgColor, width: 1, focusedWidth: 2)

static var countries: [CountryModel] {
Expand Down
2 changes: 1 addition & 1 deletion KOControlsExample/KOControlsExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.2</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
87 changes: 87 additions & 0 deletions KOControlsExample/KOControlsExample/UIColor+Theme.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
//
// UIColor+Theme.swift
// KOControlsExample
//
// Copyright (c) 2019 Kuba Ostrowski
//
// 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.
//

import UIKit

extension UIColor {
struct Theme {
static var menuCellBackground: UIColor {
if #available(iOS 13.0, *) {
return UIColor.tertiarySystemBackground
} else {
return UIColor.white
}
}

static var presentationQueuePresentingBackground: UIColor {
if #available(iOS 13.0, *) {
return UIColor.secondarySystemBackground
} else {
return UIColor(red: 0.945, green: 0.945, blue: 0.946, alpha: 1.0)
}
}

static var customDialogBackground: UIColor {
if #available(iOS 13.0, *) {
return UIColor.tertiarySystemBackground
} else {
return UIColor.white
}
}

static var customPickerMainViewBackground: UIColor {
if #available(iOS 13.0, *) {
return UIColor.label
} else {
return UIColor.black.withAlphaComponent(0.75)
}
}

static var customPickerBarViewForeground: UIColor {
if #available(iOS 13.0, *) {
return UIColor.systemGray6
} else {
return UIColor.white
}
}

static var customPopoverPresentationControllerBackground: UIColor {
if #available(iOS 13.0, *) {
return UIColor.label
} else {
return UIColor.black.withAlphaComponent(0.70)
}
}

static var customItemsTableSeparator: UIColor {
if #available(iOS 13.0, *) {
return UIColor.systemGray
} else {
return UIColor.white
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ final class MenuViewController: UIViewController, UITableViewDataSource, UITable

override func viewDidLoad() {
super.viewDidLoad()

navigationItem.title = "Menu"
menuTableView.register(UITableViewCell.self, forCellReuseIdentifier: menuItemReuseIdentifier)
menuTableView.tableFooterView = UIView()
Expand All @@ -51,6 +50,8 @@ final class MenuViewController: UIViewController, UITableViewDataSource, UITable

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = menuTableView.dequeueReusableCell(withIdentifier: menuItemReuseIdentifier, for: indexPath)
cell.accessoryType = .disclosureIndicator
cell.backgroundColor = UIColor.Theme.menuCellBackground
cell.textLabel?.text = menuItemTypes[indexPath.row].rawValue
return cell
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -22,22 +20,23 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="lcT-Wl-w0f">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="dataSource" destination="-1" id="uOa-Qq-YxF"/>
<outlet property="delegate" destination="-1" id="Svh-5r-iUA"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="lcT-Wl-w0f" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="8ac-5G-aeO"/>
<constraint firstItem="lcT-Wl-w0f" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="B7s-Je-9q4"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="lcT-Wl-w0f" secondAttribute="bottom" id="K1d-bv-ZwK"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="lcT-Wl-w0f" secondAttribute="trailing" id="Vpz-xE-TVp"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="140" y="143"/>
</view>
</objects>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ extension PickerViewController {
guard isStyleCustomize else {
return
}
itemsCollectionPickerViewController.itemsCollection.backgroundColor = UIColor.clear

/* If custom style horizontal alignment isn't equal to fill,
picker must has to set contentWidth, to properly calculate sizes of view.
We only need to do it in normal presentation mode because in popover presentation mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ extension PickerViewController {
guard isStyleCustomize else {
return
}
itemsTablePicker.itemsTable.separatorColor = UIColor.white
itemsTablePicker.itemsTable.separatorColor = UIColor.Theme.customItemsTableSeparator
itemsTablePicker.itemsTable.backgroundColor = UIColor.clear
/* If custom style horizontal alignment isn't equal to fill,
picker must has to set contentWidth, to properly calculate sizes of view.
Expand Down Expand Up @@ -168,7 +168,7 @@ final class SearchItemsTablePickerViewController: KOItemsTablePickerViewControll

override func createContentView() -> UIView {
let contentView = UIView()

let itemsTable = super.createContentView()
contentView.addSubview(itemsTable)
itemsTable.translatesAutoresizingMaskIntoConstraints = false
Expand All @@ -190,7 +190,6 @@ final class SearchItemsTablePickerViewController: KOItemsTablePickerViewControll
itemsTable.rightAnchor.constraint(equalTo: contentView.rightAnchor),
itemsTable.bottomAnchor.constraint(equalTo: contentView.bottomAnchor)
])

return contentView
}
}
Loading

0 comments on commit 8f6bb42

Please sign in to comment.