Cannot assign to value: 'image' is a method [duplicate] - ios

This question already has answers here:
Setting an image for a UIButton in code
(12 answers)
Closed 3 years ago.
I want to change the image displayed by picking a random value from an array of images.
import UIKit
class ViewController: UIViewController {
let imageArray = ["ball1", "ball2", "ball3", "ball4", "ball5"]
var number: Int = 0
#IBOutlet weak var myImage: UIButton!
#IBAction func buttonPressed(_ sender: UIButton) {
number = Int.random(in: 0 ... 4)
myImage.image = UIImage(named: imageArray[number+1])
}
override func viewDidLoad() {
super.viewDidLoad()
myImage.image = UIImage(named: "ball1")
number = Int.random(in: 0 ... 4)
myImage.image = UIImage(named: imageArray[number+1])
}
}
In lines 19, 24, and 26 (whenever I try to change the image) I get the error "Cannot assign to value: 'image is a method". Why is this?

Set image with state property equals to .normal:
import UIKit
class ViewController: UIViewController {
let imageArray = ["ball1", "ball2", "ball3", "ball4", "ball5"]
var number: Int = 0
#IBOutlet weak var myImage: UIButton!
#IBAction func buttonPressed(_ sender: UIButton) {
number = Int.random(in: 0 ... 4)
myImage.setImage(UIImage(named: imageArray[number+1]), for: .normal)
}
override func viewDidLoad() {
super.viewDidLoad()
myImage.setImage(UIImage(named: "ball1"), for: .normal)
number = Int.random(in: 0 ... 4)
myImage.setImage(UIImage(named: imageArray[number+1]), for: .normal)
}
}

Related

UIImageView Array iOS13

I am trying with learning Swift and got stuck on an issue here.
import UIKit
class ViewController: UIViewController {
#IBOutlet weak var diceImageView1: UIImageView!
#IBOutlet weak var diceImageView2: UIImageView!
var leftDiceNumber=1
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
diceImageView1.image = UIImage(imageLiteralResourceName: "DiceSix")
// change transparency with diceImageView1.alpha=0.7
}
#IBAction func rollButtonPressed(_ sender: UIButton) {
print("button pressed")
diceImageView1 = [ UIImageView(imageLiteralResourceName: "DiceOne"),UIImageView(imageLiteralResourceName: "DiceTwo"),UIImageView(imageLiteralResourceName: "DiceThree"),UIImageView(imageLiteralResourceName: "DiceFour"),UIImageView(imageLiteralResourceName: "DiceFive"),UIImageView(imageLiteralResourceName: "DiceSix")],[leftDiceNumber]
leftDiceNumber=leftDiceNumber+1
}
}
But all I get is the error messages on the IBAction:
1.Argument passed to call that takes no arguments
2.Cannot assign value of type '[UIImageView]' to type 'UIImageView'
3.Consecutive statements on a line must be separated by ';'
4.Expected expression
What's the difference between UIImageView and UIImage ? When they should be used?
Many Thanks in advance !
You want to change the .image property to change the image.
To "cycle through" the dice, you could do this:
class DiceViewController: UIViewController {
#IBOutlet weak var diceImageView1: UIImageView!
#IBOutlet weak var diceImageView2: UIImageView!
let diceNames: [String] = [
"DiceOne", "DiceTwo", "DiceThree", "DiceFour", "DiceFive", "DiceSix"
]
var leftDiceNumber = 0
override func viewDidLoad() {
super.viewDidLoad()
diceImageView1.image = UIImage(named: diceNames[leftDiceNumber % 6])
}
#IBAction func rollButtonPressed(_ sender: UIButton) {
print("button pressed")
// increment the index
leftDiceNumber += 1
// udpate the image view
diceImageView1.image = UIImage(named: diceNames[leftDiceNumber % 6])
}
}
I'm guessing your goal is to "randomly roll" the dice, so take a look at this slightly different class:
class DiceViewController: UIViewController {
#IBOutlet weak var diceImageView1: UIImageView!
#IBOutlet weak var diceImageView2: UIImageView!
let diceNames: [String] = [
"DiceOne", "DiceTwo", "DiceThree", "DiceFour", "DiceFive", "DiceSix"
]
override func viewDidLoad() {
super.viewDidLoad()
// start with both dice at One
diceImageView1.image = UIImage(named: diceNames[0])
diceImageView2.image = UIImage(named: diceNames[0])
}
#IBAction func rollButtonPressed(_ sender: UIButton) {
print("button pressed")
// arrays are Zero-based, so get a random Int
// from 0 to 5
//let l = Int.random(in: 0...5)
//let r = Int.random(in: 0...5)
//diceImageView1.image = UIImage(named: diceNames[l])
//diceImageView2.image = UIImage(named: diceNames[r])
// more "modern Swifty" method
if let nm = diceNames.randomElement() {
diceImageView1.image = UIImage(named: nm)
}
if let nm = diceNames.randomElement() {
diceImageView2.image = UIImage(named: nm)
}
}
}

