Lecture7
Just another Kyoung Shin Park’s Lectures Sites site
SimpleVC (using Segue, UIViewController)
https://developer.apple.com/xcode/
“Xcode 7 and Swift now make it easier for everyone to build apps and run them directly on their Apple devices. Simply sign in with your Apple ID, and turn your idea into an app that you can touch on your iPad, iPhone, or Apple Watch. Download Xcode 7 beta and try it yourself today. Program membership is not required.”
6. Make sure to set iOS Deployment Target (e.g. iOS 8.4) in Build Settings for both Project and Target
7. Click on the Fix Issue for Failed to code sign xxxx
8. If there’s no build errors, the app should now launch on your phone
SimplePolygon (using UIBezierPath & UIView)
Lecture6
Design of Portable Multimedia Devices (448460)
– iOS CampusLife AR Application –
Fall 2016
Kyoung Shin Park
October 25, 2016
“iOS LBS Dating Application” Modification & Technical Document
The goal of this group term project assignment is to experiment with the modification of existing iOS campus dating applications, to understand the process of designing application functions, as separate from creating the application “assets” or technology, and to design system architecture diagram.
Your modified the existing iOS campus dating application scenario is expected to be completed, and it should be in some way dedicated to new and engaging.
First, your application modification will be built on one of the known applications you surveyed (e.g. eting?, 아만다?, wallme? etc) or traditional dating approach to be modified so that it benefits from iOS mobile service.
Summit & present the modification & technical document presentation in class on Nov 8th, 2016.
Requirements:
-New results must be devised – they can be completely new, or substantial changes to the existing application functions.
-The modification must make use of iPad “assets”.
-Not all the existing application’s parts need to be used.
-Slight introduction of new materials (e.g. more items, different items).
-The functions must be clear and complete, so that a stranger will be able to take them as is and use your new application (include the target audience, user preference, and an estimate of the playing time)
-Notes on the application focus, development and testing – any issues that were revealed during testing; in particular, think about “is the application easy to use?”
-Software design document (including system diagram, DB design)
GeometryCalculator
class ViewController: UIViewController, UITextFieldDelegate {
var selectedIndex : Int = 1
@IBOutlet weak var labal6 : UILabel! // geometry type
@IBOutlet weak var labal1 : UILabel! // input1 label
@IBOutlet weak var labal2 : UILabel! // input2 label
@IBOutlet weak var labal3 : UILabel! // input3 label
@IBOutlet weak var textField1 : UITextField! // input1
@IBOutlet weak var textField2 : UITextField! // input2
@IBOutlet weak var textField3 : UITextField! // input3
@IBOutlet weak var textField4 : UITextField! // S.A.
@IBOutlet weak var textField5 : UITextField! // Volume
@IBOutlet weak var selector : UISegmentedControl!
func calculateGeometry() {
if let type = GeometryType.valueOf(selectedIndex) {
label6.text = type.description
// label & textfield
textField1.hidden = false
textField2.hidden = false
textField3.hidden = false
switch type {
case .Sphere:
label1.text = “Radius”
label2.text = “”
label3.text = “”
textField2.hidden = true
textField3.hidden = true
let calc = Sphere(radius: textField1.text!.toDouble())
textField4.text = “\(calc.SurfaceArea)”
textField5.text = “\(calc.Volume)”
case .Cone:
label1.text = “Radius”
label2.text = “Height”
label3.text = “”
textField3.hidden = true
let calc = Cone(radius: textField1.text!.toDouble(), height: textField2.text!.toDouble())
textField4.text = “\(calc.SurfaceArea)”
textField5.text = “\(calc.Volume)”
case .Cylinder:
label1.text = “Radius”
label2.text = “Height”
label3.text = “”
textField3.hidden = true
let calc = Cylinder(radius: textField1.text!.toDouble(), height: textField2.text!.toDouble())
textField4.text = “\(calc.SurfaceArea)”
textField5.text = “\(calc.Volume)”
case .RectangularPrism:
label1.text = “Width”
label2.text = “Height”
label3.text = “Length”
let calc = RectangularPrism(width: textField1.text!.toDouble(), height: textField2.text!.toDouble(), length: textField3.text!.toDouble())
textField4.text = “\(calc.SurfaceArea)”
textField5.text = “\(calc.Volume)”
case .SquarePyramid:
label1.text = “Base”
label2.text = “Height”
label3.text = “”
textField3.hidden = true
let calc = SquarePyramid(base: textField1.text!.toDouble(), height: textField2.text!.toDouble())
textField4.text = “\(calc.SurfaceArea)”
textField5.text = “\(calc.Volume)”
case .IsoscelesTriangularPrism:
label1.text = “Base”
label2.text = “Height”
label3.text = “Length”
let calc = IsoscelesTriangularPrism(base: textField1.text!.toDouble(), height: textField2.text!.toDouble(), length: textField3.text!.toDouble())
textField4.text = “\(calc.SurfaceArea)”
textField5.text = “\(calc.Volume)”
}
}
}
@IBAction func selectGeometry(sender: AnyObject) {
selectedIndex = selector.selectedSegmentIndex + 1
calculateGeometry()
}
func textFieldShouldReturn(textField: UITextField) -> Bool {
textField.resignFirstResponder()
calculateGeometry()
return true
}
override func viewDidLoad() {
super.viewDidLoad()
// do something
calculateGeometry()
textField1.delegate = self
textField2.delegate = self
textField3.delegate = self
}
}
//
// ViewController.swift
// SimpleTemperatureConverter
//
// Created by Kyoung Shin Park on 10/2/16.
// Copyright © 2016 Kyoung Shin Park. All rights reserved.
//
import UIKit
extension String {
func toDouble() -> Double {
if let unwrappedNum = Double(self) {
return unwrappedNum
}
else {
print(“Error converting \”” + self + “\” to Double”)
return 0.0
}
}
func toInt() -> Int {
if let unwrappedNum = Int(self) {
return unwrappedNum
}
else {
print(“Error converting \”” + self + “\” to Int”)
return 0
}
}
}
class ViewController: UIViewController {
//var fahrenheit : Double = 0.0
//var celsius : Double = 0.0
@IBOutlet weak var fahrenheitTextfield: UITextField!
@IBOutlet weak var celsiusTextfield: UITextField!
@IBAction func convertFahrenheitToCelsius(sender: AnyObject) {
if let _ = sender as? UIButton {
let fahrenheit = fahrenheitTextfield.text!.toDouble()
let converter = FahrenheitToCelsius(temperature: fahrenheit)
celsius = converter.celsius
//celsiusTextfield.text = “\(celsius)”
celsiusTextfield.text = String.localizedStringWithFormat(“%.2f”, celsius)
}
}
@IBAction func convertCelsiusToFahrenheit(sender: AnyObject) {
if let _ = sender as? UIButton {
celsius = celsiusTextfield.text!.toDouble()
let converter = CelsiusToFahrenheit(temperature: celsius)
fahrenheit = converter.fahrenheit
//fahrenheitTextfield.text = “\(fahrenheit)”
fahrenheitTextfield.text = String.localizedStringWithFormat(“%.2f”, fahrenheit)
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
fahrenheit = 50.0
fahrenheitTextfield.text = “\(fahrenheit)”
celsiusTextfield.text = “”
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}