Skip to content
Snippets Groups Projects
Commit cf6361ab authored by jakobsbode's avatar jakobsbode
Browse files

folder ui created

parent 356f64cb
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "Inbox.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Inbox@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Inbox@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
enzevalos_iphone/Assets.xcassets/Inbox.imageset/Inbox.png

457 B

enzevalos_iphone/Assets.xcassets/Inbox.imageset/Inbox@2x.png

696 B

enzevalos_iphone/Assets.xcassets/Inbox.imageset/Inbox@3x.png

948 B

<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Amm-QN-vA7">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="E2s-3z-74R">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
......@@ -296,7 +296,7 @@
<navigationItem key="navigationItem" id="JgT-PA-2op">
<nil key="title"/>
<button key="titleView" opaque="NO" contentMode="center" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="bcV-Tv-Mmh">
<rect key="frame" x="173" y="3" width="30" height="38"/>
<rect key="frame" x="172.5" y="3" width="30" height="38"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal">
......@@ -371,7 +371,7 @@
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="1qn-BM-6ll" kind="relationship" relationship="rootViewController" id="PQA-Pf-At2"/>
<segue destination="eRp-By-lS3" kind="relationship" relationship="rootViewController" id="NPH-pL-mw2"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ivB-W5-lhL" userLabel="First Responder" sceneMemberID="firstResponder"/>
......@@ -462,7 +462,67 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="B3N-gi-asB" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-31.199999999999999" y="-949.47526236881572"/>
<point key="canvasLocation" x="-79" y="-949"/>
</scene>
<!--Folder View Controller-->
<scene sceneID="QFr-kU-bDH">
<objects>
<tableViewController id="eRp-By-lS3" customClass="FolderViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="CQV-hi-gCk">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<inset key="separatorInset" minX="57" minY="0.0" maxX="0.0" maxY="0.0"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="folderCell" id="kY2-BI-lEn" customClass="FolderCell" customModule="enzevalos_iphone" customModuleProvider="target">
<rect key="frame" x="0.0" y="56" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="kY2-BI-lEn" id="3Sr-En-tzr">
<rect key="frame" x="0.0" y="0.0" width="342" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Ipy-3H-3ZD">
<rect key="frame" x="18" y="8" width="27.5" height="27.5"/>
<constraints>
<constraint firstAttribute="width" constant="27" id="Z7h-Xg-8fZ"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VHS-Du-dkc">
<rect key="frame" x="55.5" y="8" width="278.5" height="27.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="bottomMargin" secondItem="VHS-Du-dkc" secondAttribute="bottom" id="5Np-ei-eQ8"/>
<constraint firstItem="VHS-Du-dkc" firstAttribute="top" secondItem="3Sr-En-tzr" secondAttribute="topMargin" id="8yZ-lR-6cX"/>
<constraint firstAttribute="trailingMargin" secondItem="VHS-Du-dkc" secondAttribute="trailing" id="NE0-BC-Prn"/>
<constraint firstItem="VHS-Du-dkc" firstAttribute="leading" secondItem="Ipy-3H-3ZD" secondAttribute="trailing" constant="10" id="O8d-lz-y5t"/>
<constraint firstItem="Ipy-3H-3ZD" firstAttribute="leading" secondItem="3Sr-En-tzr" secondAttribute="leadingMargin" constant="10" id="cN4-E1-eNv"/>
<constraint firstItem="Ipy-3H-3ZD" firstAttribute="top" secondItem="3Sr-En-tzr" secondAttribute="topMargin" id="gov-62-v7E"/>
<constraint firstAttribute="bottomMargin" secondItem="Ipy-3H-3ZD" secondAttribute="bottom" id="sqW-k2-3O7"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="folderImage" destination="Ipy-3H-3ZD" id="1bk-mE-tTi"/>
<outlet property="folderName" destination="VHS-Du-dkc" id="zx9-yF-LTC"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="eRp-By-lS3" id="iWJ-c4-q6m"/>
<outlet property="delegate" destination="eRp-By-lS3" id="uzM-L0-alX"/>
</connections>
</tableView>
<navigationItem key="navigationItem" id="qTG-y6-efi"/>
<refreshControl key="refreshControl" opaque="NO" multipleTouchEnabled="YES" contentMode="center" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" id="i7r-Oq-y5T">
<autoresizingMask key="autoresizingMask"/>
</refreshControl>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cjd-cY-a5S" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="677.60000000000002" y="-953.07346326836591"/>
</scene>
<!--Inbox-->
<scene sceneID="ue1-yd-fJq">
......@@ -959,11 +1019,11 @@
<viewControllerLayoutGuide type="bottom" id="zNd-c4-1JB"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="5dv-YO-2iV">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" keyboardDismissMode="interactive" translatesAutoresizingMaskIntoConstraints="NO" id="sij-Oe-ann">
<rect key="frame" x="1" y="20" width="376" height="585"/>
<rect key="frame" x="1" y="0.0" width="376" height="541"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" placeholderIntrinsicWidth="373" placeholderIntrinsicHeight="100" showsVerticalScrollIndicator="NO" minimumZoomScale="0.0" maximumZoomScale="0.0" dataMode="prototypes" prefetchingEnabled="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KMI-R1-Q95">
<rect key="frame" x="0.0" y="44" width="373" height="100"/>
......@@ -1104,7 +1164,7 @@
</connections>
</scrollView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="default" sectionIndexMinimumDisplayRowCount="1" rowHeight="70" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="iEa-Rh-6bS">
<rect key="frame" x="-4" y="162" width="383" height="100"/>
<rect key="frame" x="-4" y="142" width="383" height="100"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="fcx-4L-TLn"/>
......@@ -1304,9 +1364,9 @@
</scene>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="btx-4o-o0r"/>
<segue reference="ecN-Wn-7S0"/>
<segue reference="D6m-L0-5AB"/>
<segue reference="rhW-cI-4c4"/>
<segue reference="bUY-Me-dje"/>
<segue reference="j4Q-k1-ud3"/>
<segue reference="GWh-iO-bPb"/>
<segue reference="kND-73-kqr"/>
</inferredMetricsTieBreakers>
</document>
//
// FolderCell.swift
// enzevalos_iphone
//
// Created by jakobsbode on 22.06.17.
// Copyright © 2017 fu-berlin. All rights reserved.
//
import UIKit
class FolderCell: UITableViewCell {
@IBOutlet weak var folderImage: UIImageView!
@IBOutlet weak var folderName: UILabel!
}
//
// FolderViewController.swift
// enzevalos_iphone
//
// Created by jakobsbode on 21.06.17.
// Copyright © 2017 fu-berlin. All rights reserved.
//
import UIKit
class FolderViewController: UITableViewController {
static var foldersStatic: [String] = ["Inbox", "Drafts", "Send", "Trash"]
var folders: [String] = []
override func viewDidLoad() {
self.refreshControl?.addTarget(self, action: #selector(FolderViewController.refresh), for: UIControlEvents.valueChanged)
self.folders = FolderViewController.foldersStatic
}
override func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return 1
}
return folders.count <= 0 ? 0 : folders.count - 1
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "folderCell") as! FolderCell
if indexPath.section == 0 {
cell.folderName.text = "Inbox"
cell.folderImage.image = #imageLiteral(resourceName: "Inbox")
}
else if indexPath.row+1 < folders.count {
cell.folderName.text = folders[indexPath.row+1]
cell.folderImage.image = getImage(for: folders[indexPath.row+1])
}
return cell
}
func refresh() {
self.refreshControl?.endRefreshing()
}
func getImage(for name: String) -> UIImage {
if false /*folders*/ {
return #imageLiteral(resourceName: "Inbox")
}
return #imageLiteral(resourceName: "Inbox")
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment