Skip to content

Commit 0f865c6

Browse files
committed
Import project
1 parent 3d8758a commit 0f865c6

File tree

10 files changed

+751
-0
lines changed

10 files changed

+751
-0
lines changed

coding-events iOS.xcodeproj/project.pbxproj

+430
Large diffs are not rendered by default.

coding-events iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coding-events iOS/AppDelegate.swift

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// AppDelegate.swift
3+
// coding-events iOS
4+
//
5+
// Created by Goran Blažič on 24/09/14.
6+
// Copyright (c) 2014 goranche.net. All rights reserved.
7+
//
8+
9+
import UIKit
10+
import CoreLocation
11+
12+
@UIApplicationMain
13+
class AppDelegate: UIResponder, UIApplicationDelegate {
14+
15+
var window: UIWindow?
16+
17+
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18+
return true
19+
}
20+
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
5+
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
6+
</dependencies>
7+
<objects>
8+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
9+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
10+
<view contentMode="scaleToFill" id="iN0-l3-epB">
11+
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
12+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
13+
<subviews>
14+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2014 goranche.net. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
15+
<rect key="frame" x="20" y="439" width="441" height="21"/>
16+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
17+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
18+
<nil key="highlightedColor"/>
19+
</label>
20+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="coding-events iOS" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
21+
<rect key="frame" x="20" y="140" width="441" height="43"/>
22+
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
23+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
24+
<nil key="highlightedColor"/>
25+
</label>
26+
</subviews>
27+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
28+
<constraints>
29+
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
30+
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
31+
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
32+
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
33+
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
34+
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
35+
</constraints>
36+
<nil key="simulatedStatusBarMetrics"/>
37+
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
38+
<point key="canvasLocation" x="548" y="455"/>
39+
</view>
40+
</objects>
41+
</document>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
5+
</dependencies>
6+
<scenes>
7+
<!--View Controller-->
8+
<scene sceneID="ufC-wZ-h7g">
9+
<objects>
10+
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="coding_events_iOS" customModuleProvider="target" sceneMemberID="viewController">
11+
<layoutGuides>
12+
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
13+
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
14+
</layoutGuides>
15+
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
16+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
17+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
18+
<subviews>
19+
<mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" showsUserLocation="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Jlu-MY-ahq">
20+
<rect key="frame" x="0.0" y="20" width="600" height="580"/>
21+
<connections>
22+
<outlet property="delegate" destination="vXZ-lx-hvc" id="MzP-aY-HJW"/>
23+
</connections>
24+
</mapView>
25+
</subviews>
26+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
27+
<constraints>
28+
<constraint firstItem="Jlu-MY-ahq" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" id="2VG-4h-99k"/>
29+
<constraint firstAttribute="width" secondItem="Jlu-MY-ahq" secondAttribute="width" id="JEZ-hV-fUJ"/>
30+
<constraint firstAttribute="centerX" secondItem="Jlu-MY-ahq" secondAttribute="centerX" id="KUv-xj-I5E"/>
31+
<constraint firstItem="2fi-mo-0CV" firstAttribute="top" secondItem="Jlu-MY-ahq" secondAttribute="bottom" id="Z9P-YP-5oc"/>
32+
</constraints>
33+
</view>
34+
<connections>
35+
<outlet property="mapView" destination="Jlu-MY-ahq" id="Rth-lN-H6X"/>
36+
</connections>
37+
</viewController>
38+
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
39+
</objects>
40+
</scene>
41+
</scenes>
42+
</document>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "29x29",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "29x29",
11+
"scale" : "3x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "40x40",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "40x40",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"size" : "60x60",
26+
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "60x60",
31+
"scale" : "3x"
32+
}
33+
],
34+
"info" : {
35+
"version" : 1,
36+
"author" : "xcode"
37+
}
38+
}

