Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 103 additions & 9 deletions GetRestIOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>GetRestIOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>7</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>GetRestIOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>5</integer>
<integer>8</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>BuildSystemType</key>
<string>Original</string>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
//
// ViewController.swift
// AddPortfolioViewController.swift
// GetRestIOS
//
// Created by 최리안 on 28/06/2019.
// Created by 최리안 on 06/07/2019.
// Copyright © 2019 최리안. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
class AddPortfolioViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()


// Do any additional setup after loading the view.
}





}

175 changes: 163 additions & 12 deletions GetRestIOS/Controllers/MainHomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,181 @@
//

import UIKit
import ScrollableGraphView

class MainHomeViewController: UIViewController {

@IBOutlet weak var topSideView: UIView!
var barPlotData: [Double] = [ 7, 4, 7, 6, 3, 7, 3, 4, 3, 2, 7, 4]
var xAxisLabels: [String] = ["1" ,"2","3", "4", "1" ,"2","3", "4", "1" ,"2","3", "4",]
var graphDetailList : [HomeGraphDetailModel] = [
HomeGraphDetailModel("솝트", "2019.03 ~ 2019.07"),
HomeGraphDetailModel("매디", "2018.01 ~ 2019.12"),
HomeGraphDetailModel("매디", "2018.01 ~ 2019.12"),
HomeGraphDetailModel("매디", "2018.01 ~ 2019.12"),
HomeGraphDetailModel("매디", "2018.01 ~ 2019.12")
]

@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var topSideView: UIImageView!
@IBOutlet weak var topSideLabel: UILabel!
@IBOutlet weak var graphView: UIView!
@IBOutlet weak var graphDetailTableView: UITableView!
@IBOutlet weak var firstSectionView: UIView!
@IBOutlet weak var secondSectionView: UIView!


var scrollViewContentHeight = 1200 as CGFloat
let navigationBarHeight = 64 as CGFloat
var tableCellHeight = 64 as CGFloat
var tableHeight = 1000 as CGFloat

var username: String = "박경선"

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor.mainBackgroudGray
setTableView()
setTopSideView()
setGraph(containerView: graphView)
graphDetailTableView.reloadData()
let attributedString = NSMutableAttributedString()
.bold(username, fontSize: 23)
.normal("님의 \n기록을 살펴 볼까요?", fontSize: 23)
topSideLabel.attributedText = attributedString
firstSectionView.dropShadow(color: UIColor.shadow, offSet: CGSize.zero, opacity: 1.0, radius: 5)
secondSectionView.dropShadow(color: UIColor.shadow, offSet: CGSize.zero, opacity: 1.0, radius: 5)
}

func setTableView() {
self.graphDetailTableView.delegate = self
self.graphDetailTableView.dataSource = self
// self.graphDetailTableView.estimatedRowHeight = tableCellHeight
// self.graphDetailTableView.rowHeight = UITableView.automaticDimension
self.graphDetailTableView.backgroundColor = UIColor.white
self.graphDetailTableView.separatorColor = UIColor.mainBackgroudGray
self.graphDetailTableView.alwaysBounceVertical = false
// self.graphDetailTableView.isScrollEnabled = false

}

override func viewWillAppear(_ animated: Bool) {
super.viewDidAppear(animated)
setNavigationBar()
}
func setNavigationBar(){
navigationController?.navigationBar.barTintColor = UIColor.mainGreen
// 불투명하게 만들기
navigationController?.navigationBar.isTranslucent = false
navigationController?.navigationBar.setBackgroundImage(UIImage(named: "navigationBarWithLogo"), for: .default)
navigationController?.navigationBar.shadowImage = UIImage()

topSideView.backgroundColor = UIColor.mainGreen
}

func setTopSideView(){
topSideView.backgroundColor = UIColor(patternImage: UIImage(named: "homeTopSideViewImg")!)
topSideView.roundCorners(corners: [.bottomLeft, .bottomRight], radius: 28)

// Do any additional setup after loading the view.

topSideLabel.text = "\(username)님의\n기록을 살펴볼까요?"
topSideLabel.numberOfLines = 0
}

func attributedText(withString string: String, boldString: String, font: UIFont) -> String {
let attributedString = NSMutableAttributedString(string: string, attributes: [NSAttributedString.Key.font: font])
let boldFontAttribute: [NSAttributedString.Key: Any] = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: font.pointSize)]
let range = (string as NSString).range(of: boldString)
attributedString.addAttributes(boldFontAttribute, range: range)
return attributedString.string
}
}

