Initial commit

This commit is contained in:
Rodrigo Pedroso 2019-06-26 23:05:40 -04:00
commit 02f81bdfe6
16 changed files with 1046 additions and 0 deletions

View file

@ -0,0 +1,46 @@
//
// AppDelegate.swift
// repo-browser
//
// Created by Rodrigo Pedroso on 2019-06-26.
// Copyright © 2019 Rodrigo Pedroso Leite Pinto. 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:.
}
}

View file

@ -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"
}
}

View file

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

View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View file

@ -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>

View file

@ -0,0 +1,75 @@
<?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="BYZ-38-t0r">
<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="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Repo_browser" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Github repo browser" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eQv-L9-z0k">
<rect key="frame" x="128.5" y="44" width="157" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Octocat" translatesAutoresizingMaskIntoConstraints="NO" id="oNG-Cv-10h">
<rect key="frame" x="112" y="73" width="190" height="128"/>
<constraints>
<constraint firstAttribute="height" constant="128" id="9gi-vo-M7p"/>
<constraint firstAttribute="width" constant="190" id="y4H-3D-gjn"/>
</constraints>
</imageView>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Repo owner" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="aUR-ad-ow1">
<rect key="frame" x="20" y="209" width="374" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="g87-Hx-hqO"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<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="aWU-WE-xFx">
<rect key="frame" x="20" y="247" width="374" height="615"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="aUR-ad-ow1" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="4yT-pH-1sr"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="aUR-ad-ow1" secondAttribute="trailing" constant="20" id="5B0-r3-Ixy"/>
<constraint firstItem="oNG-Cv-10h" firstAttribute="top" secondItem="eQv-L9-z0k" secondAttribute="bottom" constant="8" id="6oz-5Q-p2y"/>
<constraint firstItem="aUR-ad-ow1" firstAttribute="top" secondItem="oNG-Cv-10h" secondAttribute="bottom" constant="8" id="EJ6-Zk-hrd"/>
<constraint firstItem="oNG-Cv-10h" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="dQj-eo-yYS"/>
<constraint firstItem="eQv-L9-z0k" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="rWA-3I-6aE"/>
<constraint firstItem="aUR-ad-ow1" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="20" id="uPl-hj-HvI"/>
<constraint firstItem="eQv-L9-z0k" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="wZb-ef-xP5"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="tblRepoTable" destination="aWU-WE-xFx" id="g1m-41-DrC"/>
<outlet property="txfRepoOwner" destination="aUR-ad-ow1" id="NJV-I3-cJA"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="47.826086956521742" y="20.758928571428569"/>
</scene>
</scenes>
<resources>
<image name="Octocat" width="90.666664123535156" height="61.666667938232422"/>
</resources>
</document>

View file

@ -0,0 +1,29 @@
//
// RepoCell.swift
// repo-browser
//
// Created by Rodrigo Pedroso on 2019-06-26.
// Copyright © 2019 Rodrigo Pedroso Leite Pinto. All rights reserved.
//
import UIKit
class RepoCell: UITableViewCell {
@IBOutlet var imgThumbnail: UIImageView!
@IBOutlet var lblTitle: UILabel!
@IBOutlet var lblDescription: UILabel!
@IBOutlet var lblRepoType: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}