coding-events iOS/Info.plist

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>net.goranche.$(PRODUCT_NAME:rfc1034identifier)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>UILaunchStoryboardName</key>
26+
<string>LaunchScreen</string>
27+
<key>UIMainStoryboardFile</key>
28+
<string>Main</string>
29+
<key>UIRequiredDeviceCapabilities</key>
30+
<array>
31+
<string>armv7</string>
32+
</array>
33+
<key>UISupportedInterfaceOrientations</key>
34+
<array>
35+
<string>UIInterfaceOrientationPortrait</string>
36+
<string>UIInterfaceOrientationLandscapeLeft</string>
37+
<string>UIInterfaceOrientationLandscapeRight</string>
38+
</array>
39+
<key>NSLocationWhenInUseUsageDescription</key>
40+
<string>InUse Description</string>
41+
<key>NSLocationAlwaysUsageDescription</key>
42+
<string>Always Description</string>
43+
<key>NSLocationUsageDescription</key>
44+
<string>Location Usage Description</string>
45+
</dict>
46+
</plist>
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
//
2+
// ViewController.swift
3+
// coding-events iOS
4+
//
5+
// Created by Goran Blažič on 24/09/14.
6+
// Copyright (c) 2014 goranche.net. All rights reserved.
7+
//
8+
9+
import UIKit
10+
import MapKit
11+
import CoreLocation
12+
13+
class ViewController: UIViewController, NSURLConnectionDelegate, MKMapViewDelegate {
14+
15+
lazy var data = NSMutableData()
16+
@IBOutlet weak var mapView: MKMapView!
17+
18+
override func viewDidLoad() {
19+
super.viewDidLoad()
20+
}
21+
22+
override func viewWillAppear(animated: Bool) {
23+
super.viewWillAppear(animated)
24+
startConnection()
25+
}
26+
27+
override func viewDidAppear(animated: Bool) {
28+
var locMgr = CLLocationManager()
29+
var auth = CLLocationManager.authorizationStatus()
30+
if (auth == CLAuthorizationStatus.NotDetermined) {
31+
locMgr.requestAlwaysAuthorization()
32+
// TODO: This no worky!!!
33+
}
34+
}
35+
36+
override func didReceiveMemoryWarning() {
37+
super.didReceiveMemoryWarning()
38+
}
39+
40+
func startConnection() {
41+
let urlPath: String = "http://events.codeweek.eu/api/event/list/?format=json"
42+
var url: NSURL = NSURL(string: urlPath)
43+
var request: NSURLRequest = NSURLRequest(URL: url)
44+
var connection: NSURLConnection = NSURLConnection(request: request, delegate: self, startImmediately: false)
45+
connection.start()
46+
}
47+
48+
func connection(connection: NSURLConnection!, didReceiveData data: NSData!){
49+
self.data.appendData(data)
50+
}
51+
52+
func connectionDidFinishLoading(connection: NSURLConnection!) {
53+
var err: NSError?
54+
55+
var events = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.AllowFragments, error: &err) as Array<NSDictionary>
56+
57+
// TODO: Show the markers from the events array
58+
// each entry is a NSDictionary, use the "geoposition" field for the markers
59+
}
60+
61+
func mapView(mapView: MKMapView!, didUpdateUserLocation userLocation: MKUserLocation!) {
62+
var region = MKCoordinateRegionMakeWithDistance(userLocation.coordinate, 800, 800)
63+
self.mapView.setRegion(region, animated: true)
64+
}
65+
66+
}

coding-events iOSTests/Info.plist

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>net.goranche.$(PRODUCT_NAME:rfc1034identifier)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>BNDL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
</dict>
24+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// coding_events_iOSTests.swift
3+
// coding-events iOSTests
4+
//
5+
// Created by Goran Blažič on 24/09/14.
6+
// Copyright (c) 2014 goranche.net. All rights reserved.
7+
//
8+
9+
import UIKit
10+
import XCTest
11+
12+
class coding_events_iOSTests: XCTestCase {
13+
14+
override func setUp() {
15+
super.setUp()
16+
// Put setup code here. This method is called before the invocation of each test method in the class.
17+
}
18+
19+
override func tearDown() {
20+
// Put teardown code here. This method is called after the invocation of each test method in the class.
21+
super.tearDown()
22+
}
23+
24+
func testExample() {
25+
// This is an example of a functional test case.
26+
XCTAssert(true, "Pass")
27+
}
28+
29+
func testPerformanceExample() {
30+
// This is an example of a performance test case.
31+
self.measureBlock() {
32+
// Put the code you want to measure the time of here.
33+
}
34+
}
35+
36+
}

0 commit comments

Comments
 (0)