Latest 1.0.0
Homepage https://github.com/eilianlove/Together
License MIT
Platforms ios 8.0, osx 10.9, tvos 9.0, watchos 2.0, requires ARC
Authors

Swift Version
Pod Version
Carthage compatible
License
Platform

🍺Object common properties setting for swift.

Usage

SystemClass

let view1 = UIView()
let view2 = UITextField()
let view3 = UIImageView()
let alpha: CGFloat = 0.5

use together set their common properties

view1.together(values: view2, view3).do {
    $0.alpha = alpha
}

This is equivalent to:

view1.alpha = alpha
view2.alpha = alpha
view3.alpha = alpha

CustomClass

class Person {
    var firstName: String?
    var lastName: String?
}

class Coder: Person {
    var language: String?
}
// remember!!
extension Person: TogetherCompatible {}

let person1 = Person()
let person2 = Person()
let person3 = Person()
let coder = Coder()
let lastName = "Zhang"

person1.together(values: person2, person3, coder).do {
    $0.lastName = lastName
}

Installation

Carthage

Create a Cartfile that lists the framework. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/Together.framework to an iOS project.

github "eilianlove/Together"

Run carthage update to build the framework and drag the built Together.framework into your Xcode project.

To get the full benefits import Together

import Together

CocoaPods

You can use CocoaPods to install Together by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!
pod 'Together', '~> 1.0.0'

Then, run the following command:

$ pod install

Manually

  1. Download and drop Together in your project.
  2. Congratulations!

Latest podspec

{
    "name": "Together",
    "version": "1.0.0",
    "summary": "Object common properties setting for swift.",
    "homepage": "https://github.com/eilianlove/Together",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "archerzz": "[email protected]"
    },
    "source": {
        "git": "https://github.com/eilianlove/Together.git",
        "tag": "1.0.0"
    },
    "source_files": "Sources/*.swift",
    "requires_arc": true,
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "tvos": "9.0",
        "watchos": "2.0"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This