Latest 1.0.0
Homepage https://github.com/eMdOS/ReusableViewKit
License MIT
Platforms ios 11.0
Frameworks UIKit, Foundation
Authors

Installation

CocoaPods

Core

pod 'ReusableViewKit', '~>1.0.0'

TableViewSection

pod 'ReusableViewKit/TableViewSection', '~>1.0.0'

Usage

ReusableViewKit/Core

Providing the reusableIdentifier for a UIView

final class EmojiTableViewCell: UITableViewCell, ReusableView {
    // ..
}

Providing the nibName for a UIView or UIViewController

final class EmojiTableViewCell: UITableViewCell, NibLoadableView {
    // ..
}

// or ...

final class EmojisViewController: UIViewController, NibLoadableView {
    // ..
}

Result

TableViewCell registration
tableView.register(cell: EmojiTableViewCell.self, inBundle: .main)
TableViewCell dequeuing
extension EmojisViewController: UITableViewDataSource {
    // ...
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell: EmojiTableViewCell = tableView.dequeueReusableCell(forIndexPath: indexPath)
        // cell configuration ...
        return cell
    }
    // ...
}
ViewController from .xib
final class EmojisViewController: UIViewController, NibLoadableView {
    // ...
    private init(emojis: [Emoji]) {
        self.emojis = emojis
        super.init(nibName: EmojisViewController.nibName, bundle: .main)
    }
    // ...
}

ReusableViewKit/TableViewSection

???

Latest podspec

{
    "name": "ReusableViewKit",
    "version": "1.0.0",
    "swift_version": "4.2",
    "platforms": {
        "ios": "11.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/eMdOS/ReusableViewKit",
    "authors": {
        "eMdOS": "[email protected]"
    },
    "summary": "A useful framework with extensions and utilities for making development easier.",
    "source": {
        "git": "https://github.com/eMdOS/ReusableViewKit.git",
        "tag": "1.0.0"
    },
    "frameworks": [
        "UIKit",
        "Foundation"
    ],
    "default_subspecs": "Core",
    "source_files": "framework/ReusableViewKit.h",
    "subspecs": [
        {
            "name": "Core",
            "source_files": "framework/sources/core/**/*.{swift}"
        },
        {
            "name": "TableViewSection",
            "source_files": "framework/sources/table view section/*.{swift}"
        }
    ]
}

Pin It on Pinterest

Share This