Initial setup for World Flag Sharing challenge

This commit is contained in:
CypherPoet 2019-01-16 00:17:01 -05:00
parent 0e8dd3a21b
commit 9671f8cee2
54 changed files with 411 additions and 7 deletions

View File

@ -12,6 +12,7 @@
F3B5E36821EEDE2500D48258 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F3B5E36621EEDE2500D48258 /* Main.storyboard */; };
F3B5E36A21EEDE2700D48258 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3B5E36921EEDE2700D48258 /* Assets.xcassets */; };
F3B5E36D21EEDE2700D48258 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F3B5E36B21EEDE2700D48258 /* LaunchScreen.storyboard */; };
F3B5E37521EEEE8D00D48258 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3B5E37421EEEE8D00D48258 /* DetailViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -22,6 +23,7 @@
F3B5E36921EEDE2700D48258 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
F3B5E36C21EEDE2700D48258 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
F3B5E36E21EEDE2700D48258 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F3B5E37421EEEE8D00D48258 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -60,6 +62,7 @@
F3B5E36921EEDE2700D48258 /* Assets.xcassets */,
F3B5E36B21EEDE2700D48258 /* LaunchScreen.storyboard */,
F3B5E36E21EEDE2700D48258 /* Info.plist */,
F3B5E37421EEEE8D00D48258 /* DetailViewController.swift */,
);
path = "World Flag Sharing";
sourceTree = "<group>";
@ -135,6 +138,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F3B5E37521EEEE8D00D48258 /* DetailViewController.swift in Sources */,
F3B5E36521EEDE2500D48258 /* ViewController.swift in Sources */,
F3B5E36321EEDE2500D48258 /* AppDelegate.swift in Sources */,
);

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "estonia.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "estonia@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "estonia@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "france.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "france@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "france@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "germany.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "germany@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "germany@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ireland.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ireland@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ireland@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "italy.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "italy@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "italy@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "monaco.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "monaco@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "monaco@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "nigeria.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "nigeria@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "nigeria@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "poland.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "poland@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "poland@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "russia.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "russia@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "russia@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "spain.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "spain@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "spain@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "uk.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "uk@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "uk@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "us.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "us@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "us@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -9,16 +13,82 @@
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="Flag List" id="BYZ-38-t0r" customClass="ViewController" customModule="World_Flag_Sharing" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="HLw-Cz-DfH">
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleAspectFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="flag" rowHeight="82" id="03H-vL-vFv">
<rect key="frame" x="0.0" y="28" width="375" height="82"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="03H-vL-vFv" id="Yge-6h-zfG">
<rect key="frame" x="0.0" y="0.0" width="342" height="81.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="us" translatesAutoresizingMaskIntoConstraints="NO" id="9lt-Ef-kKG">
<rect key="frame" x="0.0" y="-43" width="139" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Us8-y5-6D7">
<rect key="frame" x="193" y="12" width="42" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="4pV-ld-wCU"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="165.59999999999999" y="115.59220389805098"/>
</scene>
<!--Detail View Controller-->
<scene sceneID="ZKj-UL-e14">
<objects>
<viewController storyboardIdentifier="Flag Detail" id="zOg-ob-lgx" customClass="DetailViewController" customModule="World_Flag_Sharing" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Yji-QI-dgW">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="A3t-x5-ago"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="sDZ-4X-lHe" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1058" y="134"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="KCj-Eu-Ph0">
<objects>
<navigationController id="kUz-sT-cji" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="vdf-ir-F3Y">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="krB-5H-U5W"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="rGB-Rh-WK9" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="166" y="-716"/>
</scene>
</scenes>
<resources>
<image name="us" width="200" height="100"/>
</resources>
</document>

View File

@ -0,0 +1,30 @@
//
// DetailViewController.swift
// World Flag Sharing
//
// Created by Brian Sipple on 1/15/19.
// Copyright © 2019 Brian Sipple. All rights reserved.
//
import UIKit
class DetailViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}

View File

@ -8,13 +8,31 @@
import UIKit
class ViewController: UIViewController {
class ViewController: UITableViewController {
var flagImagePaths: [String]!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let fileManager = FileManager.default
let flagImagesPath = "(Bundle.main.resourcePath!)/flags"
flagImagePaths = try! fileManager.contentsOfDirectory(atPath: flagImagesPath)
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return flagImagePaths.count
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// load the detail view controller on to the navigation controller stack
if let detailVC = storyboard?.instantiateViewController(withIdentifier: "Flag Detail") as? DetailViewController {
detailVC.selectedImagePath = flagImagePaths[indexPath.row]
navigationController?.pushViewController(detailVC, animated: true)
}
}
}