Latest 1.1.0
Homepage https://github.com/berbschloe/LayoutPriorityUtils
License MIT
Platforms ios 9.0

Swift
CocoaPods

A small collection of utils for UILayoutPriority that adds operator overloads and common constants.

Requirements

  • iOS 9.0+
  • Xcode 10.2+
  • Swift 5.0+

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate the library into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'LayoutPriorityUtils', '1.1.0'

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

dependencies: [
    .package(url: "https://github.com/berbschloe/LayoutPriorityUtils.git", from: "1.1.0")
]

Usage

Importing

It would be recommended to add the library globally because it can get annoying importing it everywhere.

// Add this to a GlobalImports.swift
@_exported import LayoutPriorityUtils

Constants


    // current constatants provided by UIKit

    UILayoutPriority.required // 1000

    UILayoutPriority.defaultHigh // 750

    UILayoutPriority.defaultLow // 250

    UILayoutPriority.fittingSizeLevel // 50

    // extra constants provided by LayoutPriorityUtils

    UILayoutPriority.almostRequired // 999

    UILayoutPriority.none // 0

    UILayoutPriority.almostNone // 1

    UILayoutPriority.defaultMedium // 500

Math


let newPriority = UILayoutPriority.defaultLow + 1

let anotherPrioirty = UILayoutPriority.defaultLow - 1

Latest podspec

{
    "name": "LayoutPriorityUtils",
    "version": "1.1.0",
    "summary": "A small collection of utils for UILayoutPriority that adds operator overloads and common constants.",
    "homepage": "https://github.com/berbschloe/LayoutPriorityUtils",
    "license": "MIT",
    "authors": "Brandon Erbschloe",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/berbschloe/LayoutPriorityUtils.git",
        "tag": "1.1.0"
    },
    "source_files": "LayoutPriorityUtils/**/*.{h,m,swift}",
    "swift_version": "5.0"
}

Pin It on Pinterest

Share This