IOS Updating button title and updating array with button value?

I am new to IOS Development and am implementing IOS QUIZ App.
How to update question and answers in QUIZ app.
Please check below my code this is how I am displaying.
#IBOutlet weak var prevBtn: UIButton!
#IBOutlet weak var nxtBtn: UIButton!
#IBOutlet weak var qstnlbl: UILabel!
#IBOutlet weak var answerABtn: UIButton!
#IBOutlet weak var answerBBtn: UIButton!
#IBOutlet weak var answerCBtn: UIButton!
#IBOutlet weak var answerDBtn: UIButton!
let questions = ["How many days are there in 1 year?", "Favorite color?", "Where was I born?"]
let answers = [["360", "365", "384", "377"], ["blue", "black", "green", "orange"], ["Tokyo", "New York", "Tennessee", "rajahmundry"]]
//Variables
var currentQuestion = 0
var rightAnswerPlacement:UInt32 = 0
var points = 0;
//Label
#IBOutlet weak var lbl: UILabel!
//Button
#IBAction func action(_ sender: AnyObject)
{
if (sender.tag == Int(rightAnswerPlacement))
{
print ("RIGHT!")
points += 1
}
else
{
print ("WRONG!!!!!!")
}
if (currentQuestion != questions.count)
{
newQuestion()
}
}
#IBAction func preAction(_ sender: AnyObject)
{
if (currentQuestion != questions.count)
{
newQuestion()
}
currentQuestion = currentQuestion - 1
}
#IBAction func nxtaction(_ sender: AnyObject)
{
if (currentQuestion != questions.count)
{
newQuestion()
}
currentQuestion = currentQuestion + 1
}
override func viewDidAppear(_ animated: Bool)
{
newQuestion()
}
//Function that displays new question
func newQuestion()
{
qstnlbl.text = questions[currentQuestion]
rightAnswerPlacement = arc4random_uniform(3)+1
//Create a button
var button:UIButton = UIButton()
var x = 1
for i in 1...4
{
//Create a button
button = view.viewWithTag(i) as! UIButton
button.setTitle(answers[currentQuestion][x], for: .normal)
x = 2
}
currentQuestion += 1
}
based on user selection answers has be to added to answerArray.
For Ex: if user selects in first question in answerABtn answer option "A " answerArray has to update with "A" value.
user can able to update answer
for Ex: user select 1st question answer option "b" answerArray has to update with "b" value.
please help me out to make this quiz app.
quiz app ui
enter image description here
There are quite a few things you should be doing differently, but to get you on your way...
You will want to create a answerArray variable to hold the user-selected answers. Inside your action func, you are already tracking which button was tapped, so append the button's title to your answer array at the same point.
Your current previous and next actions don't make any sense, because you are not tracking the question count correctly, and you are picking a random "correct" answer each time.
Here is your code, modified for:
better question count incrementing
tracking user selected answers in answerArray
clearing the screen when the quiz is complete
Note: this is just example code... this should not be considered "everything fixed" -- but it should help you with this step. Review the comments I've added to your code.
class QuizViewController: UIViewController {
#IBOutlet weak var prevBtn: UIButton!
#IBOutlet weak var nxtBtn: UIButton!
#IBOutlet weak var qstnlbl: UILabel!
#IBOutlet weak var answerABtn: UIButton!
#IBOutlet weak var answerBBtn: UIButton!
#IBOutlet weak var answerCBtn: UIButton!
#IBOutlet weak var answerDBtn: UIButton!
let questions = ["How many days are there in 1 year?", "Favorite color?", "Where was I born?"]
let answers = [["360", "365", "384", "377"], ["blue", "black", "green", "orange"], ["Tokyo", "New York", "Tennessee", "rajahmundry"]]
//Variables
var currentQuestion = 0
var rightAnswerPlacement:UInt32 = 0
var points = 0;
// array to hold answers
var answerArray: [String] = [String]()
//Label
#IBOutlet weak var lbl: UILabel!
//Button
#IBAction func action(_ sender: AnyObject)
{
// make sure this came from a button, and get the button title
guard let btn = sender as? UIButton,
let btnTitle = btn.currentTitle else { return }
if (btn.tag == Int(rightAnswerPlacement))
{
print ("RIGHT!")
points += 1
}
else
{
print ("WRONG!!!!!!")
}
// append the selected answer to the answerArray
answerArray.append(btnTitle)
// increment question counter
currentQuestion += 1
// if there are more questions
if (currentQuestion < questions.count)
{
newQuestion()
}
else
{
quizComplete()
}
}
func quizComplete() -> Void {
[answerABtn, answerBBtn, answerCBtn, answerDBtn].forEach {
$0?.isHidden = true
}
qstnlbl.text = "Your score: \(points)"
}
// these two funcs do not make any sense as written
/*
#IBAction func preAction(_ sender: AnyObject)
{
if (currentQuestion != questions.count)
{
newQuestion()
}
currentQuestion = currentQuestion - 1
}
#IBAction func nxtaction(_ sender: AnyObject)
{
if (currentQuestion != questions.count)
{
newQuestion()
}
currentQuestion = currentQuestion + 1
}
*/
override func viewDidAppear(_ animated: Bool)
{
newQuestion()
}
//Function that displays new question
func newQuestion()
{
qstnlbl.text = questions[currentQuestion]
rightAnswerPlacement = arc4random_uniform(3)+1
for i in 1...4
{
// get a reference to a button
let button = view.viewWithTag(i) as! UIButton
button.setTitle(answers[currentQuestion][i-1], for: .normal)
}
// don't increment question count here
// increment it AFTER user answers the question (in button tap action)
//currentQuestion += 1
}
}
here you go:
import UIKit
class ViewController: UIViewController {
var emptyArray : [String] = []
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .red
}
#objc func buttonAction(sender: UIButton!) {
emptyArray.append("A")
print(emptyArray)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let button = UIButton()
button.frame = CGRect(x: self.view.frame.size.width - 300, y: 200, width: 100, height: 100)
button.backgroundColor = UIColor.blue
button.setTitle("Name your Button ", for: .normal)
button.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)
self.view.addSubview(button)
}
}
when you press the buttom over and over, the output to debug window is this
["A"]
["A", "A"]
["A", "A", "A"]
["A", "A", "A", "A"]

