Skip to content

Commit

Permalink
Fix missing images issue, update .podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Prokop committed Nov 1, 2015
1 parent 8d18d46 commit c6c429d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
5 changes: 3 additions & 2 deletions StarryStars.podspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Pod::Spec.new do |s|
s.name = 'StarryStars'
s.version = '0.0.1'
s.version = '0.0.2'
s.license = 'MIT'
s.summary = 'iOS GUI library for displaying and editing ratings'
s.homepage = 'https://github.com/peterprokop/SwiftOverlays'
s.authors = { 'Peter Prokop' => '[email protected]' }
s.source = { :git => 'https://github.com/peterprokop/StarryStars.git', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.requires_arc = 'true'
s.source_files = 'StarryStars/*'
s.source_files = 'StarryStars/*.swift'
s.resource_bundle = { 'StarryStars' => 'StarryStars/Assets.xcassets' }
end
10 changes: 6 additions & 4 deletions StarryStars/RatingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protocol RatingViewDelegate {

@IBDesignable
public class RatingView: UIView {

@IBInspectable var starCount: Int = 5
@IBInspectable var offImage: UIImage?
@IBInspectable var onImage: UIImage?
Expand Down Expand Up @@ -54,14 +54,16 @@ public class RatingView: UIView {
}

func customInit() {
let bundle = NSBundle(forClass: RatingView.self)

if offImage == nil {
offImage = UIImage(named: "starBigOff")!
offImage = UIImage(named: "starBigOff", inBundle: bundle, compatibleWithTraitCollection: self.traitCollection)
}
if onImage == nil {
onImage = UIImage(named: "starBig")!
onImage = UIImage(named: "starBig", inBundle: bundle, compatibleWithTraitCollection: self.traitCollection)
}
if halfImage == nil {
halfImage = UIImage(named: "starBigHalf")!
halfImage = UIImage(named: "starBigHalf", inBundle: bundle, compatibleWithTraitCollection: self.traitCollection)
}

guard let offImage = offImage else {
Expand Down
8 changes: 0 additions & 8 deletions StarryStarsExample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
<constraint firstAttribute="height" constant="100" id="z8j-Ra-riY"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="image" keyPath="offImage" value="starBigOff"/>
<userDefinedRuntimeAttribute type="image" keyPath="onImage" value="starBig"/>
<userDefinedRuntimeAttribute type="image" keyPath="halfImage" value="starBigHalf"/>
<userDefinedRuntimeAttribute type="number" keyPath="starCount">
<integer key="value" value="7"/>
</userDefinedRuntimeAttribute>
Expand Down Expand Up @@ -69,9 +66,4 @@
<point key="canvasLocation" x="296" y="391"/>
</scene>
</scenes>
<resources>
<image name="starBig" width="35" height="35"/>
<image name="starBigHalf" width="35" height="35"/>
<image name="starBigOff" width="35" height="35"/>
</resources>
</document>

0 comments on commit c6c429d

Please sign in to comment.