/*
// MARK: - Navigation
extension MainHomeViewController : ScrollableGraphViewDataSource {
func value(forPlot plot: Plot, atIndex pointIndex: Int) -> Double {
return barPlotData[pointIndex]
}

func label(atIndex pointIndex: Int) -> String {
return xAxisLabels[pointIndex]
}

func numberOfPoints() -> Int {
return xAxisLabels.count
}

func setGraph(containerView: UIView) {
drawReferenceLine(containerView)
let frame : CGRect = CGRect(x: 0,
y: 0,
width: self.graphView.frame.width,
height: self.graphView.frame.height)
let barGraphView = ScrollableGraphView(frame: frame, dataSource: self)
let barPlot = BarPlot(identifier: "bar")

barPlot.barWidth = 12
barPlot.barLineWidth = 0
barPlot.barColor = UIColor.graphBarGray

// barPlot.adaptAnimationType = ScrollableGraphViewAnimationType.elastic
// barPlot.animationDuration = 1.5
barGraphView.topMargin = 0
barGraphView.bottomMargin = 16
barGraphView.dataPointSpacing = 27

barGraphView.leftmostPointPadding = 20
let referenceLines = ReferenceLines()

// referenceLines.referenceLineLabelFont = UIFont.boldSystemFont(ofSize: 7)
referenceLines.dataPointLabelFont = UIFont.systemFont(ofSize: 14)
referenceLines.referenceLineColor = UIColor.graphLineGray
referenceLines.referenceLineLabelColor = UIColor.mainColorBlue
referenceLines.dataPointLabelColor = UIColor.mainColorBlue
// referenceLines.shouldShowReferenceLines = false
referenceLines.shouldAddLabelsToIntermediateReferenceLines = false
referenceLines.shouldAddUnitsToIntermediateReferenceLineLabels = false

barGraphView.backgroundFillColor = UIColor.graphBackgroundWhite
barGraphView.shouldAnimateOnStartup = false

barGraphView.rangeMax = barPlotData.max()!
barGraphView.rangeMin = 0

barGraphView.addReferenceLines(referenceLines: referenceLines)
barGraphView.addPlot(plot: barPlot)

containerView.addSubview(barGraphView)
}

func drawReferenceLine(_ containerView: UIView){
}
}

// 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.
extension MainHomeViewController : UITableViewDataSource, UITableViewDelegate {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return graphDetailList.count
}
*/
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "graphDetailTableViewCell") as! HomeGraphDetailTableViewCell
cell.contentView.backgroundColor = UIColor.white
cell.portfolioTitle?.text = graphDetailList[indexPath.row].portfolioTitle!
cell.portfolioDuration?.text = graphDetailList[indexPath.row].portfolioDuration!
return cell
}
}

extension NSMutableAttributedString {

func bold(_ text: String, fontSize: CGFloat) -> NSMutableAttributedString {
let attrs: [NSAttributedString.Key: Any] = [.font: UIFont.boldSystemFont(ofSize: fontSize)]
self.append(NSMutableAttributedString(string: text, attributes: attrs))
return self
}

func normal(_ text: String, fontSize: CGFloat) -> NSMutableAttributedString {
let attrs: [NSAttributedString.Key: Any] = [.font: UIFont.systemFont(ofSize: fontSize)]
self.append(NSMutableAttributedString(string: text, attributes: attrs))
return self
}
}


30 changes: 30 additions & 0 deletions GetRestIOS/Controllers/MyResume/MyResumeListViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// MyResumeListViewController.swift
// GetRestIOS
//
// Created by 박경선 on 08/07/2019.
// Copyright © 2019 최리안. All rights reserved.
//

import UIKit

class MyResumeListViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBar.tintColor = UIColor.mainColorGreen
// 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.
}
*/

}
90 changes: 90 additions & 0 deletions GetRestIOS/Controllers/MyResume/MyResumeTableViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
//
// MyResumeTableViewController.swift
// GetRestIOS
//
// Created by 박경선 on 09/07/2019.
// Copyright © 2019 최리안. All rights reserved.
//

import UIKit

class MyResumeTableViewController: UITableViewController {

override func viewDidLoad() {
super.viewDidLoad()

// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = false

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem
}

// MARK: - Table view data source

override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 0
}

override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 0
}

/*
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath)

// Configure the cell...

return cell
}
*/

/*
// Override to support conditional editing of the table view.
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the specified item to be editable.
return true
}
*/

/*
// Override to support editing the table view.
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
// Delete the row from the data source
tableView.deleteRows(at: [indexPath], with: .fade)
} else if editingStyle == .insert {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/

/*
// Override to support rearranging the table view.
override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) {

}
*/

/*
// Override to support conditional rearranging of the table view.
override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the item to be re-orderable.
return true
}
*/

/*
// 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.
}
*/

}
Loading