Random Numbers in Swift

I would like to create random numbers to be displayed in 5 UIImage boxes on the front of the app. However, I would like those numbers to not always be in the same range. For instance, my code below shows 0 ... 9 for randomPoolBallIndex3. But instead, I would like it to show any number from 0 ... 49 but not duplicate the same number on the other randomPoolBallIndex's. So every time the button is pressed it will not display, let's say 1, 1, 34, 35 and 50, but instead each number will be different.
Is there a way to pull this off?
I broke the array down from 0 ... 49 for each randomPoolBallIndex's but now they will only display what I have set the ranges for and I am not entirely happy, while it has resolved the duplication problem.
Code Below:
let ballArray = ["poolball1","poolball2","poolball3","poolball4","poolball5","poolball6","poolball7","poolball8","poolball9","poolball10","poolball11","poolball12","poolball13","poolball14","poolball15","poolball16","poolball17","poolball18","poolball19","poolball20","poolball21","poolball22","poolball23","poolball24","poolball25","poolball26","poolball27","poolball28","poolball29","poolball30","poolball31","poolball32","poolball33","poolball34","poolball35","poolball36","poolball37","poolball38","poolball39","poolball40","poolball41","poolball42","poolball43","poolball44","poolball45","poolball46","poolball47","poolball48","poolball49","poolball50"]
var randomPoolBallIndex: Int = 0
var randomPoolBallIndex1: Int = 0
var randomPoolBallIndex2: Int = 0
var randomPoolBallIndex3: Int = 0
var randomPoolBallIndex4: Int = 0
var randomPoolBallIndex5: Int = 0
#IBOutlet weak var poolBallView1: UIImageView!
#IBOutlet weak var poolBallView2: UIImageView!
#IBOutlet weak var poolBallView3: UIImageView!
#IBOutlet weak var poolBallView4: UIImageView!
#IBOutlet weak var poolBallView5: UIImageView!
#IBAction func buttonPressed(_ sender: UIButton) {
randomPoolBallIndex1 = Int.random(in: 20 ... 29)
randomPoolBallIndex2 = Int.random(in: 40 ... 49)
randomPoolBallIndex3 = Int.random(in: 0 ... 9)
randomPoolBallIndex4 = Int.random(in: 30 ... 39)
randomPoolBallIndex5 = Int.random(in: 10 ... 19)
poolBallView1.image = UIImage(named: ballArray[randomPoolBallIndex1])
poolBallView2.image = UIImage(named: ballArray[randomPoolBallIndex2])
poolBallView3.image = UIImage(named: ballArray[randomPoolBallIndex3])
poolBallView4.image = UIImage(named: ballArray[randomPoolBallIndex4])
poolBallView5.image = UIImage(named: ballArray[randomPoolBallIndex5])
Using Shuffled
I suppose you just need to get 5 different random pool ball names from your ballArray. So you don't need to generate any random numbers. Just in buttonPressed create a constant from shuffled ballArray
let shuffledBallArray = ballArray.shuffled()
now just set images like this:
poolBallView1.image = UIImage(named: shuffledBallArray[0])
poolBallView2.image = UIImage(named: shuffledBallArray[1])
...
So your buttonPressed action should look like this:
#IBAction func buttonPressed(_ sender: UIButton) {
let shuffledBallArray = ballArray.shuffled()
poolBallView1.image = UIImage(named: shuffledBallArray[0])
poolBallView2.image = UIImage(named: shuffledBallArray[1])
poolBallView3.image = UIImage(named: shuffledBallArray[2])
poolBallView4.image = UIImage(named: shuffledBallArray[3])
poolBallView5.image = UIImage(named: shuffledBallArray[4])
}
Creating Unique Random Numbers
Alternatively you can create function which gives you 5 unique random numbers
func generateNumbers(repetitions: Int, maxValue: Int) -> [Int] {
var numbers = [Int]()
for _ in 1...repetitions {
var n: Int
repeat {
n = Int.random(in: 1...maxValue)
} while numbers.contains(n)
numbers.append(n)
}
return numbers
}
and in buttonPressed just create constant for this array of random numbers and set images without saving any image names somewhere in ballArray with hardcoded 50 names
#IBAction func buttonPressed(_ sender: UIButton) {
let randomNumbers = generateNumbers(repetitions: 5, maxValue: 50)
poolBallView1.image = UIImage(named: "poolBall\(randomNumbers[0])")
poolBallView2.image = UIImage(named: "poolBall\(randomNumbers[1])")
poolBallView3.image = UIImage(named: "poolBall\(randomNumbers[2])")
poolBallView4.image = UIImage(named: "poolBall\(randomNumbers[3])")
poolBallView5.image = UIImage(named: "poolBall\(randomNumbers[4])")
}
Create an array. They allow for the storage of multitudes of data and you can reference all of them. Same for images
var randomPoolBallIndices:[Int]!
#IBOutlet weak var poolBallViews: [UIImageView]! //Look up how to make array from IBOutlets
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
randomPoolBallIndices = Array(repeating: 0, count: 5)
}
#IBAction func buttonPressed(_ sender: UIButton) {
for index in randomPoolBallIndices.indices {
let number = Int.random(in: 0 ... 49)
while (randomPoolBallIndices.contains(number)) {
number = Int.random(in: 0 ... 49)
}
randomPoolBallIndices[index] = number
poolBallViews[index] = randomPoolBallIndices[index]
}
}
Generate random number and insert it in Set. When Set count reaches 5, break the loop. That way you can avoid duplication. Then create array of random numbers from set.

