Country Economic & Geopolitical Analysis Outline
Country Analysis & Presentation: Assignment is an analysis detailing economic and geopolitical concerns for your country (about 6 written pages, about 1900-2500 words, with additional Works Cited page). Consider paper a ‘macro’ approach to how your country functions in our ‘Globalized World’.
PSC 100 – Relating to Clark/Sage chapters 5, 6 & 7
PSC 102 – Relating to Art/Jervis political economy & Goldstein textbook
MLA Format: double spaced, using New Times Roman 12-point font with one-inch margins. In addition to analysis (1900 words min.), works cited page using MLA style shall be included. Cite all references & use intext citations. (Page: 1-inch margins, 12-point Times New Roman font, & minimal spacing elements)
The following questions are suggestions for information to research for country paper to write & develop your analysis. Do not answer the questions for your paper; following are ideas to consider what to research.
Think S.W.O.T. - Strengths, Weaknesses, Opportunities, Threats
Examine the geopolitical realities:
Do geographical barriers protect the country from external threats? Do the ethnic, religious, cultural, and educational characteristics effect the country? What is the system of government & how is political stability of the country?
Look at the government structure: does government allow vibrant trade or it interfere? Address possible implications of not being self-sufficient with regards to feeding, educating & employing its citizens. Is the militarily vulnerable? Is economy diverse? Is the country economically powerful? Is the country a member of regional economic organizations? How stable is the country & the region they are in? What are the destabilizing forces? Are their tensions between major actors?
Examine the economic realities:
Is this a developed or developing nation? Look at agricultural & manufacturing sectors and the country’s natural resources. Does infrastructure accommodate economic activity (I.E. ports, rails, rivers, universities)? What are the major exports and imports (for describing trade flows - who they trade with)? Is work force skilled/unskilled & professional? Look at economic and trade indicators such as per capita GDP, exports and imports as a percentage of GDP, etc.
Analysis:
Taking into account the information described above, describe the country’s economic & political aspects, strengths and weaknesses of country, and address any challenges or potential liabilities posed by internal or external threats.
Address the country’s future as your research develops. What does country need to do to prosper & develop? Identify the pitfalls to be avoided. Does the future hold peace & stability or conflict? Again Think S.W.O.T.
Sources:
Works Cited page needs minimum 7 sources from high level sources, including 3 peer reviewed academic articles from ‘UT data base’ (check search boxes for peer review & ful ...
Country Economic & Geopolitical Analysis OutlineCountry Analys
1. Country Economic & Geopolitical Analysis Outline
Country Analysis & Presentation: Assignment is an analysis
detailing economic and geopolitical concerns for your country
(about 6 written pages, about 1900-2500 words, with additional
Works Cited page). Consider paper a ‘macro’ approach to how
your country functions in our ‘Globalized World’.
PSC 100 – Relating to Clark/Sage chapters 5, 6 & 7
PSC 102 – Relating to Art/Jervis political economy & Goldstein
textbook
MLA Format: double spaced, using New Times Roman 12-point
font with one-inch margins. In addition to analysis (1900 words
min.), works cited page using MLA style shall be included.
Cite all references & use intext citations. (Page: 1-inch
margins, 12-point Times New Roman font, & minimal spacing
elements)
The following questions are suggestions for information to
research for country paper to write & develop your analysis.
Do not answer the questions for your paper; following are ideas
to consider what to research.
Think S.W.O.T. - Strengths, Weaknesses, Opportunities,
Threats
Examine the geopolitical realities:
Do geographical barriers protect the country from external
threats? Do the ethnic, religious, cultural, and educational
characteristics effect the country? What is the system of
government & how is political stability of the country?
Look at the government structure: does government allow
2. vibrant trade or it interfere? Address possible implications of
not being self-sufficient with regards to feeding, educating &
employing its citizens. Is the militarily vulnerable? Is
economy diverse? Is the country economically powerful? Is the
country a member of regional economic organizations? How
stable is the country & the region they are in? What are the
destabilizing forces? Are their tensions between major actors?
Examine the economic realities:
Is this a developed or developing nation? Look at agricultural
& manufacturing sectors and the country’s natural resources.
Does infrastructure accommodate economic activity (I.E. ports,
rails, rivers, universities)? What are the major exports and
imports (for describing trade flows - who they trade with)? Is
work force skilled/unskilled & professional? Look at economic
and trade indicators such as per capita GDP, exports and
imports as a percentage of GDP, etc.
Analysis:
Taking into account the information described above, describe
the country’s economic & political aspects, strengths and
weaknesses of country, and address any challenges or potential
liabilities posed by internal or external threats.
Address the country’s future as your research develops. What
does country need to do to prosper & develop? Identify the
pitfalls to be avoided. Does the future hold peace & stability or
conflict? Again Think S.W.O.T.
Sources:
Works Cited page needs minimum 7 sources from high level
sources, including 3 peer reviewed academic articles from ‘UT
data base’ (check search boxes for peer review & full text).
Examples of data bases: Academic One File/GALE, Business
Source Complete/Premier, Europa, ProQuest, Columbia
International Affairs, and Academic Search Premier/EBSCO).
3. Use intext citations.
Check UT Library site for Country Studies & Intercultural
Communication: Start on Library Main Page (use My UT to
access library). Scroll down to Research Guides (click box) at
bottom of page. Scroll down about 1/3 to Country Studies &
Intercultural Communication (click), see on left, ‘Country
Reports & Peer Reviewed Articles’, and on right search for
‘articles in the library data bases’ – go to Business Source
Complete, see Country Reports.
Possible additional sources: Center for Strategic & International
Studies, Council on Foreign Relations, World Bank, CIA World
Factbook, Freedom House, and United Nations. Country
Reports are helpful; remember they are country reports, not
academic journals.
Additional sources after min. 7: Global Road Warrior may help
picking a country. Newspapers and .com sites are not academic.
If using newspapers, it must over the 7 min. Avoid
encyclopedias. Use college level material. Note the difference
between peer reviewed article in a journal versus a report (too
much data, not enough analysis) and newspapers (snapshot of
the moment - may get some context but no depth). Plagiarism
will earn you a failing grade.
For Country News Discussion, use Nexus Uni or Reuters or
BBC under International News – Country Studies &
Intercultural Communication.
Pro_Lab 12
1. Add a control to allow the user to change the accuracy setting
for the sensor, and notice how the output changes when moving
about using different settings.
4. 2. The app now has database access code in several view
controllers. To support a cleaner design, add a database access
class that controls all access to Core Data and provides useful
methods and properties to the rest of the app.
3. Turn off the user’s permission to access location for the App
(in the Simulator, go to Settings > Privacy > Location). Run the
app again and observe what happens. Is this appropriate
behavior? How could it be improved?
4. What would happen if the code in Listing 13.10 was placed in
viewDidLoad instead of viewWillAppear? (Check
MapPoint.swift)
5. Change the text displayed on the pin to include the City for
the contact.
6. Change the cell layout to use the other two styles.
7. Expand the settings screen to allow for specifying two sort
fields. Then have the sorting be done by first one and then the
other field.
8. Choose different fields from the Contact class to display in
the table.
9. Change the display in the table to look like this instead: Main
label: Superman from Metropolis. Detail Label: Born on: April
18, 1938.
10. Change the app so when the user taps the + button to add a
new Contact, the Contact screen is put into edit mode and the
cursor placed in the first text field.
__MACOSX/._My Contact List
__MACOSX/My Contact List/._My Contact List
__MACOSX/My Contact List/._My Contact List.xcodeproj
__MACOSX/My Contact List/._.git
6. @IBOutlet weak var txtStreet: UITextField!
@IBOutlet weak var txtCity: UITextField!
@IBOutlet weak var txtState: UITextField!
@IBOutlet weak var lblLatitude: UILabel!
@IBOutlet weak var lblLongitude: UILabel!
@IBOutlet weak var lblLocationAccuracy: UILabel!
@IBOutlet weak var lblHeading: UILabel!
@IBOutlet weak var lblHeadingAccuracy: UILabel!
@IBOutlet weak var lblAltitude: UILabel!
@IBOutlet weak var lblAltitudeAccuracy: UILabel!
lazy var geoCoder = CLGeocoder()
var locationManager: CLLocationManager!
@objc func dismissKeyboard() {
//Causes the view (or one of its embedded text fields) to
resign the first responder status.
view.endEditing(true)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let tap: UITapGestureRecognizer =
UITapGestureRecognizer(target: self,
action:
#selector(self.dismissKeyboard))
view.addGestureRecognizer(tap)
locationManager = CLLocationManager()
locationManager.delegate = self
locationManager.requestWhenInUseAuthorization() //ask
for permission to use location
}
func locationManager(_ manager: CLLocationManager,
7. didChangeAuthorization status:
CLAuthorizationStatus) {
if status == .authorizedWhenInUse {
print("Permission granted")
}
else {
print("Permission NOT granted")
}
}
@IBAction func addressToCoordinates(_ sender: Any) {
let address = "(txtStreet.text!), (txtCity.text!),
(txtState.text!))"
geoCoder.geocodeAddressString(address) {(placemarks,
error) in
self.processAddressResponse(withPlacemarks:
placemarks, error: error)
}
}
private func processAddressResponse(withPlacemarks
placemarks: [CLPlacemark]?, error: Error?) {
if let error = error {
print("Geocode Error: (error)")
}
else {
var bestMatch: CLLocation?
if let placemarks = placemarks, placemarks.count > 0 {
bestMatch = placemarks.first?.location
}
if let coordinate = bestMatch?.coordinate {
lblLatitude.text = String(format: "%gu{00B0}",
coordinate.latitude)
lblLongitude.text = String(format: "%gu{00B0}",
coordinate.longitude)
}
14. mapView.setRegion(viewRegion, animated: true)
// mapView.removeAnnotations(self.mapView.annotations)
let mp = MapPoint(latitude:
userLocation.coordinate.latitude,
longitude: userLocation.coordinate.longitude)
mp.title = "You"
mp.subtitle = "Are here"
mapView.addAnnotation(mp)
}
/*
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
mapView.setUserTrackingMode(.follow, animated: true)
}
*/
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to
do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender:
Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
17. @IBOutlet weak var lblBirthdate: UILabel!
@IBOutlet weak var btnChange: UIButton!
@IBOutlet weak var sgmtEditMode: UISegmentedControl!
@IBOutlet weak var imgContactPicture: UIImageView!
@IBOutlet weak var lblPhone: UILabel!
@IBOutlet var settingsView: UIView!
@IBAction func changePicture(_ sender: Any) {
if AVCaptureDevice.authorizationStatus(for:
AVMediaType.video) !=
AVAuthorizationStatus.authorized
{ //Camera not authorized
let alertController = UIAlertController(title: "Camera
Access Denied",
message: "In order to take
pictures, you need to allow the app to access the camera in the
Settings.",
preferredStyle: .alert)
let actionSettings = UIAlertAction(title: "Open
Settings",
style: .default) {action in
self.openSettings()
}
let actionCancel = UIAlertAction(title: "Cancel",
style: .cancel,
handler: nil)
alertController.addAction(actionSettings)
alertController.addAction(actionCancel)
present(alertController, animated: true, completion: nil)
}
else
{ // Already Authorized
if
UIImagePickerController.isSourceTypeAvailable(.camera){
let cameraController = UIImagePickerController()
cameraController.sourceType = .camera
23. UIResponder.keyboardWillHideNotification, object:
nil)
}
func unregisterKeyboardNotifications() {
NotificationCenter.default.removeObserver(self)
}
@objc func keyboardDidShow(notification: NSNotification)
{
let userInfo: NSDictionary = notification.userInfo! as
NSDictionary
let keyboardInfo =
userInfo[UIResponder.keyboardFrameBeginUserInfoKey] as!
NSValue
let keyboardSize = keyboardInfo.cgRectValue.size
// Get the existing contentInset for the scrollView and set
the bottom property to
//be the height of the keyboard
var contentInset = self.scrollView.contentInset
contentInset.bottom = keyboardSize.height
self.scrollView.contentInset = contentInset
self.scrollView.scrollIndicatorInsets = contentInset
}
@objc func keyboardWillHide(notification: NSNotification)
{
var contentInset = self.scrollView.contentInset
contentInset.bottom = 0
self.scrollView.contentInset = contentInset
self.scrollView.scrollIndicatorInsets = UIEdgeInsets.zero
}
25. //
import UIKit
import CoreData
import CoreMotion
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
lazy var motionManager = CMMotionManager()
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions:
[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customi zation after application
launch.
let settings = UserDefaults.standard
if settings.string(forKey: Constants.kSortField) == nil {
settings.set("city", forKey: Constants.kSortField)
}
if settings.string(forKey:
Constants.kSortDirectionAscending) == nil {
settings.set(true, forKey:
Constants.kSortDirectionAscending)
}
settings.synchronize()
NSLog("Sort field: %@", settings.string(forKey:
Constants.kSortField)!)
NSLog("Sort direction: (settings.bool(forKey:
Constants.kSortDirectionAscending))")
return true
}
26. func applicationWillResignActive(_ application:
UIApplication) {
// Sent when the application is about to move from active
to inactive state. This can occur for certain types of temporary
interruptions (such as an incoming phone call or SMS message)
or when the user quits the application and it begins the
transition to the background state.
// Use this method to pause ongoing tasks, disable timers,
and invalidate graphics rendering callbacks. Games should use
this method to pause the game.
}
func applicationDidEnterBackground(_ application:
UIApplication) {
// Use this method to release shared resources, save user
data, invalidate timers, and store enough application state
information to restore your application to its current state in
case it is terminated later.
// If your application supports background execution, this
method is called instead of applicationWillTerminate: when the
user quits.
}
func applicationWillEnterForeground(_ application:
UIApplication) {
// Called as part of the transition from the background to
the active state; here you can undo many of the changes made
on entering the background.
}
func applicationDidBecomeActive(_ application:
UIApplication) {
// Restart any tasks that were paused (or not yet started)
while the application was inactive. If the application was
previously in the background, optionally refresh the user
interface.
27. }
func applicationWillTerminate(_ application: UIApplication)
{
// Called when the application is about to terminate. Save
data if appropriate. See also applicationDidEnterBackground:.
}
lazy var persistentContainer: NSPersistentContainer = {
/*
The persistent container for the application. This
implementation
creates and returns a container, having loaded the store
for the
application to it. This property is optional since there are
legitimate
error conditions that could cause the creation of the store
to fail.
*/
let container = NSPersistentContainer(name:
"MyContactListModel")
container.loadPersistentStores(completionHandler: {
(storeDescription, error) in
if let error = error as NSError? {
// Replace this implementation with code to handle
the error appropriately.
// fatalError() causes the application to generate a
crash log and terminate. You should
// not use this function in a shipping application,
although it may be useful during
// development.
/*
Typical reasons for an error here include:
* The parent directory does not exist, cannot be
created, or disallows writing.
28. * The persistent store is not accessible, due to
permissions or data protection when
* the device is locked.
* The device is out of space.
* The store could not be migrated to the current
model version.
Check the error message to determine what the
actual problem was.
*/
fatalError("Unresolved error (error),
(error.userInfo)")
}
})
return container
}()
// MARK: - Core Data Saving support
func saveContext () {
let context = persistentContainer.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
// Replace this implementation with code to handle
the error appropriately.
// fatalError() causes the application to generate a
crash log and terminate. You should
// not use this function in a shipping application,
although it may be useful during
// development.
let nserror = error as NSError
fatalError("Unresolved error (nserror),
(nserror.userInfo)")
}
}
30. loadDataFromDatabase()
}
override func viewWillAppear(_ animated: Bool) {
loadDataFromDatabase()
tableView.reloadData()
}
func loadDataFromDatabase() {
let settings = UserDefaults.standard
let sortField = settings.string(forKey:
Constants.kSortField)
let sortAscending = settings.bool(forKey:
Constants.kSortDirectionAscending)
//Set up Core Data Context
let context = appDelegate.persisten tContainer.viewContext
//Set up Request
let request =
NSFetchRequest<NSManagedObject>(entityName: "Contact")
//Specify sorting
let sortDescriptor = NSSortDescriptor(key: sortField,
ascending: sortAscending)
let sortDescriptorArray = [sortDescriptor]
//to sort by multiple fields, add more sort descriptors to
the array
request.sortDescriptors = sortDescriptorArray
do {
contacts = try context.fetch(request)
} catch let error as NSError {
print("Could not fetch. (error), (error.userInfo)")
}
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView)
31. -> Int {
return 1
}
override func tableView(_ tableView: UITableView,
numberOfRowsInSection section: Int) -> Int {
return contacts.count
}
override func tableView(_ tableView: UITableView,
cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier:
"ContactsCell", for: indexPath)
// Configure the cell...
let contact = contacts[indexPath.row] as? Contact
cell.textLabel?.text = contact?.contactName
cell.detailTextLabel?.text = contact?.city
cell.accessoryType = .detailDisclosureButton
return cell
}
override func tableView(_ tableView: UITableView,
didSelectRowAt indexPath: IndexPath) {
let selectedContact = contacts[indexPath.row] as? Contact
let name = selectedContact!.contactName!
let actionHandler = { (action:UIAlertAction!) -> Void in
let storyboard = UIStoryboard(name: "Main", bundle:
nil)
let controller =
storyboard.instantiateViewController(withIdentifier:
"ContactController")
as? ContactsViewController
controller?.currentContact = selectedContact
32. self.navigationController?.pushViewController(controller!,
animated: true)
}
let alertController = UIAlertController(title: "Contact
selected",
message: "Selected row:
(indexPath.row) ((name))",
preferredStyle: .alert)
let actionCancel = UIAlertAction(title: "Cancel",
style: .cancel,
handler: nil)
let actionDetails = UIAlertAction(title: "Show Details",
style: .default,
handler: actionHandler)
alertController.addAction(actionCancel)
alertController.addAction(actionDetails)
present(alertController, animated: true, completion: nil)
}
/*
// Override to support conditional editing of the table view.
override func tableView(_ tableView: UITableView,
canEditRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the specified item to be
editable.
return true
}
*/
override func tableView(_ tableView: UITableView,
commit editingStyle:
UITableViewCell.EditingStyle,
forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
33. // Delete the row from the data source
let contact = contacts[indexPath.row] as? Contact
let context =
appDelegate.persistentContainer.viewContext
context.delete(contact!)
do {
try context.save()
}
catch {
fatalError("Error saving context: (error)")
}
loadDataFromDatabase()
tableView.deleteRows(at: [indexPath], with: .fade)
} else if editingStyle == .insert {
// Create a new instance of the appropriate class, insert
it into the array,
//and add a new row to the table view
}
}
/*
// Override to support rearranging the table view.
override func tableView(_ tableView: UITableView,
moveRowAt fromIndexPath: IndexPath, to: IndexPath) {
}
*/
/*
// Override to support conditional rearranging of the table
view.
override func tableView(_ tableView: UITableView,
canMoveRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the item to be re-
orderable.
return true
34. }
*/
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to
do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender:
Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
override func prepare(for segue: UIStoryboardSegue, sender:
Any?) {
if segue.identifier == "EditContact" {
let contactController = segue.destination as?
ContactsViewController
let selectedRow = self.tableView.indexPath(for: sender
as! UITableViewCell)?.row
let selectedContact = contacts[selectedRow!] as?
Contact
contactController?.currentContact = selectedContact!
}
}
}
__MACOSX/My Contact List/My Contact
List/._ContactsTableViewController.swift
My Contact List/My Contact List/DateViewController.swift
//
// DateViewController.swift
36. /*
// MARK: - Navigation
// In a storyboard-based application, you will often want to
do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender:
Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
__MACOSX/My Contact List/My Contact
List/._DateViewController.swift
My Contact List/My Contact List/Info.plist
NSCameraUsageDescription
Just need it
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
37. APPL
CFBundleShortVersionString
1.0
CFBundleVersion
1
LSRequiresIPhoneOS
NSLocationWhenInUseUsageDescription
We need to know where we're at!
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
Main
UIRequiredDeviceCapabilities
armv7
UIStatusBarTintParameters
UINavigationBar
Style
UIBarStyleDefault
Translucent
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UISupportedInterfaceOrientations~ipad
UIInterfaceOrientationPortrait
39. // Do any additional setup after loading the view.
pckSortField.dataSource = self;
pckSortField.delegate = self;
UIDevice.current.isBatteryMonitoringEnabled = true
NotificationCenter.default.addObserver(self,
selector:
#selector(self.batteryChanged),
name:
UIDevice.batteryStateDidChangeNotification,
object: nil)
NotificationCenter.default.addObserver(self,
selector:
#selector(self.batteryChanged),
name:
UIDevice.batteryLevelDidChangeNotification,
object: nil)
self.batteryChanged()
}
func startMotionDetection(){
let appDelegate = UIApplication.shared.delegate as!
AppDelegate
let mManager = appDelegate.motionManager
if mManager.isAccelerometerAvailable {
mManager.accelerometerUpdateInterval = 0.05
mManager.startAccelerometerUpdates(to:
OperationQueue.main) {
(data: CMAccelerometerData?, error: Error?) in
self.updateLabel(data: data!)
}
}
}
40. func updateLabel(data: CMAccelerometerData){
let statusBarHeight =
UIApplication.shared.statusBarFrame.height
let tabBarHeight =
self.tabBarController?.tabBar.frame.height
let moveFactor:Double = 15.0
var rect = lblBattery.frame
let moveToX = Double(rect.origin.x) + data.acceleration.x
* moveFactor
let moveToY = Double(rect.origin.y + rect.size.height) -
(data.acceleration.y * moveFactor)
let maxX = Double(settingsView.frame.size.width -
rect.width)
let maxY = Double(settingsView.frame.size.height -
tabBarHeight!)
let minY = Double(rect.size.height + statusBarHeight)
if(moveToX > 0 && moveToX < maxX){
rect.origin.x += CGFloat(data.acceleration.x *
moveFactor)
}
if(moveToY > minY && moveToY < maxY){
rect.origin.y -= CGFloat(data.acceleration.y *
moveFactor);
}
UIView.animate(withDuration: TimeInterval(0),
delay: TimeInterval(0),
options:
UIView.AnimationOptions.curveEaseInOut,
animations: {self.lblBattery.frame = rect},
completion: nil)
}
@objc func batteryChanged(){
let device = UIDevice.current
var batteryState: String
switch(device.batteryState){
41. case .charging:
batteryState = "+"
case .full:
batteryState = "!"
case .unplugged:
batteryState = "-"
case .unknown:
batteryState = "?"
@unknown default:
fatalError()
}
let batteryLevelPercent = device.batteryLevel * 100
let batteryLevel = String(format: "%.0f%%",
batteryLevelPercent)
let batteryStatus = "(batteryLevel) ((batteryState))"
lblBattery.text = batteryStatus
}
override func viewDidAppear(_ animated: Bool) {
let device = UIDevice.current
print("Device Info:")
print("Name: (device.name)")
print("Model: (device.model)")
print("System Name: (device.systemName)")
print("System Version: (device.systemVersion)")
print("Identifier: (device.identifierForVendor!)")
let orientation: String
switch device.orientation {
case .faceDown:
orientation = "Face Down"
case .landscapeLeft:
orientation = "Landscape Left"
case .portrait:
orientation="Portrait"
42. case .landscapeRight:
orientation = "Landscape Right"
case .faceUp:
orientation = "Face Up"
case .portraitUpsideDown:
orientation = "Portrait Upside Down"
case .unknown:
orientation = "Unknown Orientation"
@unknown default:
fatalError()
}
print("Orientation: (orientation)")
self.startMotionDetection()
}
override func viewWillAppear(_ animated: Bool) {
//set the UI based on values in UserDefaults
let settings = UserDefaults.standard
swAscending.setOn(settings.bool(forKey:
Constants.kSortDirectionAscending), animated: true)
let sortField = settings.string(forKey:
Constants.kSortField)
var i = 0
for field in sortOrderItems {
if field == sortField {
pckSortField.selectRow(i, inComponent: 0, animated:
false)
}
i += 1
}
pckSortField.reloadComponent(0)
}
override func viewDidDisappear(_ animated: Bool) {
UIDevice.current.isBatteryMonitoringEnabled = false
let appDelegate = UIApplication.shared.delegate as?
43. AppDelegate
appDelegate?.motionManager.stopAccelerometerUpdates()
}
@IBAction func sortDirectionChanged(_ sender: Any) {
let settings = UserDefaults.standard
settings.set(swAscending.isOn, forKey:
Constants.kSortDirectionAscending)
settings.synchronize()
}
// MARK: UIPickerViewDelegate Methods
// Returns the number of 'columns' to display.
func numberOfComponents(in pickerView: UIPickerView) ->
Int {
return 1
}
// Returns the # of rows in the picker
func pickerView(_ pickerView: UIPickerView,
numberOfRowsInComponent component: Int) -> Int {
return sortOrderItems.count
}
//Sets the value that is shown for each row in the picker
func pickerView(_ pickerView: UIPickerView, titleForRow
row: Int, forComponent component: Int)
-> String? {
return sortOrderItems[row]
}
//If the user chooses from the pickerview, it calls this
44. function;
func pickerView(_ pickerView: UIPickerView, didSelectRow
row: Int, inComponent component: Int) {
let sortField = sortOrderItems[row]
let settings = UserDefaults.standard
settings.set(sortField, forKey: Constants.kSortField)
settings.synchronize()
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to
do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender:
Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
__MACOSX/My Contact List/My Contact
List/._SettingsViewController.swift
My Contact List/My Contact List.xcodeproj/project.pbxproj
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
66. __MACOSX/My Contact List/.git/objects/._7f
My Contact List/.git/info/exclude
.DS_Store
UserInterfaceState.xcuserstate
__MACOSX/My Contact List/.git/info/._exclude
My Contact List/.git/hooks/README.sample
#!/bin/sh
#
# Place appropriately named executable hook scripts into this
directory
# to intercept various actions that git takes. See `git help
hooks` for
# more information.
__MACOSX/My Contact List/.git/hooks/._README.sample
__MACOSX/My Contact List/.git/refs/._heads
__MACOSX/My Contact List/.git/refs/._tags
My Contact List/My Contact
List/MyContactListModel.xcdatamodeld/MyContactListModel.x
cdatamodel/contents
__MACOSX/My Contact List/My Contact
List/MyContactListModel.xcdatamodeld/MyContactListModel.x
cdatamodel/._contents
My Contact List/My Contact List/Assets.xcassets/sample-881-
globe.imageset/sample-401-globe.png
77. //
import UIKit
class MapViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to
do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender:
Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
__MACOSX/My Contact
List/.git/objects/b2/._85dfbdc51b879e840fc0555565f2e481d6c8
fe
My Contact
List/.git/objects/da/4a164c918651cdd1e11dca5cc62c333f097601
My Contact
List/.git/objects/da/4a164c918651cdd1e11dca5cc62c333f097601
83. //
import UIKit
class ContactsTableViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Uncomment the following line to preserve selection
between presentations
// self.clearsSelectionOnViewWillAppear = false
// Uncomment the following line to display an Edit button
in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem =
self.editButtonItem
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView)
-> Int {
// #warning Incomplete implementation, return the number
of sections
return 0
}
override func tableView(_ tableView: UITableView,
numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number
of rows
return 0
}
/*
84. override func tableView(_ tableView: UITableView,
cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier:
"reuseIdentifier", for: indexPath)
// Configure the cell...
return cell
}
*/
/*
// Override to support conditional editing of the table view.
override func tableView(_ tableView: UITableView,
canEditRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the specified item to be
editable.
return true
}
*/
/*
// Override to support editing the table view.
override func tableView(_ tableView: UITableView, commit
editingStyle: UITableViewCell.EditingStyle, forRowAt
indexPath: IndexPath) {
if editingStyle == .delete {
// Delete the row from the data source
tableView.deleteRows(at: [indexPath], with: .fade)
} else if editingStyle == .insert {
// Create a new instance of the appropriate class, insert
it into the array, and add a new row to the table view
}
}
*/
85. /*
// Override to support rearranging the table view.
override func tableView(_ tableView: UITableView,
moveRowAt fromIndexPath: IndexPath, to: IndexPath) {
}
*/
/*
// Override to support conditional rearranging of the table
view.
override func tableView(_ tableView: UITableView,
canMoveRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the item to be re-
orderable.
return true
}
*/
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to
do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender:
Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
__MACOSX/My Contact
List/.git/objects/44/._7805c2535443ad8c4487730db74c1667ee6