Update
This commit is contained in:
parent
6dc399eb9e
commit
50f78df781
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
505AFEF8229FE1BD004FF0F1 /* settingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */; };
|
505AFEF8229FE1BD004FF0F1 /* settingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */; };
|
||||||
|
505AFEFC22A154EB004FF0F1 /* TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505AFEFB22A154EB004FF0F1 /* TableViewCell.swift */; };
|
||||||
50A7ADD5229D6A4200D58743 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADD4229D6A4200D58743 /* AppDelegate.swift */; };
|
50A7ADD5229D6A4200D58743 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADD4229D6A4200D58743 /* AppDelegate.swift */; };
|
||||||
50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADD6229D6A4200D58743 /* ViewController.swift */; };
|
50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADD6229D6A4200D58743 /* ViewController.swift */; };
|
||||||
50A7ADDA229D6A4200D58743 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 50A7ADD8229D6A4200D58743 /* Main.storyboard */; };
|
50A7ADDA229D6A4200D58743 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 50A7ADD8229D6A4200D58743 /* Main.storyboard */; };
|
||||||
@ -24,6 +25,7 @@
|
|||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = settingsViewController.swift; sourceTree = "<group>"; };
|
505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = settingsViewController.swift; sourceTree = "<group>"; };
|
||||||
|
505AFEFB22A154EB004FF0F1 /* TableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewCell.swift; sourceTree = "<group>"; };
|
||||||
50A7ADD1229D6A4200D58743 /* Guibe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Guibe.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
50A7ADD1229D6A4200D58743 /* Guibe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Guibe.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
50A7ADD4229D6A4200D58743 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
50A7ADD4229D6A4200D58743 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
50A7ADD6229D6A4200D58743 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
50A7ADD6229D6A4200D58743 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||||
@ -79,6 +81,7 @@
|
|||||||
50A7ADD6229D6A4200D58743 /* ViewController.swift */,
|
50A7ADD6229D6A4200D58743 /* ViewController.swift */,
|
||||||
50A7ADE6229D6C7100D58743 /* Assets.xcassets */,
|
50A7ADE6229D6C7100D58743 /* Assets.xcassets */,
|
||||||
50A7ADD8229D6A4200D58743 /* Main.storyboard */,
|
50A7ADD8229D6A4200D58743 /* Main.storyboard */,
|
||||||
|
505AFEFB22A154EB004FF0F1 /* TableViewCell.swift */,
|
||||||
50A7ADFE229D768900D58743 /* MainViewController.swift */,
|
50A7ADFE229D768900D58743 /* MainViewController.swift */,
|
||||||
505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */,
|
505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */,
|
||||||
50A7ADFC229D766800D58743 /* 7_ReadyViewController.swift */,
|
50A7ADFC229D766800D58743 /* 7_ReadyViewController.swift */,
|
||||||
@ -188,6 +191,7 @@
|
|||||||
50A7ADFD229D766800D58743 /* 7_ReadyViewController.swift in Sources */,
|
50A7ADFD229D766800D58743 /* 7_ReadyViewController.swift in Sources */,
|
||||||
50A7ADF9229D75C100D58743 /* 5_HandChoiceViewController.swift in Sources */,
|
50A7ADF9229D75C100D58743 /* 5_HandChoiceViewController.swift in Sources */,
|
||||||
50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */,
|
50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */,
|
||||||
|
505AFEFC22A154EB004FF0F1 /* TableViewCell.swift in Sources */,
|
||||||
50A7ADF5229D75A900D58743 /* 3_StartViewController.swift in Sources */,
|
50A7ADF5229D75A900D58743 /* 3_StartViewController.swift in Sources */,
|
||||||
50A7ADD5229D6A4200D58743 /* AppDelegate.swift in Sources */,
|
50A7ADD5229D6A4200D58743 /* AppDelegate.swift in Sources */,
|
||||||
50A7ADFF229D768900D58743 /* MainViewController.swift in Sources */,
|
50A7ADFF229D768900D58743 /* MainViewController.swift in Sources */,
|
||||||
|
|||||||
@ -305,7 +305,7 @@
|
|||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
<prototypes>
|
<prototypes>
|
||||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="87K-Xo-0a5">
|
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="cell" id="87K-Xo-0a5" customClass="TableViewCell" customModule="Guibe" customModuleProvider="target">
|
||||||
<rect key="frame" x="0.0" y="28" width="414" height="70"/>
|
<rect key="frame" x="0.0" y="28" width="414" height="70"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="87K-Xo-0a5" id="2HV-Qz-1Wd">
|
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="87K-Xo-0a5" id="2HV-Qz-1Wd">
|
||||||
@ -319,10 +319,25 @@
|
|||||||
<nil key="textColor"/>
|
<nil key="textColor"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
|
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9iK-CB-Rc6">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="414" height="70"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
|
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="goPressed:" destination="87K-Xo-0a5" eventType="touchUpInside" id="SRQ-zj-5qd"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
</subviews>
|
</subviews>
|
||||||
</tableViewCellContentView>
|
</tableViewCellContentView>
|
||||||
|
<connections>
|
||||||
|
<outlet property="cellLbl" destination="dkn-bo-t7u" id="7i1-bd-98c"/>
|
||||||
|
</connections>
|
||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
</prototypes>
|
</prototypes>
|
||||||
|
<connections>
|
||||||
|
<outlet property="dataSource" destination="Ovf-sw-BKp" id="FAs-3b-SXl"/>
|
||||||
|
<outlet property="delegate" destination="Ovf-sw-BKp" id="Roe-ew-ZBn"/>
|
||||||
|
</connections>
|
||||||
</tableView>
|
</tableView>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
@ -338,6 +353,7 @@
|
|||||||
<outlet property="searchBar" destination="dRT-vj-1ew" id="nAa-5O-h0R"/>
|
<outlet property="searchBar" destination="dRT-vj-1ew" id="nAa-5O-h0R"/>
|
||||||
<outlet property="searchBarBg" destination="3Xt-Rr-hs1" id="6bL-cK-ScI"/>
|
<outlet property="searchBarBg" destination="3Xt-Rr-hs1" id="6bL-cK-ScI"/>
|
||||||
<outlet property="searchView" destination="bKl-Ku-mh1" id="d0n-Pl-NrK"/>
|
<outlet property="searchView" destination="bKl-Ku-mh1" id="d0n-Pl-NrK"/>
|
||||||
|
<outlet property="tableView" destination="402-5S-nhO" id="Olu-VK-Sqm"/>
|
||||||
</connections>
|
</connections>
|
||||||
</viewController>
|
</viewController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="a4w-SB-1GS" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="a4w-SB-1GS" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||||
|
|||||||
@ -14,6 +14,9 @@ import AVFoundation
|
|||||||
|
|
||||||
class MainViewController: UIViewController, AVAudioPlayerDelegate {
|
class MainViewController: UIViewController, AVAudioPlayerDelegate {
|
||||||
|
|
||||||
|
|
||||||
|
var testData = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25"]
|
||||||
|
|
||||||
// DELETE
|
// DELETE
|
||||||
let defaults = UserDefaults.standard
|
let defaults = UserDefaults.standard
|
||||||
// DELETE
|
// DELETE
|
||||||
@ -45,6 +48,7 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate {
|
|||||||
@IBOutlet weak var micBtn: UIButton!
|
@IBOutlet weak var micBtn: UIButton!
|
||||||
// ---------------------
|
// ---------------------
|
||||||
@IBOutlet weak var mapView: MKMapView!
|
@IBOutlet weak var mapView: MKMapView!
|
||||||
|
@IBOutlet weak var tableView: UITableView!
|
||||||
|
|
||||||
// OUTLETS--------------OUTLETS
|
// OUTLETS--------------OUTLETS
|
||||||
|
|
||||||
@ -275,3 +279,24 @@ extension MainViewController: MKMapViewDelegate {
|
|||||||
return MKOverlayRenderer()
|
return MKOverlayRenderer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extension MainViewController: UITableViewDataSource, UITableViewDelegate {
|
||||||
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||||
|
return testData.count
|
||||||
|
}
|
||||||
|
|
||||||
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||||
|
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as? TableViewCell
|
||||||
|
cell?.cellLbl.text = testData[indexPath.row]
|
||||||
|
cell?.cellDelegate = self
|
||||||
|
cell?.index = indexPath
|
||||||
|
return cell!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension MainViewController: tableViewProtocol {
|
||||||
|
func onClickCell(index: Int) {
|
||||||
|
debugPrint("Pressed on cell number \(index)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
36
Guibe/TableViewCell.swift
Normal file
36
Guibe/TableViewCell.swift
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
//
|
||||||
|
// TableViewCell.swift
|
||||||
|
// Guibe
|
||||||
|
//
|
||||||
|
// Created by Max Hunt on 31/05/2019.
|
||||||
|
// Copyright © 2019 8. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
protocol tableViewProtocol {
|
||||||
|
func onClickCell(index: Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
class TableViewCell: UITableViewCell {
|
||||||
|
|
||||||
|
@IBOutlet weak var cellLbl: UILabel!
|
||||||
|
|
||||||
|
var cellDelegate: tableViewProtocol?
|
||||||
|
var index: IndexPath?
|
||||||
|
|
||||||
|
|
||||||
|
@IBAction func goPressed(_ sender: Any) {
|
||||||
|
cellDelegate?.onClickCell(index: (index?.row)!)
|
||||||
|
}
|
||||||
|
|
||||||
|
override func awakeFromNib() {
|
||||||
|
super.awakeFromNib()
|
||||||
|
// Initialization code
|
||||||
|
}
|
||||||
|
|
||||||
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||||
|
super.setSelected(selected, animated: animated)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user