Code crashing in during runtime

I am learning swift3 programming but after executing my calculator app its crashing in between. Please check the below code.
import UIKit
class ViewController: UIViewController {
#IBOutlet weak var aLabel: UILabel!
#IBOutlet weak var commmon_button: UIButton!
var a: Int?
var b: Int?
var sum: Int?
var val = ""
#IBOutlet weak var text_feild: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
#IBAction func clik_button(_ sender: UIButton) {
val=String(sender.tag)
text_feild.text = text_feild.text! + val
}
#IBAction func fn_addition(_ sender: UIButton) {
a = Int(text_feild.text!)
}
#IBAction func fn_answer(_ sender: UIButton) {
b = Int(text_feild.text!)
sum = a! + b!
a = 0
b = 0
text_feild.text = nil
text_feild.text = String(sum!)
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
During run time i am getting crash at fn_addition by saying Thread 1 breakpoint 2.1
Initiliaze your variables as below
var a = 0
var b = 0
var sum = 0
Replace your methods with below methods.
#IBAction func clik_button(_ sender: UIButton) {
guard let value = String(sender.tag), let text = text_feild.text
else {
return
}
text_feild.text = text + value
}
#IBAction func fn_addition(_ sender: UIButton) {
guard let aValue = Int(text_feild.text)
else{
return
}
a = aValue
}
#IBAction func fn_answer(_ sender: UIButton) {
guard let bValue = Int(text_feild.text)
else{return}
b = bValue
sum = a + b
a = 0
b = 0
text_feild.text = ""
text_feild.text = String(sum)
}
Suggestion: You are using same text field for taking a , b values and for showing sum result. It is better to use two different text fields for taking a and b values separately. Take a label to show sum value.

