Skip to content

Commit

Permalink
common improves
Browse files Browse the repository at this point in the history
  • Loading branch information
0ber committed Feb 4, 2016
1 parent 392cca7 commit c948f16
Showing 1 changed file with 12 additions and 5 deletions.
Expand Up @@ -34,11 +34,17 @@ class RAMFrameItemAnimation: RAMItemAnimation {

override func awakeFromNib() {

let path = NSBundle.mainBundle().pathForResource(imagesPath, ofType:"plist")
guard let path = NSBundle.mainBundle().pathForResource(imagesPath, ofType:"plist") else {
fatalError("don't found plist")
}

let dict : NSDictionary = NSDictionary(contentsOfFile: path!)!
guard let dict : NSDictionary = NSDictionary(contentsOfFile: path) else {
fatalError()
}

let animationImagesName = dict["images"] as! Array<String>
guard let animationImagesName = dict["images"] as? Array<String> else {
fatalError()
}
createImagesArray(animationImagesName)

// selected image
Expand All @@ -49,8 +55,9 @@ class RAMFrameItemAnimation: RAMItemAnimation {

func createImagesArray(imageNames : Array<String>) {
for name : String in imageNames {
let image = UIImage(named: name)?.CGImage
animationImages.append(image!)
if let image = UIImage(named: name)?.CGImage {
animationImages.append(image)
}
}
}

Expand Down

0 comments on commit c948f16

Please sign in to comment.