Latest 0.1.0
Homepage https://github.com/marty-suzuki/SafeAreaExtension
License MIT
Platforms ios 11.0
Authors

CI Status
Version
License
Platform
Carthage compatible

You can handle safeAreaInsets changes of every UIView.

SafeAreaExtension

Usage

final class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        view.safeArea.insetsDidChange = { insets in
            // If safeAreaInsets of `self.view`, this closure called.
            print("view.safeAreaInsets = (insets)")
        }
    }
}

UIView Extension

extension UIView {
    // UIView Extension about Safe Area
    var safeArea: SafeAreaExtension { get }
}

class SafeAreaExtension {
    // Safe Area Insets handler
    var insetsDidChange: ((UIEdgeInsets) -> ())? { get set }
}

Requirements

  • Xcode 9 or greater
  • Swift 4 or greater
  • iOS 11 or greater

Installation

CocoaPods

SafeAreaExtension is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SafeAreaExtension'

Carthage

If you’re using Carthage, simply add
SafeAreaExtension to your Cartfile:

github "marty-suzuki/SafeAreaExtension"

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Author

marty-suzuki, [email protected]

License

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

Latest podspec

{
    "name": "SafeAreaExtension",
    "version": "0.1.0",
    "summary": "You can handle safeAreaInsets changes of every UIView.",
    "homepage": "https://github.com/marty-suzuki/SafeAreaExtension",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "marty-suzuki": "[email protected]"
    },
    "source": {
        "git": "https://github.com/marty-suzuki/SafeAreaExtension.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/marty_suzuki",
    "platforms": {
        "ios": "11.0"
    },
    "source_files": "SafeAreaExtension/**/*",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This