Passing Data Through Segue & some errors

Hey guys I need some one to help me finish my app, I need to finish it before Dec 15. I'm making a Tip Calculator Project in Swift2 and It must have a settings view where I select the default tip rate. I have some issues with passing data, when I select a default tip percentage it doesn't change in the View Controller, also I want to make the app remember the default rate when I close the app and reopened. I will really appreciate that some one corrects my code and test it. Im new in this, below is the code of the two ViewControllers and a screenshot of the Main.Storyboard (Image 1) (ViewController Screenshot)
My apologies for my bad English, is not my native language
ViewController
import UIKit
class ViewController: UIViewController {
//Inputs
#IBOutlet weak var amountTextField: UITextField!
//Labels
#IBOutlet weak var TipPercentageLabel: UILabel!
#IBOutlet weak var numberOfPersonLabel: UILabel!
#IBOutlet weak var tipAmountLabel: UILabel!
#IBOutlet weak var totalBillLabel: UILabel!
#IBOutlet weak var billPerPersonLabel: UILabel!
//Slider & Stepper
#IBOutlet weak var tipSlider: UISlider!
#IBOutlet weak var personsStepper: UIStepper!
//Variables
var tipPercentage = 0.20
var numberOfPerson:Int = 1
let numberFormatter:NSNumberFormatter = NSNumberFormatter()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
tipAmountLabel.text = "$0.00"
totalBillLabel.text = "Bill Total"
billPerPersonLabel.text = "$0.00"
TipPercentageLabel.text = "20.0%"
numberOfPersonLabel.text = "1"
self.amountTextField.becomeFirstResponder()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func setupContainer() {
tipSlider.minimumValue = 0
tipSlider.maximumValue = 100
tipSlider.value = 20
tipSlider.addTarget(self, action: "sliderTipChanged:", forControlEvents: .ValueChanged)
personsStepper.minimumValue = 1
personsStepper.maximumValue = 30
personsStepper.value = 1
personsStepper.addTarget(self, action: "sliderPersonChanged:", forControlEvents: .ValueChanged)
amountTextField.text = ""
refreshCalculation()
}
#IBAction func OnEditingFieldBill(sender: AnyObject) {
refreshCalculation()
}
func refreshCalculation() {
numberFormatter.numberStyle = NSNumberFormatterStyle.DecimalStyle
if let amount = numberFormatter.numberFromString(amountTextField.text!) as? Double {
let tipAmount = amount * tipPercentage
let totalBill = amount + tipAmount
let billPerPerson = totalBill / Double(numberOfPerson)
numberFormatter.numberStyle = NSNumberFormatterStyle.CurrencyStyle
tipAmountLabel.text = numberFormatter.stringFromNumber(tipAmount)
totalBillLabel.text = numberFormatter.stringFromNumber(totalBill)
billPerPersonLabel.text = numberFormatter.stringFromNumber(billPerPerson)
} else {
tipAmountLabel.text = "-"
totalBillLabel.text = "-"
billPerPersonLabel.text = "-"
}
numberFormatter.numberStyle = NSNumberFormatterStyle.PercentStyle
numberFormatter.minimumFractionDigits = 1
numberFormatter.maximumFractionDigits = 1
TipPercentageLabel.text = self.numberFormatter.stringFromNumber(tipPercentage)
numberOfPersonLabel.text = "\(numberOfPerson)"
}
#IBAction func sliderTipChanged(sender: AnyObject) {
tipPercentage = Double(round(tipSlider.value)) / 100
refreshCalculation()
}
#IBAction func StepperPersonChanged(sender: AnyObject) {
numberOfPerson = Int(round(personsStepper.value))
refreshCalculation()
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if let id = segue.identifier {
if id == "show settings" {
if let SettingsViewController = segue.destinationViewController as? SettingsViewController {
}
}
}
}
}
Settings View Controller
import UIKit
class SettingsViewController: UIViewController {
#IBOutlet weak var tipControl: UISegmentedControl!
var tipRates:Double?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
#IBAction func DefaultRate(sender: AnyObject) {
var tipRate = [5, 10, 15, 20, 25, 30]
var tipRates = Double(tipRate[tipControl.selectedSegmentIndex])
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if let id = segue.identifier {
if id == "goBackToViewController" {
if let ViewController = segue.destinationViewController as? ViewController {
if let tip = tipRates {
ViewController.tipPercentage = tip/100
}
}
}
}
---- Edit from comments ----
I think the reason it is not updating as you would like is due to a minor error with this line.
var tipRates = Double(tipRate[tipControl.selectedSegmentIndex])
Inside of your DefaultRate action function for the UISegmentedControl
Using var is a redeclaration of the same variable name, thus what you are trying to pass in the prepareForSegue is an empty variable.
This function should be changed to:
#IBAction func DefaultRate(sender: AnyObject) {
var tipRate = [5, 10, 15, 20, 25, 30]
tipRates = Double(tipRate[tipControl.selectedSegmentIndex])}
Hopefully this will now solve the error.
---- End Edit ----
From what I can see in the viewDidLoad function of your viewController, you are setting the tip label, and not updating the value based on the variable var tipPercentage.
TipPercentageLabel.text = "20.0%"
is setting the value display to always be 20.0%, you could use this here.
var tipDisplay = tipPercentage * 100
TipPercentageLabel.text = "\(tipDisplay)%"
This should update the displayed value in the label, however you never call on your other functions to recalculate the amount etc.
Thus you should also be calling on
func setupContainer()
or
func refreshCalculation()
within your ViewDidLoad().
In terms of remembering the default value when the app is closed you should look into using NSUserDefaults.
Some information regarding NSUserDefaults can be found here, which explains implementing small amounts of saved data and can be implemented in your case quite simply.

Resources