A Set of Tools To Extend UIKit (Classic iOS Framework)

Last update: Jul 8, 2022

Icon

RVS_UIKit_Toolbox

A set of basic UIKit tools, for Swift iOS app development.

Overview

This package offers a few extensions of standard UIKit classes, in order to abstract some of the more common software tasks.

Implementation

Where to Get

Swift Package Manager

The most common method of integration will almost certainly be via the Swift Package Manager (SPM).

The package can be accessed from GitHub, via the following URIs:

  • SSL: [email protected]:RiftValleySoftware/RVS_UIKit_Toolbox.git
  • HTTPS: https://github.com/RiftValleySoftware/RVS_UIKit_Toolbox.git

Simply integrate the package into your project, and import the module, in files that use its extensions:

import RVS_UIKit_Toolbox

Carthage

You can also get the package, using Carthage, the general-purpose package manager that is supplied by GitHub.

In order to import the package, add the following line to your cartfile:

github "RiftValleySoftware/RVS_UIKit_Toolbox"

If you choose to build the module, you will also need to import the module into files that use the extensions:

import RVS_UIKit_Toolbox

Alternatively, the entire set of extensions is available in a single source file, that you can integrate directly into the main module:

With Carthage, this would be available in the Carthage/Checkins/RVS_UIKit_Toolbox/Sources/RVS_UIKit_Toolbox directory.

If you do this, then the file would be integrated directly into the main module, so you will not need to import the file.

Git Submodule

Finally, you can simply include the module into your project, using a Git Submodule, which is available, using the two URIs (SSL or HTTPS), referenced above, in the Swift Package Manager section.

If you do this, you should include the source file directly into your project, as outlined in the Carthage section.

How to Use

Once the package has been added to the project, and the module is imported (or the source file is directly integrated into the main module), the extensions immediately become available in the base UIKit classes. The extensions are listed below:

UITabBarController

This adds just one method to the standard UIKit UITabBarController Class:

The purpose of this method, is to allow an easy shortcut to customizing the colors of the Tab Bar.

UIViewController

This adds a number of computed properties, and one method, to deal with Responders.

Class Computed Properties

These are defined as "class" properties, so you don't need an instance to use them.

System State Flag Instance Computed Properties

These are instance properties, as opposed to class properties:

These are only available in instances (not class):

Device Instance Computed Properties

This is a property that returns the aspect of the device screen:

View Hierarchy Instance Computed Properties

This will return the view controller immediately "under" this one, in a navigation stack:

Responder Stuff

This recursively finds the current selected responder (or nil, if no responder):

This method will also end editing for the view controller:

UIView

IBInspectable Computed Instance Properties
Responder Stuff
Auto Layout Instance Methods

UIImage

Class Functions
Image Composition Instance Computed Properties
Pixel Information Instance Methods
Sizing Instance Methods

UIColor

Convenience Initializers
Color Information Instance Computed Properties
Color Computation Instance Methods

The Test Harness App

Because the package is a UIKit extension, unit tests will be less effective than a test harness. We provide a fairly comprehensive test harness app, that not only provides excellent code coverage, but also acts as a template for real-world implementation.

Here is the source code for the test harness app. It is one of the targets in the Xcode workspace.

The app is a fairly basic "tabbed" app, that presents 5 tabs; each, corresponding to one of the extended classes:

Figure 1: UITabBarController Figure 2: UIViewController Figure 3: UIView Figure 4: UIImage Figure 5: UIColor
Figure 1 Figure 2 Figure 3 Figure 4 Figure 5

Tab 1 (UIViewController) also has a navigation stack, and allows you to open a second screen, showing access to the previous view controller, and the responder properties:

Figure 6: UIViewController Navigation Screen Figure 7: UIViewController Navigation Screen (With Focus) Figure 8: UIViewController Navigation Screen (Next Screen)
Figure 6 Figure 7 Figure 8

The app is written as if it were a "shipped" app, and has excellent code quality, localization, and clear implementation. It should be an excellent example of use.

LICENSE

© Copyright 2022, The Great Rift Valley Software Company

MIT License

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.

GitHub

https://github.com/RiftValleySoftware/RVS_UIKit_Toolbox
You might also like...

🌵Declarative UIKit

Viewtiful Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation Viewtifu

Oct 28, 2021

Pocket Trainer UIKit

Pocket Trainer UIKit

Pocket-Trainer-UIKit Помощник для занятий в тренажерном зале API для взаимодействия с базой данных упражнений и первоначальное приложение на Android з

