Archived
Initial commit; substitutions can be reviewed, no further functionality implemented yet
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// AvH Plan
|
||||
//
|
||||
// Created by Deniz Duezgoeren on 25.05.19.
|
||||
// Copyright © 2019 Deniz Duezgoeren. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: 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:.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "first.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "second.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -0,0 +1,211 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="49e-Tb-3d3">
|
||||
<device id="retina6_1" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="Stack View standard spacing" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--AvH Plan-->
|
||||
<scene sceneID="hNz-n2-bh7">
|
||||
<objects>
|
||||
<viewController title="AvH Plan" id="9pv-A4-QxB" customClass="FirstViewController" customModule="AvH_Plan" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="tsR-hK-woN">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="MUg-vU-nTS">
|
||||
<rect key="frame" x="0.0" y="44" width="414" height="769"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="1" minimumInteritemSpacing="1" id="E2H-8A-xtb">
|
||||
<size key="itemSize" width="380" height="140"/>
|
||||
<size key="headerReferenceSize" width="0.0" height="0.0"/>
|
||||
<size key="footerReferenceSize" width="0.0" height="0.0"/>
|
||||
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</collectionViewFlowLayout>
|
||||
<cells>
|
||||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" layoutMarginsFollowReadableWidth="YES" reuseIdentifier="cell" id="xB6-Yw-wrb" customClass="CollectionViewCell" customModule="AvH_Plan" customModuleProvider="target">
|
||||
<rect key="frame" x="17" y="0.0" width="380" height="100"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="380" height="100"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VTw-6O-uFV">
|
||||
<rect key="frame" x="12" y="4" width="356" height="92"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacingType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="Szc-6F-3eJ">
|
||||
<rect key="frame" x="12" y="12" width="332" height="68"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacingType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="9OH-kZ-TWT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="332" height="20.5"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="s5x-MZ-cys">
|
||||
<rect key="frame" x="0.0" y="0.0" width="282" height="20.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vmZ-so-40w">
|
||||
<rect key="frame" x="290" y="0.0" width="42" height="20.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacingType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="mB7-DS-Ukk">
|
||||
<rect key="frame" x="0.0" y="28.5" width="332" height="20.5"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LtQ-go-Loc">
|
||||
<rect key="frame" x="0.0" y="0.0" width="42" height="20.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8wi-UM-ePc">
|
||||
<rect key="frame" x="50" y="0.0" width="282" height="20.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacingType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="Vr3-yI-gCi">
|
||||
<rect key="frame" x="0.0" y="57" width="332" height="11"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lsb-TY-Oms">
|
||||
<rect key="frame" x="0.0" y="0.0" width="42" height="11"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="f4b-16-4Nr">
|
||||
<rect key="frame" x="50" y="0.0" width="282" height="11"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</stackView>
|
||||
</subviews>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Szc-6F-3eJ" firstAttribute="top" secondItem="VTw-6O-uFV" secondAttribute="top" constant="12" id="NjZ-jw-oU8"/>
|
||||
<constraint firstItem="Szc-6F-3eJ" firstAttribute="leading" secondItem="VTw-6O-uFV" secondAttribute="leading" constant="12" id="Vfp-6p-RI9"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Szc-6F-3eJ" secondAttribute="trailing" constant="12" id="lSf-Mf-Y0B"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Szc-6F-3eJ" secondAttribute="bottom" constant="12" id="wph-6i-6au"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="VTw-6O-uFV" secondAttribute="bottom" constant="4" id="BsD-qD-oo7"/>
|
||||
<constraint firstAttribute="trailing" secondItem="VTw-6O-uFV" secondAttribute="trailing" constant="12" id="Z4z-B5-ywW"/>
|
||||
<constraint firstItem="VTw-6O-uFV" firstAttribute="leading" secondItem="xB6-Yw-wrb" secondAttribute="leading" constant="12" id="t7f-vA-jxE"/>
|
||||
<constraint firstItem="VTw-6O-uFV" firstAttribute="top" secondItem="xB6-Yw-wrb" secondAttribute="top" constant="4" id="xoF-QP-gym"/>
|
||||
</constraints>
|
||||
<size key="customSize" width="380" height="100"/>
|
||||
<connections>
|
||||
<outlet property="additional" destination="Lsb-TY-Oms" id="UP3-K8-qjX"/>
|
||||
<outlet property="course" destination="LtQ-go-Loc" id="m9l-aX-vsb"/>
|
||||
<outlet property="date" destination="vmZ-so-40w" id="mag-zc-3bq"/>
|
||||
<outlet property="group" destination="s5x-MZ-cys" id="4Gb-HC-UWT"/>
|
||||
<outlet property="room" destination="f4b-16-4Nr" id="rGV-eH-YXp"/>
|
||||
<outlet property="time" destination="8wi-UM-ePc" id="Cb9-9i-I74"/>
|
||||
<outlet property="tintView" destination="VTw-6O-uFV" id="NCG-3N-nMs"/>
|
||||
</connections>
|
||||
</collectionViewCell>
|
||||
</cells>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="9pv-A4-QxB" id="b8Y-vN-lRv"/>
|
||||
<outlet property="delegate" destination="9pv-A4-QxB" id="USs-0B-kr6"/>
|
||||
</connections>
|
||||
</collectionView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="MUg-vU-nTS" firstAttribute="bottom" secondItem="PQr-Ze-W5v" secondAttribute="bottom" id="KRr-Ea-pgg"/>
|
||||
<constraint firstItem="MUg-vU-nTS" firstAttribute="top" secondItem="PQr-Ze-W5v" secondAttribute="top" id="Nlm-uh-3FO"/>
|
||||
<constraint firstItem="MUg-vU-nTS" firstAttribute="trailing" secondItem="PQr-Ze-W5v" secondAttribute="trailing" id="WLI-wf-EQD"/>
|
||||
<constraint firstItem="MUg-vU-nTS" firstAttribute="leading" secondItem="PQr-Ze-W5v" secondAttribute="leading" id="XVI-cC-b2v"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="PQr-Ze-W5v"/>
|
||||
</view>
|
||||
<tabBarItem key="tabBarItem" title="First" image="first" id="acW-dT-cKf"/>
|
||||
<connections>
|
||||
<outlet property="collectionView" destination="MUg-vU-nTS" id="MW6-qD-6nu"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="W5J-7L-Pyd" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="749.27536231884062" y="-320.75892857142856"/>
|
||||
</scene>
|
||||
<!--Second-->
|
||||
<scene sceneID="wg7-f3-ORb">
|
||||
<objects>
|
||||
<viewController id="8rJ-Kc-sve" customClass="SecondViewController" customModule="AvH_Plan" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="QS5-Rx-YEW">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Loaded by SecondViewController" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NDk-cv-Gan">
|
||||
<rect key="frame" x="99.5" y="477.5" width="215" height="17"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" text="Second View" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="zEq-FU-wV5">
|
||||
<rect key="frame" x="-33" y="417" width="201.5" height="43"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="36"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="NDk-cv-Gan" firstAttribute="top" secondItem="zEq-FU-wV5" secondAttribute="bottom" constant="8" symbolic="YES" id="Day-4N-Vmt"/>
|
||||
<constraint firstItem="NDk-cv-Gan" firstAttribute="centerX" secondItem="zEq-FU-wV5" secondAttribute="centerX" id="JgO-Fn-dHn"/>
|
||||
<constraint firstAttribute="centerX" secondItem="zEq-FU-wV5" secondAttribute="centerX" id="qqM-NS-xev"/>
|
||||
<constraint firstAttribute="centerY" secondItem="zEq-FU-wV5" secondAttribute="centerY" id="qzY-Ky-pLD"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="O1u-W8-tvY"/>
|
||||
</view>
|
||||
<tabBarItem key="tabBarItem" title="Second" image="second" id="cPa-gy-q4n"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="4Nw-L8-lE0" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="750" y="360"/>
|
||||
</scene>
|
||||
<!--AvH Plan-->
|
||||
<scene sceneID="yl2-sM-qoP">
|
||||
<objects>
|
||||
<tabBarController title="AvH Plan" id="49e-Tb-3d3" sceneMemberID="viewController">
|
||||
<tabBar key="tabBar" contentMode="scaleToFill" id="W28-zg-YXA">
|
||||
<rect key="frame" x="0.0" y="975" width="768" height="49"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</tabBar>
|
||||
<connections>
|
||||
<segue destination="9pv-A4-QxB" kind="relationship" relationship="viewControllers" id="u7Y-xg-7CH"/>
|
||||
<segue destination="8rJ-Kc-sve" kind="relationship" relationship="viewControllers" id="lzU-1b-eKA"/>
|
||||
</connections>
|
||||
</tabBarController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="HuB-VB-40B" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="0.0" y="0.0"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="first" width="30" height="30"/>
|
||||
<image name="second" width="30" height="30"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// CollectionViewCell.swift
|
||||
// AvH Plan
|
||||
//
|
||||
// Created by Deniz Duezgoeren on 25.05.19.
|
||||
// Copyright © 2019 Deniz Duezgoeren. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class CollectionViewCell: UICollectionViewCell {
|
||||
@IBOutlet weak var group: UILabel!
|
||||
@IBOutlet weak var course: UILabel!
|
||||
@IBOutlet weak var additional: UILabel!
|
||||
@IBOutlet weak var date: UILabel!
|
||||
@IBOutlet weak var time: UILabel!
|
||||
@IBOutlet weak var room: UILabel!
|
||||
@IBOutlet weak var tintView: UIView!
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
//
|
||||
// FirstViewController.swift
|
||||
// AvH Plan
|
||||
//
|
||||
// Created by Deniz Duezgoeren on 25.05.19.
|
||||
// Copyright © 2019 Deniz Duezgoeren. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SwiftSoup
|
||||
import Alamofire
|
||||
import SQLite3
|
||||
|
||||
class FirstViewController : UIViewController, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
|
||||
|
||||
let reuseIdentifier = "cell"
|
||||
@IBOutlet weak var collectionView: UICollectionView!
|
||||
let queue = DispatchQueue(label: "work-queue")
|
||||
var group: Array<String> = Array()
|
||||
var course: Array<String> = Array()
|
||||
var additional: Array<String> = Array()
|
||||
var date: Array<String> = Array()
|
||||
var time: Array<String> = Array()
|
||||
var room: Array<String> = Array()
|
||||
private let refreshControl = UIRefreshControl()
|
||||
var db: OpaquePointer?
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
if #available(iOS 10.0, *) {
|
||||
collectionView.refreshControl = refreshControl
|
||||
} else {
|
||||
collectionView.addSubview(refreshControl)
|
||||
}
|
||||
refreshControl.addTarget(self, action: #selector(objDoAsync(_:)), for: .valueChanged)
|
||||
refreshControl.tintColor = UIColor(red: 0.39, green: 0.71, blue: 0.96, alpha: 1.0)
|
||||
refreshControl.attributedTitle = NSAttributedString(string: "Fetching the plan...")
|
||||
self.refreshControl.beginRefreshing()
|
||||
self.doAsync()
|
||||
}
|
||||
|
||||
@objc private func objDoAsync(_ sender: Any) {
|
||||
self.doAsync()
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
collectionView.backgroundColor = UIColor(red: 0.8, green: 0.8, blue: 0.8, alpha: 1.0)
|
||||
|
||||
// let layout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout
|
||||
// layout.itemSize = CGSize(width: view.frame.size.width, height: 129)
|
||||
|
||||
// let fileURL = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
|
||||
// .appendingPathComponent("SubstDB.sqlite")
|
||||
//
|
||||
// if (sqlite3_open(fileURL.path, &db) != SQLITE_OK) {
|
||||
// print("Error opening database connection")
|
||||
// }
|
||||
// sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS subst_table (id INTEGER PRIMARY KEY AUTOINCREMENT, group TEXT, course TEXT, add TEXT, date TEXT, time TEXT, room TEXT)", nil, nil, nil)
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return self.group.count
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath as IndexPath) as! CollectionViewCell
|
||||
if self.group.count != 0 {
|
||||
cell.group.text = self.group[indexPath.item]
|
||||
cell.course.text = self.course[indexPath.item]
|
||||
cell.additional.text = self.additional[indexPath.item]
|
||||
cell.date.text = self.date[indexPath.item]
|
||||
cell.time.text = self.time[indexPath.item]
|
||||
cell.room.text = self.room[indexPath.item]
|
||||
}
|
||||
// cell.backgroundColor = UIColor(red: 0.39, green: 0.71, blue: 0.96, alpha: 1.0)
|
||||
cell.backgroundColor = UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
|
||||
cell.tintView.backgroundColor = cell.backgroundColor
|
||||
return cell
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
print("You selected cell#\(indexPath.item)!")
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
||||
return CGSize(width: view.frame.size.width, height: 108)
|
||||
}
|
||||
|
||||
func doAsync() {
|
||||
queue.async {
|
||||
let url = "https://djd4rkn355.github.io/subst_test.html"
|
||||
Alamofire.request(url).responseString { response in
|
||||
if let html = response.result.value {
|
||||
self.parseHTML(html: html)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func insertInDb() {
|
||||
|
||||
// let insertString = "INSERT INTO subst_table VALUES (?, ?, ?, ?, ?, ?)"
|
||||
//
|
||||
// if (sqlite3_prepare_v2(db, insertString, nil, nil, nil) != SQLITE_OK) {
|
||||
// print("error db")
|
||||
// }
|
||||
// if (
|
||||
}
|
||||
|
||||
func parseHTML(html: String) {
|
||||
do {
|
||||
let doc: Document = try SwiftSoup.parse(html)
|
||||
let rows: Elements = try doc.select("tr")
|
||||
|
||||
self.group.removeAll()
|
||||
self.date.removeAll()
|
||||
self.time.removeAll()
|
||||
self.course.removeAll()
|
||||
self.room.removeAll()
|
||||
self.additional.removeAll()
|
||||
|
||||
var group: String
|
||||
var date: String
|
||||
var time: String
|
||||
var course: String
|
||||
var room: String
|
||||
var add: String
|
||||
|
||||
// sqlite3_exec(db, "DELETE FROM subst_table", nil, nil, nil)
|
||||
|
||||
for i in (0..<rows.size()) {
|
||||
let row = rows.get(i)
|
||||
let cols = try row.select("th")
|
||||
|
||||
group = try cols.get(0).text()
|
||||
date = try cols.get(1).text()
|
||||
time = try cols.get(2).text()
|
||||
course = try cols.get(3).text()
|
||||
room = try cols.get(4).text()
|
||||
add = try cols.get(5).text()
|
||||
|
||||
self.group.append(group)
|
||||
self.date.append(date)
|
||||
self.time.append(time)
|
||||
self.course.append(course)
|
||||
self.room.append(room)
|
||||
self.additional.append(add)
|
||||
|
||||
// insert()
|
||||
}
|
||||
|
||||
self.collectionView.reloadData() // reloadData() only produces 13 cells, no more, no less
|
||||
// nevermind, but it depends on the "items" array, for some reason??
|
||||
// self.updateView()
|
||||
self.refreshControl.endRefreshing()
|
||||
// self.activityIndicatorView.stopAnimating()
|
||||
} catch Exception.Error(let type, let message) {
|
||||
print(type)
|
||||
print(message)
|
||||
} catch {
|
||||
print("error")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UIStatusBarTintParameters</key>
|
||||
<dict>
|
||||
<key>UINavigationBar</key>
|
||||
<dict>
|
||||
<key>Style</key>
|
||||
<string>UIBarStyleDefault</string>
|
||||
<key>Translucent</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// SecondViewController.swift
|
||||
// AvH Plan
|
||||
//
|
||||
// Created by Deniz Duezgoeren on 25.05.19.
|
||||
// Copyright © 2019 Deniz Duezgoeren. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SecondViewController: UIViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// SubstModel.swift
|
||||
// AvH Plan
|
||||
//
|
||||
// Created by Deniz Duezgoeren on 09.07.19.
|
||||
// Copyright © 2019 Deniz Duezgoeren. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class SubstModel {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user