//
//  FuelGaugeView.swift
//  FuelGaugeKit
//
//  Created by Ron Lisle on 3/19/15.
//  Copyright (c) 2015 Ron Lisle. All rights reserved.
//

import UIKit

class FuelGaugeView: UIView {

    var backgroundImage:UIImageView!
    var needleImage:UIImageView!

    override func layoutSubviews() {
        super.layoutSubviews()
        
        if backgroundImage == nil {
            backgroundImage = UIImageView()
            backgroundImage.frame = self.bounds
            backgroundImage.image = UIImage(named: "FuelGaugeBG", inBundle: NSBundle(forClass: FuelGaugeView.self), compatibleWithTraitCollection: nil)
            addSubview(backgroundImage)
        }
        if needleImage == nil {
            needleImage = UIImageView()
            addSubview(needleImage)
        }
    }
}

//
//  FuelGaugeView.swift
//  FuelGaugeKit
//
//  Created by Ron Lisle on 3/19/15.
//  Copyright (c) 2015 Ron Lisle. All rights reserved.
//

import UIKit

class FuelGaugeView: UIView {

    var backgroundImage:UIImageView!
    var needleImage:UIImageView!

    override func layoutSubviews() {
        super.layoutSubviews()
        
        if backgroundImage == nil {
            backgroundImage = UIImageView()
            backgroundImage.frame = self.bounds
            backgroundImage.image = UIImage(named: "FuelGaugeBG", inBundle: NSBundle(forClass: FuelGaugeView.self), compatibleWithTraitCollection: nil)
            addSubview(backgroundImage)
        }
        if needleImage == nil {
            needleImage = UIImageView()
            needleImage.frame = self.bounds
            addSubview(needleImage)
        }
    }
}

Set needle frame to fuelGauge bounds. 7 tests, all passing.
Set needle frame to fuelGauge bounds. 7 tests, all passing.
