This code sample demonstrates how you can reorder an array.

A possible scenario is when you have multiple-choise questions that you want to present in a different order every time they are shown.

var arrUniqueNumbers = [1,2,3,4]        
print("Array before shuffle: \(arrUniqueNumbers)")    
let count = arrUniqueNumbers.count
for i in 0..<count{
            let n = Int(arc4random_uniform(UInt32(count-i)))+i            
            (arrUniqueNumbers[i], arrUniqueNumbers[n]) = 
                              (arrUniqueNumbers[n], arrUniqueNumbers[i])
           }
print("Array after shuffle: \(arrUniqueNumbers)")

 

How Was Your Mood?

Everybody experiences moodswings in some way or another, it is a natural thing. There can be a lot of reasons for wanting to get an insight in your moodswings, from simply being interested to being diagnosed bipolar.

DevJockeys developed the iOS app ‘How was your mood’. It is a friendly app, which helps you to document your mood swings on a daily basis,
by asking you a simple question: how was your mood today?
Because it is so important to know if your mood change was a reaction to events, or seemed to have no reason at all,
the app enables you to make notes, which you can easily access in the graph. Intuitive and simple!

INSTRUCTIONS

*start screen:

  • pan or tap to set your daily mood
  • select “date” to fill in moods for other (past) dates
  • after setting your mood, select “note” to make some notes for this day
  • tap on “overview” to show the graph
  • tap on “settings” to open the settings view

*settings

  • enable or disable autocorrection while editing notes
  • enable or disable daily notifications. When switched on, tap the “edit” button to set a notification time. The app will remind you to fill in your mood at the time you set here daily

*Overview / Graph

  • swipe left or right to scroll the graph
  • use the “+” and “-” buttons to change the year
  • tap on a date point to view or edit notes

You can find “How Was Your Mood” in Apple’s App Store.

Get it on Google Play

Google Play and the Google Play logo are trademarks of Google LLC.