Latest 0.1.2
Homepage https://github.com/markvaldy/TypeHelper
License MIT
Platforms ios 8.0, osx 10.10, requires ARC
Frameworks Foundation
Authors

Version
License
Platform

A simple function for getting the name of the non optional type in Swift (from optional or implicitly unwrapped optional types).

Usage

  let some: SomeClass = SomeClass()
  let someOptional: SomeClass? = SomeClass()
  let someImplicitlyUnwrappedOptional: SomeClass! = SomeClass()

  println(nonOptionalTypeName(some.dynamicType)) // <namespace>.SomeClass
  println(nonOptionalTypeName(someOptional.dynamicType)) // <namespace>.SomeClass
  println(nonOptionalTypeName(someImplicitlyUnwrappedOptional.dynamicType)) // <namespace>.SomeClass

  println(nonOptionalTypeName(Printable)) // Swift.Printable
  println(nonOptionalTypeName(Printable?)) // Swift.Printable

  println(nonOptionalTypeName(UIView)) // UIView
  println(nonOptionalTypeName(UIView?)) // UIView

Installation

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

pod 'TypeHelper'

Author

Vadym Markov, [email protected]

License

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

Latest podspec

{
    "name": "TypeHelper",
    "version": "0.1.2",
    "summary": "A simple function for getting the name of the non optional type in Swift.",
    "homepage": "https://github.com/markvaldy/TypeHelper",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "source": {
        "git": "https://github.com/markvaldy/TypeHelper.git",
        "tag": "0.1.2"
    },
    "authors": {
        "Vadym Markov": "[email protected]"
    },
    "social_media_url": "https://twitter.com/markvaldy",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10"
    },
    "requires_arc": true,
    "source_files": "Source/**/*.{swift}",
    "frameworks": "Foundation"
}

Pin It on Pinterest

Share This