Action Utilities provide several useful functions that are common across many apps written in Swift and Xcode.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ActionUtilitiesSample.xcodeproj
ActionUtilitiesSample
Images
.DS_Store
.gitignore
License.md
README.md

README.md

Action Utilities

Action Utilities provide several useful functions that are common across many apps written in Swift and Xcode. These include features such as getting the version of the OS installed on the device the app is running on, testing to see if an app can connect to the internet and getting the device type (for example iPhoneX).

Additionally, many built-in types (such as UIColor, String and Data) have been extended with useful features such as converting a color to and from a hex string and moving images easily between Data and String types to support Swift 4's Codable protocol.

Action Utilities are support on iOS, tvOS, watchOS and macOS.

Adding Action Utilities to an App Project

Before you can successfully build and run these sample apps, you'll need to download and install the Action Utilities framework from the Appracatappra website.

Our components were designed to be quickly added to your app's project with a minimum of code, making it easy to add high-quality, professional features and functionality to your apps.

In Xcode, do the following:

  1. Open an app project or start a new one.

  2. Select the Project in the Project Navigator, select the General tab and scroll down to the Embedded Binaries section:

  3. In Finder, open the folder where you unzipped the ActionUtilitiesFrameworks.zip file and select the appropriate framework version:

  4. Drag the framework into the Embedded Binaries section in Xcode.

  5. Select Copy items if needed and click the Finish button:

  6. The framework will be added to both the Embedded Binaries and the Linked Frameworks and Libraries sections:

Action Extensions

Action Extensions provide several useful features to common, built-in Cocoa, Cocoa Touch and Swift data types such as converting UIColor/NSColor to/from hex strings (for example #FF0000), creating UIImage/NSImage instances from Base64 encoded strings stored in Data or NSData objects and encoding UIImages/NSImages as Base64 strings or Data objects.

iOS Examples:

// Assign a color from a string
let color: UIColor ~= "#FF0000"

// Initialize a color from a hex string
let green = UIColor(fromHex: "00FF00")

// Convert color to a hex string
let white = UIColor.white.toHex()

macOS Examples:

// Assign a color from a string
let color: NSColor ~= "#FF0000"

// Initialize a color from a hex string
let green = NSColor(fromHex: "00FF00")

// Convert color to a hex string
let white = NSColor.white.toHex()

General Utilities

General Utilities provide several, general utility classes to handle thing such as simple popup notifications.

Examples:

// Display popup message at the bottom of the screen
ACNotify.showMessage(text: "Hello World!")

Hardware Utilities

Hardware Utilities provide commonly used information about the device an app is running on such as the device type (for example iPhoneX), the OS version (for example iOS 11.1) and if the app can connect to the internet.

Examples:

if HardwareInformation.deviceType == .iPhoneX {
	// The app is running on an iPhone X
	...
}

if HardwareInformation.isConnectedToNetwork {
	// The device has an internet connection
	...
}