Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark Kevin King, [iOS] #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
440 changes: 440 additions & 0 deletions MyCapeTest.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>MyCapeTest.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
</dict>
</dict>
</plist>
10 changes: 10 additions & 0 deletions MyCapeTest.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
43 changes: 43 additions & 0 deletions MyCapeTest/Airport.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// Airport.swift
// MyCapeTest
//
// Created by Mark Kevin King on 9/20/17.
// Copyright © 2017 Mobext Inc. All rights reserved.
//

import Foundation
import CoreLocation
import MapKit

class Airport: NSObject, MKAnnotation {
var title: String?
var code: String
var city: String
var country: String
var elevation: Int
var lat: Double
var long: Double
var timeZone: String
var coordinate: CLLocationCoordinate2D

var location: CLLocation {
return CLLocation(latitude: self.lat, longitude: self.long)
}

init(name: String, code: String, city: String, country: String, elevation: Int, lat: Double, long: Double, timeZone: String) {
self.title = name
self.code = code
self.city = city
self.country = country
self.elevation = elevation
self.lat = lat
self.long = long
self.coordinate = CLLocationCoordinate2D(latitude: lat, longitude: long)
self.timeZone = timeZone
}

func distance(to location: CLLocation) -> CLLocationDistance {
return location.distance(from: self.location)
}
}
14 changes: 14 additions & 0 deletions MyCapeTest/AirportPinAnnotationView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// AirportPinAnnotationView.swift
// MyCapeTest
//
// Created by Mark Kevin King on 9/21/17.
// Copyright © 2017 Mobext Inc. All rights reserved.
//

import Foundation
import MapKit

class AirportPinAnnotationView: MKPinAnnotationView {
var code: String?
}
48 changes: 48 additions & 0 deletions MyCapeTest/AirportTableViewCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// AirportTableViewCell.swift
// MyCapeTest
//
// Created by Mark Kevin King on 9/20/17.
// Copyright © 2017 Mobext Inc. All rights reserved.
//

import UIKit

class AirportTableViewCell: UITableViewCell {
var airport: Airport?

@IBOutlet weak var codeLabel: UILabel!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var cityLabel: UILabel!
@IBOutlet weak var countryLabel: UILabel!

override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}

override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)

// Configure the view for the selected state
}

func configureCell() {
if let airport = airport {
codeLabel.text = airport.code
nameLabel.text = airport.title
cityLabel.text = airport.city
countryLabel.text = airport.country
if let code = DefaultManager.shared.fetchCode() {
if code == airport.code {
self.contentView.backgroundColor = UIColor.purple
} else {
self.contentView.backgroundColor = UIColor.white
}
}else {
self.contentView.backgroundColor = UIColor.white
}
}
}

}
46 changes: 46 additions & 0 deletions MyCapeTest/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// AppDelegate.swift
// MyCapeTest
//
// Created by Mark Kevin King on 9/20/17.
// Copyright © 2017 Mobext Inc. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

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.
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}

98 changes: 98 additions & 0 deletions MyCapeTest/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
6 changes: 6 additions & 0 deletions MyCapeTest/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
12 changes: 12 additions & 0 deletions MyCapeTest/Assets.xcassets/Loader.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "loader.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
Loading