Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #36 from bre7/swift_subspec
Browse files Browse the repository at this point in the history
Added Swift subspec
  • Loading branch information
Vicc Alexander authored and Vicc Alexander committed Jul 9, 2015
2 parents 5c6ee95 + 9131580 commit 848b93c
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 61 deletions.
12 changes: 12 additions & 0 deletions ChameleonFramework.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@ Pod::Spec.new do |s|
s.public_header_files = 'Pod/Classes/Objective-C/**/*.h'
s.frameworks = 'UIKit', 'QuartzCore', 'CoreGraphics'

s.default_subspecs = 'Default'

s.subspec 'Default' do |ss|
ss.source_files = 'Pod/Classes/Objective-C/**/*.{h,m}'
end

s.subspec 'Swift' do |ss|
ss.ios.deployment_target = '8.0'
ss.osx.deployment_target = '10.10'
ss.source_files = 'Pod/Classes/Swift/ChameleonShorthand.swift'
ss.dependency 'ChameleonFramework/Default'
end
end
117 changes: 57 additions & 60 deletions Pod/Classes/Swift/ChameleonShorthand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,256 +26,253 @@
SOFTWARE.
*/


import ChameleonFramework

// MARK: - Chameleon - UIColor Methods Shorthand

//UIColor Methods Shorthand
func ComplementaryFlatColorOf(color: UIColor) -> UIColor {
public func ComplementaryFlatColorOf(color: UIColor) -> UIColor {
return UIColor(complementaryFlatColorOf: color)
}

func FlatVersionOf(color: UIColor) -> UIColor {
public func FlatVersionOf(color: UIColor) -> UIColor {
return UIColor(flatVersionOf: color)
}

func RandomFlatColorWithShade(shade: UIShadeStyle) -> UIColor {
public func RandomFlatColorWithShade(shade: UIShadeStyle) -> UIColor {
return UIColor(randomFlatColorOfShadeStyle: shade)
}

func ContrastColorOf(backgroundColor: UIColor, returnFlat: Bool) -> UIColor {
public func ContrastColorOf(backgroundColor: UIColor, returnFlat: Bool) -> UIColor {
return UIColor(contrastingBlackOrWhiteColorOn: backgroundColor, isFlat: returnFlat)
}

func GradientColor(gradientStyle: UIGradientStyle, frame: CGRect, colors: [UIColor]) -> UIColor {
public func GradientColor(gradientStyle: UIGradientStyle, frame: CGRect, colors: [UIColor]) -> UIColor {
return UIColor(gradientStyle: gradientStyle, withFrame: frame, andColors: colors)
}


// MARK: - Chameleon - UIStatusBar Methods Shorthand

//UIStatusBar Methods Shorthand
func StatusBarContrastColorOf(backgroundColor: UIColor) -> UIStatusBarStyle {
public func StatusBarContrastColorOf(backgroundColor: UIColor) -> UIStatusBarStyle {
return ChameleonStatusBar.statusBarStyleForColor(backgroundColor)
}

// MARK: - Chameleon - NSArray Methods Shorthand

//NSArray Methods Shorthand
// TODO Array Extension needed ;)
func ColorSchemeOf(colorSchemeType:ColorScheme, color:UIColor, isFlatScheme:Bool) -> Array <UIColor> {
public func ColorSchemeOf(colorSchemeType:ColorScheme, color:UIColor, isFlatScheme:Bool) -> Array <UIColor> {
return NSArray(ofColorsWithColorScheme:colorSchemeType, with:color, flatScheme: isFlatScheme) as! [UIColor]
}

// MARK: - Chameleon - Special Colors Shorthand

//Special Colors Shorthand
func RandomFlatColor() -> UIColor {
public func RandomFlatColor() -> UIColor {
return UIColor.randomFlatColor()
}

func ClearColor() -> UIColor {
public func ClearColor() -> UIColor {
return UIColor.clearColor()
}


// MARK: - Chameleon - Light Shades Shorthand

//Chameleon Flat Colors - Light Shades Shorthand
func FlatBlack() -> UIColor {
public func FlatBlack() -> UIColor {
return UIColor.flatBlackColor()
}

func FlatBlue() -> UIColor {
public func FlatBlue() -> UIColor {
return UIColor.flatBlueColor()
}

func FlatBrown() -> UIColor {
public func FlatBrown() -> UIColor {
return UIColor.flatBrownColor()
}

func FlatCoffee() -> UIColor {
public func FlatCoffee() -> UIColor {
return UIColor.flatCoffeeColor()
}

func FlatForestGreen() -> UIColor {
public func FlatForestGreen() -> UIColor {
return UIColor.flatForestGreenColor()
}

func FlatGray() -> UIColor {
public func FlatGray() -> UIColor {
return UIColor.flatGrayColor()
}

func FlatGreen() -> UIColor {
public func FlatGreen() -> UIColor {
return UIColor.flatGreenColor()
}

func FlatLime() -> UIColor {
public func FlatLime() -> UIColor {
return UIColor.flatLimeColor()
}

func FlatMagenta() -> UIColor {
public func FlatMagenta() -> UIColor {
return UIColor.flatMagentaColor()
}

func FlatMaroon() -> UIColor {
public func FlatMaroon() -> UIColor {
return UIColor.flatMaroonColor()
}

func FlatMint() -> UIColor {
public func FlatMint() -> UIColor {
return UIColor.flatMintColor()
}

func FlatNavyBlue() -> UIColor {
public func FlatNavyBlue() -> UIColor {
return UIColor.flatNavyBlueColor()
}

func FlatOrange() -> UIColor {
public func FlatOrange() -> UIColor {
return UIColor.flatOrangeColor()
}

func FlatPink() -> UIColor {
public func FlatPink() -> UIColor {
return UIColor.flatPinkColor()
}

func FlatPlum() -> UIColor {
public func FlatPlum() -> UIColor {
return UIColor.flatPlumColor()
}

func FlatPowderBlue() -> UIColor {
public func FlatPowderBlue() -> UIColor {
return UIColor.flatPowderBlueColor()
}

func FlatPurple() -> UIColor {
public func FlatPurple() -> UIColor {
return UIColor.flatPurpleColor()
}

func FlatRed() -> UIColor {
public func FlatRed() -> UIColor {
return UIColor.flatRedColor()
}

func FlatSand() -> UIColor {
public func FlatSand() -> UIColor {
return UIColor.flatSandColor()
}

func FlatSkyBlue() -> UIColor {
public func FlatSkyBlue() -> UIColor {
return UIColor.flatSkyBlueColor()
}

func FlatTeal() -> UIColor {
public func FlatTeal() -> UIColor {
return UIColor.flatTealColor()
}

func FlatWatermelon() -> UIColor {
public func FlatWatermelon() -> UIColor {
return UIColor.flatWatermelonColor()
}

func FlatWhite() -> UIColor {
public func FlatWhite() -> UIColor {
return UIColor.flatWhiteColor()
}

func FlatYellow() -> UIColor {
public func FlatYellow() -> UIColor {
return UIColor.flatYellowColor()
}


// MARK: - Chameleon - Dark Shades Shorthand

//Chameleon Flat Colors - Dark Shades Shorthand
func FlatBlackDark() -> UIColor {
public func FlatBlackDark() -> UIColor {
return UIColor.flatBlackColorDark()
}

func FlatBlueDark() -> UIColor {
public func FlatBlueDark() -> UIColor {
return UIColor.flatBlueColorDark()
}

func FlatBrownDark() -> UIColor {
public func FlatBrownDark() -> UIColor {
return UIColor.flatBrownColorDark()
}

func FlatCoffeeDark() -> UIColor {
public func FlatCoffeeDark() -> UIColor {
return UIColor.flatCoffeeColorDark()
}

func FlatForestGreenDark() -> UIColor {
public func FlatForestGreenDark() -> UIColor {
return UIColor.flatForestGreenColorDark()
}

func FlatGrayDark() -> UIColor {
public func FlatGrayDark() -> UIColor {
return UIColor.flatGrayColorDark()
}

func FlatGreenDark() -> UIColor {
public func FlatGreenDark() -> UIColor {
return UIColor.flatGreenColorDark()
}

func FlatLimeDark() -> UIColor {
public func FlatLimeDark() -> UIColor {
return UIColor.flatLimeColorDark()
}

func FlatMagentaDark() -> UIColor {
public func FlatMagentaDark() -> UIColor {
return UIColor.flatMagentaColorDark()
}

func FlatMaroonDark() -> UIColor {
public func FlatMaroonDark() -> UIColor {
return UIColor.flatMaroonColorDark()
}

func FlatMintDark() -> UIColor {
public func FlatMintDark() -> UIColor {
return UIColor.flatMintColorDark()
}

func FlatNavyBlueDark() -> UIColor {
public func FlatNavyBlueDark() -> UIColor {
return UIColor.flatNavyBlueColorDark()
}

func FlatOrangeDark() -> UIColor {
public func FlatOrangeDark() -> UIColor {
return UIColor.flatOrangeColorDark()
}

func FlatPinkDark() -> UIColor {
public func FlatPinkDark() -> UIColor {
return UIColor.flatPinkColorDark()
}

func FlatPlumDark() -> UIColor {
public func FlatPlumDark() -> UIColor {
return UIColor.flatPlumColorDark()
}

func FlatPowderBlueDark() -> UIColor {
public func FlatPowderBlueDark() -> UIColor {
return UIColor.flatPowderBlueColorDark()
}

func FlatPurpleDark() -> UIColor {
public func FlatPurpleDark() -> UIColor {
return UIColor.flatPurpleColorDark()
}

func FlatRedDark() -> UIColor {
public func FlatRedDark() -> UIColor {
return UIColor.flatRedColorDark()
}

func FlatSandDark() -> UIColor {
public func FlatSandDark() -> UIColor {
return UIColor.flatSandColorDark()
}

func FlatSkyBlueDark() -> UIColor {
public func FlatSkyBlueDark() -> UIColor {
return UIColor.flatSkyBlueColorDark()
}

func FlatTealDark() -> UIColor {
public func FlatTealDark() -> UIColor {
return UIColor.flatTealColorDark()
}

func FlatWatermelonDark() -> UIColor {
public func FlatWatermelonDark() -> UIColor {
return UIColor.flatWatermelonColorDark()
}

func FlatWhiteDark() -> UIColor {
public func FlatWhiteDark() -> UIColor {
return UIColor.flatWhiteColorDark()
}

func FlatYellowDark() -> UIColor {
public func FlatYellowDark() -> UIColor {
return UIColor.flatYellowColorDark()
}
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,18 @@ All methods, properties, and types available in the Chameleon Framework are docu
####CocoaPods Installation
Chameleon is now available on [CocoaPods](http://cocoapods.org). Simply add the following to your project Podfile, and you'll be good to go.

######Objective-C
```ruby
use_frameworks!

pod 'ChameleonFramework'
```
######Swift
```ruby
use_frameworks!

**Swift Users:** If you'd like to use Chameleon Shorthand in Swift, download and drag the following file, [ChameleonShorthand.swift](https://github.com/ViccAlexander/Chameleon/blob/master/Pod/Classes/Swift/ChameleonShorthand.swift), into your project, and you'll be good to go (Swift 2 compatible).
pod 'ChameleonFramework/Swift'
```

####Manual Installation
If you rather install this framework manually, just drag and drop the Chameleon folder into your project, and make sure you check the following boxes.
Expand Down

0 comments on commit 848b93c

Please sign in to comment.