View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<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="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="70" id="KGk-i7-Jjw" customClass="RepoCell" customModule="Repo_browser" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="69.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="cQ8-2c-3gy">
<rect key="frame" x="0.0" y="-0.5" width="70" height="70.5"/>
<constraints>
<constraint firstAttribute="width" constant="70" id="0rH-We-UsE"/>
<constraint firstAttribute="height" constant="70" id="aqD-2J-eNm"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WX8-nW-2o2">
<rect key="frame" x="78" y="4" width="203" height="21"/>
<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" text="Labelsdfhsfghdfghsfghsfghs dfgh sfh sdfh sfh sfhsfghsf gh sdfh s " textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mh9-2s-zEa">
<rect key="frame" x="78" y="33" width="203" height="37"/>
<constraints>
<constraint firstAttribute="height" constant="37" id="Uc6-wd-Nrg"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Ico" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ly3-fA-QfR">
<rect key="frame" x="289" y="8" width="23" height="53.5"/>
<constraints>
<constraint firstAttribute="width" constant="23" id="TKa-mG-8AY"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="cQ8-2c-3gy" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="148-ld-eVu"/>
<constraint firstItem="mh9-2s-zEa" firstAttribute="top" secondItem="WX8-nW-2o2" secondAttribute="bottom" constant="8" symbolic="YES" id="1to-7B-LLd"/>
<constraint firstItem="ly3-fA-QfR" firstAttribute="leading" secondItem="WX8-nW-2o2" secondAttribute="trailing" constant="8" id="2rd-tx-dez"/>
<constraint firstItem="ly3-fA-QfR" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="8" id="6VM-7l-OH9"/>
<constraint firstAttribute="trailing" secondItem="ly3-fA-QfR" secondAttribute="trailing" constant="8" id="B0N-aW-w9S"/>
<constraint firstItem="mh9-2s-zEa" firstAttribute="leading" secondItem="WX8-nW-2o2" secondAttribute="leading" id="LX0-SQ-HAa"/>
<constraint firstItem="ly3-fA-QfR" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="aAd-Au-MFh"/>
<constraint firstAttribute="bottom" secondItem="ly3-fA-QfR" secondAttribute="bottom" constant="8" id="imh-MH-B7N"/>
<constraint firstItem="ly3-fA-QfR" firstAttribute="leading" secondItem="mh9-2s-zEa" secondAttribute="trailing" constant="8" id="qPj-9W-xT6"/>
<constraint firstItem="WX8-nW-2o2" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="-51" id="s56-f9-Tvk"/>
<constraint firstItem="WX8-nW-2o2" firstAttribute="leading" secondItem="cQ8-2c-3gy" secondAttribute="trailing" constant="8" symbolic="YES" id="uH7-F4-5V8"/>
<constraint firstItem="cQ8-2c-3gy" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="uzC-xx-wG1"/>
<constraint firstItem="mh9-2s-zEa" firstAttribute="bottom" secondItem="cQ8-2c-3gy" secondAttribute="bottom" id="vC3-do-ri7"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="imgThumbnail" destination="cQ8-2c-3gy" id="LT7-Js-O1c"/>
<outlet property="lblDescription" destination="mh9-2s-zEa" id="4Mk-Cm-S0R"/>
<outlet property="lblRepoType" destination="ly3-fA-QfR" id="Dq3-DI-Lxi"/>
<outlet property="lblTitle" destination="WX8-nW-2o2" id="ZFN-c0-P5H"/>
</connections>
<point key="canvasLocation" x="137.68115942028987" y="161.38392857142856"/>
</tableViewCell>
</objects>
</document>

45
repo-browser/Info.plist Normal file
View file

@ -0,0 +1,45 @@
<?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>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>

View file

@ -0,0 +1,67 @@
//
// ViewController.swift
// repo-browser
//
// Created by Rodrigo Pedroso on 2019-06-26.
// Copyright © 2019 Rodrigo Pedroso Leite Pinto. All rights reserved.
//
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet var txfRepoOwner: UITextField!
@IBOutlet var tblRepoTable: UITableView!
let cellIdentifier = "RepoCell"
var dataSource: Array<Dictionary<String, String>> = []
var selectedIndex: Int!
override func viewDidLoad() {
super.viewDidLoad()
// Table view
tblRepoTable.delegate = self
tblRepoTable.dataSource = self
let nibName = UINib(nibName: cellIdentifier, bundle: nil)
tblRepoTable.register(nibName, forCellReuseIdentifier: cellIdentifier)
// dataSource = panneau?.panneaux as! Array<Dictionary<String, String>>
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// let vc: MCIPanneauDetail = segue.destination as! MCIPanneauDetail
}
// MARK: - Table view
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dataSource.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell: RepoCell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as! RepoCell
// cell.imgThumbnail.image = dataSource[indexPath.row][]
// cell.lblTitle.text = dataSource[indexPath.row][]
cell.lblDescription.text = dataSource[indexPath.row]["Description_RPA"]
// cell.lblRepoType.text = dataSource[indexPath.row][]
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 70
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
selectedIndex = indexPath.row
performSegue(withIdentifier: "sortedDetailSegue", sender: self)
}
}