Commit 59a2bac072ff62c2ae66e51b6923869b7a87db42
1 parent
10668bdc
Exists in
parentassistant
应用页面初步搭建
Showing
4 changed files
with
86 additions
and
3 deletions
Show diff stats
ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj
| ... | ... | @@ -52,6 +52,7 @@ |
| 52 | 52 | ADC9AB80207C672800348EF1 /* SceneTopCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADC9AB7F207C672800348EF1 /* SceneTopCell.xib */; }; |
| 53 | 53 | ADC9AB82207C673300348EF1 /* SceneMiddleCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADC9AB81207C673300348EF1 /* SceneMiddleCell.xib */; }; |
| 54 | 54 | ADC9AB84207C673C00348EF1 /* SceneDownCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADC9AB83207C673C00348EF1 /* SceneDownCell.xib */; }; |
| 55 | + ADC9AB88207C940700348EF1 /* ProgramViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADC9AB87207C940700348EF1 /* ProgramViewController.swift */; }; | |
| 55 | 56 | ADE33B312062202300BEA6E6 /* Macro.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADE33B302062202300BEA6E6 /* Macro.swift */; }; |
| 56 | 57 | ADF159612069E00000A9485D /* CalendarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADF159602069E00000A9485D /* CalendarView.swift */; }; |
| 57 | 58 | BF388469205A4DE900A240EF /* StudentClassInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF388468205A4DE900A240EF /* StudentClassInfo.swift */; }; |
| ... | ... | @@ -206,6 +207,7 @@ |
| 206 | 207 | ADC9AB7F207C672800348EF1 /* SceneTopCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SceneTopCell.xib; sourceTree = "<group>"; }; |
| 207 | 208 | ADC9AB81207C673300348EF1 /* SceneMiddleCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SceneMiddleCell.xib; sourceTree = "<group>"; }; |
| 208 | 209 | ADC9AB83207C673C00348EF1 /* SceneDownCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SceneDownCell.xib; sourceTree = "<group>"; }; |
| 210 | + ADC9AB87207C940700348EF1 /* ProgramViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgramViewController.swift; sourceTree = "<group>"; }; | |
| 209 | 211 | ADE33B302062202300BEA6E6 /* Macro.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Macro.swift; sourceTree = "<group>"; }; |
| 210 | 212 | ADF159602069E00000A9485D /* CalendarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarView.swift; sourceTree = "<group>"; }; |
| 211 | 213 | BF388468205A4DE900A240EF /* StudentClassInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentClassInfo.swift; sourceTree = "<group>"; }; |
| ... | ... | @@ -510,6 +512,7 @@ |
| 510 | 512 | ADC9AB86207C8EB400348EF1 /* Program */ = { |
| 511 | 513 | isa = PBXGroup; |
| 512 | 514 | children = ( |
| 515 | + ADC9AB87207C940700348EF1 /* ProgramViewController.swift */, | |
| 513 | 516 | ); |
| 514 | 517 | path = Program; |
| 515 | 518 | sourceTree = "<group>"; |
| ... | ... | @@ -988,6 +991,7 @@ |
| 988 | 991 | buildActionMask = 2147483647; |
| 989 | 992 | files = ( |
| 990 | 993 | BF621CB02056664C0040D2C1 /* CurrentInfoViewController.swift in Sources */, |
| 994 | + ADC9AB88207C940700348EF1 /* ProgramViewController.swift in Sources */, | |
| 991 | 995 | BF7A4C3C204CD55300460463 /* ParentAssistant.xcdatamodeld in Sources */, |
| 992 | 996 | BFEAAAD620525D620072FAAF /* LxButton.m in Sources */, |
| 993 | 997 | 5993652C20528D5700C8B371 /* MainViewController.swift in Sources */, | ... | ... |
ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift
| ... | ... | @@ -102,9 +102,15 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { |
| 102 | 102 | private func setChildViewContent(){ |
| 103 | 103 | |
| 104 | 104 | //添加子控制器 |
| 105 | - for _ in 0..<titleArr.count { | |
| 106 | - let vc = ReportViewController() | |
| 107 | - self.addChildViewController(vc) | |
| 105 | + for i in 0..<titleArr.count { | |
| 106 | + if i == 0 { | |
| 107 | + let vc = ProgramViewController() | |
| 108 | + self.addChildViewController(vc) | |
| 109 | + } | |
| 110 | + if i == 1 { | |
| 111 | + let vc = ReportViewController() | |
| 112 | + self.addChildViewController(vc) | |
| 113 | + } | |
| 108 | 114 | } |
| 109 | 115 | //设置第一个控制器数据 |
| 110 | 116 | let childVC = self.childViewControllers.first | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift
0 → 100644
| ... | ... | @@ -0,0 +1,73 @@ |
| 1 | +// | |
| 2 | +// ProgramViewController.swift | |
| 3 | +// ParentAssistant | |
| 4 | +// | |
| 5 | +// Created by Cao yang on 2018/4/10. | |
| 6 | +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +import UIKit | |
| 10 | + | |
| 11 | +class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { | |
| 12 | + | |
| 13 | + lazy var tableView = {()->UITableView in | |
| 14 | + let table = UITableView.init(frame: CGRect.init(x: 15, y: 15, width: screenWidth-30, height: screenHeight-navigationBarHeight!-(self.tabBarController?.tabBar.frame.height)!-statusBarHeight-30)) | |
| 15 | + table.backgroundColor = UIColor.white | |
| 16 | + table.delegate = self | |
| 17 | + table.dataSource = self | |
| 18 | + return table | |
| 19 | + }() | |
| 20 | + //Data | |
| 21 | + var tableData = Array<String>() | |
| 22 | + | |
| 23 | + override func viewDidLoad() { | |
| 24 | + super.viewDidLoad() | |
| 25 | + self.view.backgroundColor = backGroundColor | |
| 26 | + self.view.addSubview(self.tableView) | |
| 27 | + self.tableData = ["考勤","补卡","请假"] | |
| 28 | + | |
| 29 | + // Do any additional setup after loading the view. | |
| 30 | + } | |
| 31 | + | |
| 32 | + | |
| 33 | + //MARK: - UITableView Delegate & DataSource | |
| 34 | + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
| 35 | + return self.tableData.count | |
| 36 | + } | |
| 37 | + func numberOfSections(in tableView: UITableView) -> Int { | |
| 38 | + return 1 | |
| 39 | + } | |
| 40 | + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { | |
| 41 | + return 40 | |
| 42 | + } | |
| 43 | + func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { | |
| 44 | + let title = UILabel.init(frame: CGRect.init(x: 0, y: 0, width: tableView.bounds.size.width, height: 40)) | |
| 45 | + title.textAlignment = .center | |
| 46 | + title.text = "智能校卫" | |
| 47 | + title.backgroundColor = UIColor.white | |
| 48 | + return title | |
| 49 | + } | |
| 50 | + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
| 51 | + let cell = UITableViewCell.init() | |
| 52 | + cell.textLabel?.text = self.tableData[indexPath.row] | |
| 53 | + cell.imageView?.image = UIImage.init(named: "my_icon_about") | |
| 54 | + return cell | |
| 55 | + } | |
| 56 | + | |
| 57 | + override func didReceiveMemoryWarning() { | |
| 58 | + super.didReceiveMemoryWarning() | |
| 59 | + // Dispose of any resources that can be recreated. | |
| 60 | + } | |
| 61 | + | |
| 62 | + | |
| 63 | + /* | |
| 64 | + // MARK: - Navigation | |
| 65 | + | |
| 66 | + // In a storyboard-based application, you will often want to do a little preparation before navigation | |
| 67 | + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
| 68 | + // Get the new view controller using segue.destinationViewController. | |
| 69 | + // Pass the selected object to the new view controller. | |
| 70 | + } | |
| 71 | + */ | |
| 72 | + | |
| 73 | +} | ... | ... |