Thank you for visiting our account. We are going to make a simple photo frame app in an hour. If would you like to study yourself before hands-on, or review what you have learned in the session, please use the following material.
We are providing free hands-on on a monthly basis
https://www.meetup.com/iOS-Development-Meetup-for-Beginner/
We also hold face-to-face or group lesson for individual interested in making iOS app themselves
http://ios-class-for-beginner.esy.es/
XCode 8.1 / Swift 3
0-1. Open XCode
0-2. Select "Create a new XCode project"
0-3. Select "Single View Application" and then tap "Next"
0-4. Fill "Product name" and then tap "Next"
0-5. Select the place for saving your project and then tap "Create"
2-1. Drap & Drop "UIImageView" from UI components
2-2. Resize the imageView
2-3. Set "Autoresizing" for adjusting frame depending on devices
2-5. Specify the image name and content mode
2-5. Add UIButton in the same process from 2-1 to 2-3
2-6. Connect UI components on Storyboard to ViewController.swift ★ control + drag in storyboard to create a control segue
★ It's preferable to write following code yourself. It will help you to understand code more.
import UIKit
import AVFoundation
class ViewController: UIViewController
{
var audioPlayer: AVAudioPlayer!
override func viewDidLoad()
{
super.viewDidLoad()
// Get file path
let filePath = Bundle.main.path(forResource: "music", ofType: "mp3")
let audioPath = URL(fileURLWithPath: filePath!)
do {
// Initialize audio player
audioPlayer = try AVAudioPlayer(contentsOf: audioPath)
audioPlayer.prepareToPlay()
} catch {
print("Error")
}
}
@IBAction func tappedPlay(_ sender: Any)
{
// Play
audioPlayer.play()
}
@IBAction func tappedStop(_ sender: Any)
{
// Stop
audioPlayer.stop()
}
}