Latest 1.0.3
Homepage https://github.com/robertbtown/BtownToolkit
License MIT
Platforms ios 11.0
Dependencies PureLayout, AngleGradientLayer
Frameworks UIKit
Authors

platforms

About BtownToolkit

This toolkit tries to simplify the lives for app developers by supplying easy to use and feature-rich components and tools that we all need in our everyday code creation. The aim is to continuously add on more components and features to the toolkit as soon as a need for something new is discovered.

Requirements

Version 1.0.0 and newer

  • Xcode 10.0
  • Swift 4.2
  • iOS 11.0+

Version 0.2.0

  • Xcode 9.0
  • Swift 4.0
  • iOS 9.0+

Older versions

  • Xcode 8.0
  • Swift 3.0
  • iOS 9.0+

Example

Some code examples can be found in the example project that comes with this project. Here is a short overview of some of the tools available.

AlertView

AlertView is using built in logic from UIAlertController but you dont need to present it from another UIViewController. You can just call ‘.show()’ on the AlertView and it will be presented on top of other content in its own UIWindow.

let alertView = AlertView(title: "title", message: "message")
alertView.addTextField(identifier: "TextTield1") { (textField) in
    textField.font = UIFont.boldSystemFont(ofSize: 16)
    textField.textColor = UIColor.red
}
alertView.addAction(title: "Delete", actionType: .destructive, actionCallback: nil) {
    print("Destructive Action")
}
alertView.addAction(title: "Normal", actionType: .normal) {
    print("Normal Action")
}
alertView.addAction(title: "Cancel", actionType: .cancel) {
    print("Cancel Action")
}
alertView.wasDismissedClosure = {
    print("AlertView did disappear")
}
alertView.show()

ImageView-Helpers

ScrollableImageView is a view where you can set an image and then pinch to zoom in that image and scroll around.
ImageCropSelectionView is a ScrollableImageView with a round selection area, from which you can get the contained image. It’s usable for picking user profile images for example.

let scrollableImageView = ScrollableImageView()
scrollableImageView.image = UIImage(named: "ImageExample")
scrollableImageView.setImageZoomScaleToAspectFitViewSize()
scrollableImageView.centerImageInView()

let imageCropSelectionView = ImageCropSelectionView()
imageCropSelectionView.image = UIImage(named: "ImageExample")
...
let userImage = imageCropSelectionView.croppedSelectionImage()

Installation

BtownToolkit is available through CocoaPods

# Podfile
use_frameworks!

target 'YOUR_TARGET_NAME' do
    pod 'BtownToolkit'
end

Replace YOUR_TARGET_NAME and then, in the Podfile directory, type:

$ pod install

Author

Robert Magnusson, [email protected]

License

BtownToolkit is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "BtownToolkit",
    "platforms": {
        "ios": "11.0"
    },
    "version": "1.0.3",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.2"
    },
    "summary": "This toolkit simplifies the lives for developers by supplying easy to use and components and tools needed in our everyday code creation.",
    "description": "This toolkit tries to simplify the lives for app developers by supplying easy to use and feature-rich components and tools that we all need in our everyday code creation. The aim is to continuously add on more components and features to the toolkit as soon as a need for something new is discovered.",
    "homepage": "https://github.com/robertbtown/BtownToolkit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Robert Magnusson": "[email protected]"
    },
    "source": {
        "git": "https://github.com/robertbtown/BtownToolkit.git",
        "tag": "1.0.3"
    },
    "source_files": "BtownToolkit/Classes/**/*",
    "dependencies": {
        "PureLayout": [
            "~> 3.1"
        ],
        "AngleGradientLayer": [
            "~> 1.2"
        ]
    },
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This