Nov 28, 2021

Apple provides us two ways to use UIKit views in SwiftUI

RepresentableKit Apple provides us two ways to use UIKit views in SwiftUI: UIVie

Jul 21, 2022

Alura Viagens with UIKit

Alura Viagens with UIKit

Alura Viagens UIKit UITableView Protocolo UITableViewDelegate Constraints para d

Dec 20, 2021

A simple checklist app using UIKit

A simple checklist app using UIKit

UIKit Checklist App Data Persistence Icon Selector Notification Scheduling Multi

Dec 27, 2021

UIKitTest - Xcode, UIKit and Swift playground

UIKit Test Just a Xcode, UIKit and Swift playground (try and learning purposes).

Jul 14, 2022

Swift-picker-views - inline single and multi picker views for UIKit. Without tableview! Easy and simple

Swift-picker-views - inline single and multi picker views for UIKit. Without tableview! Easy and simple

swift-picker-views Inline single and multiple picker views for UIKit. No tablevi

Jan 31, 2022

The missing UIKit component. A scrollable alternative to UISegmentedControl

The missing UIKit component.  A scrollable alternative to UISegmentedControl

Requirements iOS 15.0 and higher Installation Swift Package Manager: dependencies: [ .package(url: "https://github.com/hugo-pivaral/UITabControl.git

Jul 25, 2022

Declarative iOS UI sugar framework built on FlexLayout

Declarative iOS UI sugar framework built on FlexLayout

Declarative iOS UI sugar framework built on FlexLayout

Jul 22, 2022
⌨️ KeyboardToolbar - Add tools above your keyboard with iOS-like keyboard buttons
⌨️ KeyboardToolbar - Add tools above your keyboard with iOS-like keyboard buttons

KeyboardToolbar ?? Overview Use KeyboardToolbar to add tools as an input accessory view to a UITextField, UITextView, or any other view conforming to

Aug 3, 2022
Reframing SwiftUI Views. A collection of tools to help with layout.
Reframing SwiftUI Views. A collection of tools to help with layout.

Overview A Swift Package with a collection of SwiftUI framing views and tools to help with layout. Size readers like WidthReader, HeightReader, and on

Jul 20, 2022
Arrange views in your app’s interface using layout tools that SwiftUI provides.

Composing custom layouts with SwiftUI Arrange views in your app's interface using layout tools that SwiftUI provides. Overview This sample app demonst

Jun 9, 2022
LemonadeDeclarativeUI framework contains some new functions for UIKit

LemonadeDeclarativeUI framework contains some new functions for UIKit. This library has been developing. If you want to contribute reach me!

Jan 2, 2022
Using the UIKitChain framework, You can create a UIKit component in one line of code.
Using the UIKitChain framework, You can create a UIKit component in one line of code.

Using the UIKitChain framework, You can create a UIKit component in one line of code. Installation CocoaPods CocoaPods is a dependency manager for Coc

Jan 16, 2022
📱AutoLayout can be set differently for each device
📱AutoLayout can be set differently for each device

DeviceLayout DeviceLayout is a Swift framework that lets you set Auto Layout constraints's differently for each device Using only IBInspector of Xcode

Apr 7, 2022
A set of libraries used for parsing representations of Swift Packages similar to how SwiftPM itself works

A set of libraries used for parsing representations of Swift Packages similar to how SwiftPM itself works, but also supporting Xcode specific features (such as Swift Playground Apps).

Jan 8, 2022
A declarative UIKit for improve layout productivity when developing an iOS application

TifoKit A declarative UIKit for improve layout productivity when developing an iOS application Requirements Min. iOS 11 Swift 5+ Installation Currentl

Aug 6, 2022
PillboxView - A Pillbox informational view for iOS written in UIKit
PillboxView - A Pillbox informational view for iOS written in UIKit

Pillbox View Pillbox View shows a small bubble, pill looking box that sides from

May 31, 2022
CompositionalLayoutDSL, library to simplify the creation of UICollectionViewCompositionalLayout. It wraps the UIKit API and makes the code shorter and easier to read.
CompositionalLayoutDSL, library to simplify the creation of UICollectionViewCompositionalLayout. It wraps the UIKit API and makes the code shorter and easier to read.

CompositionalLayoutDSL CompositionalLayoutDSL is a Swift library. It makes easier to create compositional layout for collection view. Requirements Doc

Jul 10, 2022