From 7b40e2617ead9d5723269c0ba3faab27bf60d994 Mon Sep 17 00:00:00 2001 From: 左丞 Date: Wed, 24 May 2017 17:09:31 +0800 Subject: [PATCH] no message --- YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj | 8 ++++---- YouerLiveVideo/YouerLiveVideo/controllers/LeadViewController.swift | 2 +- YouerLiveVideo/YouerLiveVideo/controllers/TVStation/ExcellentTVViewController.swift | 337 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controllers/TVStation/MoreTVStationViewController.swift | 1 - YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard | 318 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStationInforViewController.swift | 17 ++++++++++++----- YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStationViewController.swift | 20 ++++++++++++++++---- YouerLiveVideo/YouerLiveVideo/controllers/User/AppSettingViewController.swift | 4 ++++ YouerLiveVideo/YouerLiveVideo/controllers/User/User.storyboard | 3 +++ YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/Login.storyboard | 772 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/LoginViewController.swift | 2 +- YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard | 772 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controllers/User/UserEditViewController.swift | 3 +-- YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift | 1 + 14 files changed, 1127 insertions(+), 1133 deletions(-) create mode 100644 YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/Login.storyboard delete mode 100644 YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard diff --git a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj index f0f772d..972c090 100644 --- a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj +++ b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj @@ -180,7 +180,7 @@ BFBB83E31ECC445D008B404B /* User.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFBB83D91ECC445D008B404B /* User.storyboard */; }; BFBB83E61ECC445D008B404B /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83DD1ECC445D008B404B /* LoginViewController.swift */; }; BFBB83E91ECC445D008B404B /* RegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83E01ECC445D008B404B /* RegisterViewController.swift */; }; - BFBB83EA1ECC445D008B404B /* User.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFBB83E11ECC445D008B404B /* User.storyboard */; }; + BFBB83EA1ECC445D008B404B /* Login.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFBB83E11ECC445D008B404B /* Login.storyboard */; }; BFBB83EB1ECC445D008B404B /* UserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83E21ECC445D008B404B /* UserViewController.swift */; }; BFC076781E3445F3008BAC79 /* DownLoad.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFC076771E3445F3008BAC79 /* DownLoad.swift */; }; BFDA8F331DDE88ED00F0C4E4 /* XSTLiveManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDA8F321DDE88ED00F0C4E4 /* XSTLiveManager.swift */; }; @@ -533,7 +533,7 @@ BFBB83D91ECC445D008B404B /* User.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = User.storyboard; sourceTree = ""; }; BFBB83DD1ECC445D008B404B /* LoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; BFBB83E01ECC445D008B404B /* RegisterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegisterViewController.swift; sourceTree = ""; }; - BFBB83E11ECC445D008B404B /* User.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = User.storyboard; sourceTree = ""; }; + BFBB83E11ECC445D008B404B /* Login.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Login.storyboard; sourceTree = ""; }; BFBB83E21ECC445D008B404B /* UserViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserViewController.swift; sourceTree = ""; }; BFC076771E3445F3008BAC79 /* DownLoad.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownLoad.swift; sourceTree = ""; }; BFDA8F321DDE88ED00F0C4E4 /* XSTLiveManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XSTLiveManager.swift; sourceTree = ""; }; @@ -1225,7 +1225,7 @@ children = ( BFBB83DD1ECC445D008B404B /* LoginViewController.swift */, BFBB83E01ECC445D008B404B /* RegisterViewController.swift */, - BFBB83E11ECC445D008B404B /* User.storyboard */, + BFBB83E11ECC445D008B404B /* Login.storyboard */, ); path = UserCenter; sourceTree = ""; @@ -1460,7 +1460,7 @@ BF25DFE51DDAA36A003EC0C1 /* Info-tvOS.plist in Resources */, BF6977881E2DC264006FA934 /* 我的关注.png in Resources */, 599B2CD51DE52F7E00B4F7FD /* TencentOpenApi_IOS_Bundle.bundle in Resources */, - BFBB83EA1ECC445D008B404B /* User.storyboard in Resources */, + BFBB83EA1ECC445D008B404B /* Login.storyboard in Resources */, 597185B51ECA990C00D7F478 /* Resource.storyboard in Resources */, BF25DFE61DDAA36A003EC0C1 /* Info.plist in Resources */, BFF5F4771DD5AA5C00D33B89 /* 上传头像.png in Resources */, diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/LeadViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/LeadViewController.swift index 1e7fae9..d5eb77b 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/LeadViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/LeadViewController.swift @@ -26,7 +26,7 @@ class LeadViewController: UIViewController { } func showLogin() { removeAll() - let vc=Story.instantiateViewControllerWithIdentifier("LoginViewControllerVC", storyName: "User") as! LoginViewController + let vc=Story.instantiateViewControllerWithIdentifier("LoginViewControllerVC", storyName: "Login") as! LoginViewController displayContentController(content: vc) } override func didReceiveMemoryWarning() { diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/ExcellentTVViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/ExcellentTVViewController.swift index 50053b4..194ac53 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/ExcellentTVViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/ExcellentTVViewController.swift @@ -10,18 +10,12 @@ import UIKit import AVKit class ExcellentTVViewController: UIViewController { - @IBOutlet weak var collectionHeight: NSLayoutConstraint! - @IBOutlet weak var ContentSizeHeight: NSLayoutConstraint! - @IBOutlet weak var AllTitleView: UIView! + @IBOutlet weak var collectionView: UICollectionView! + var isForbidScrollDelegate:Bool = true var startOffsetX:CGFloat = 0 - var TVStationScrollView:UIScrollView!//第一排目录 - @IBOutlet weak var lunboView: UIView! - @IBOutlet weak var TVStationClass: UIView! - @IBOutlet weak var collectionView: UICollectionView! var TVStationClasses:[TVSubjectInfor] = [] - var titleSelectBtn:Int = 0 - var classSelectBtn:Int = 0 + var allDataSet:[TVStationSubject] = [] override func viewDidLoad() { super.viewDidLoad() self.automaticallyAdjustsScrollViewInsets = false @@ -30,7 +24,6 @@ class ExcellentTVViewController: UIViewController { for item in json.contentData().arrayValue{ self.TVStationClasses.append(TVSubjectInfor(json: item)) } - self.creatTVStationClassScrollView() self.collectionView.reloadData() }, failHandler: { (error) in @@ -44,6 +37,159 @@ class ExcellentTVViewController: UIViewController { // Dispose of any resources that can be recreated. } + + + + /* + // 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.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} + + +//下方的所有电视节目所在的collcetionView +extension ExcellentTVViewController:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{ +// func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { +// startOffsetX = scrollView.contentOffset.x +// isForbidScrollDelegate = false +// } + +// func scrollViewDidScroll(_ scrollView: UIScrollView) { +// if isForbidScrollDelegate { return } +// NSLog("\(scrollView.contentOffset.x)") +// var btn:UIButton! +// var num:CGFloat! +// let btnIndex = scrollView.contentOffset.x/getScreenWidth() +// let view = TVStationClass.viewWithTag(2000+titleSelectBtn)! as! UIScrollView +// if view.contentSize.width > getScreenWidth(){ +// if scrollView.contentOffset.x > startOffsetX{ +// if scrollView.contentOffset.x - startOffsetX == getScreenWidth(){ +// num = btnIndex +// }else{ +// num = btnIndex+1 +// } +// if Int(num) >= TVStationClasses[titleSelectBtn].ch.count { +// return +// } +// btn = view.viewWithTag(1000+100*titleSelectBtn+Int(num))! as! UIButton +// let TVStationContentOffset = btn.frame.origin.x+btn.frame.width/2 +// if TVStationContentOffset < view.contentSize.width-getScreenWidth()/2 && TVStationContentOffset >= getScreenWidth()/2{ +// view.contentOffset.x = TVStationContentOffset - getScreenWidth()/2 +// } +// if TVStationContentOffset >= view.contentSize.width-getScreenWidth()/2{ +// view.contentOffset.x = view.contentSize.width-getScreenWidth() +// } +// } +// else{ +// let num = btnIndex +// if num < 0{ +// return +// } +// btn = view.viewWithTag(1000+100*titleSelectBtn+Int(num))! as! UIButton +// let TVStationContentOffset = btn.frame.origin.x+btn.frame.width/2 +// if TVStationContentOffset < view.contentSize.width-getScreenWidth()/2 && TVStationContentOffset >= getScreenWidth()/2{ +// view.contentOffset.x = TVStationContentOffset-getScreenWidth()/2 +// } +// if TVStationContentOffset < getScreenWidth()/2{ +// view.contentOffset.x = 0 +// } +// } +// }else{ +// btn = view.viewWithTag(1000+100*titleSelectBtn+Int(btnIndex))! as! UIButton +// } +// for i in 0.. UICollectionViewCell { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell1", for: indexPath) as! ExcellentTVInforViewCell + cell.superNavigation = self.navigationController + cell.model = allDataSet[indexPath.row] + return cell + } + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return allDataSet.count + } + + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + return CGSize(width: (getScreenWidth()-30)/2, height: 200) + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + return UIEdgeInsetsMake(10, 10, 10, 10) + } + + func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { + var reusableView:UICollectionReusableView! + if kind == UICollectionElementKindSectionHeader{ + let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionElementKindSectionHeader, withReuseIdentifier: "HeaderView", for: indexPath) as! ExcellentTVInforHeaderView + if headerView.TVStationClasses.count == 0{ + headerView.TVStationClasses = TVStationClasses + headerView.creatTVStationClassScrollView() + headerView.settingCarouselView() + headerView.superViewController = self + } + reusableView = headerView + } + return reusableView + } +} + +class ExcellentTVInforHeaderView:UICollectionReusableView{ + @IBOutlet weak var AllTitleView: UIView! + @IBOutlet weak var lunboView: UIView! + @IBOutlet weak var TVStationClass: UIView! + var TVStationScrollView:UIScrollView!//第一排目录 + var TVStationClasses:[TVSubjectInfor] = [] + var titleSelectBtn:Int = 0 + var classSelectBtn:Int = 0 + var superViewController:ExcellentTVViewController! + + func settingCarouselView(){ + AppDelegate.instance().httpServer.getLunboList(parameters: ["type": 1 as AnyObject]) { (str, error) in + if error==nil { + if JSON.fromString(jsonString: str)!["status"].intValue == 1{ + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in + var lineAry:[String]=[] + var lineModelAry:[InLineModel]=[] + for item in JSON.fromString(jsonString: str)!["data"].arrayValue { + lineModelAry.append(InLineModel(j: item)) + lineAry.append(item["f_Img"].stringValue) + } + if lineModelAry.count>0{ + let jyScrollViews=JYScrollView(frame: CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenWidth()/12*5)) + jyScrollViews.banner(with: lineAry, imageType: JYImageType.urlType, placeHolder: "default") { (index) in + + NSLog("点击了轮播图 图片ID:\(lineModelAry[index].f_Id)") + } + jyScrollViews.timeInterval=2 + self.lunboView.addSubview(jyScrollViews) + } + }, failHandler: { (error) in + self.superViewController.view.makeToast("获取轮播图失败:\(error.localizedDescription)") + }) + }else{ + self.superViewController.view.makeToast("获取轮播图失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") + } + }else{ + self.superViewController.view.makeToast("获取轮播图失败:\(error!.description)") + } + } + } + func creatTVStationClassScrollView(){ TVStationScrollView = UIScrollView(frame: CGRect(origin: CGPointZero, size: TVStationClass.frame.size)) TVStationScrollView.showsHorizontalScrollIndicator = false @@ -52,7 +198,7 @@ class ExcellentTVViewController: UIViewController { var x:CGFloat = 0 for (index,item) in TVStationClasses.enumerated() { let TVStationClassScrollView = UIScrollView(frame: CGRect(origin: CGPointZero, size: AllTitleView.frame.size)) - + let btn = UIButton(frame: CGRect(x: 0, y: 0, width: 100, height: TVStationClass.frame.size.height)) btn.backgroundColor = UIColor.white btn.setTitleColor(UIColor.black, for: .normal) @@ -64,15 +210,14 @@ class ExcellentTVViewController: UIViewController { }else{ x = 0 TVStationClassScrollView.isHidden = false - btn.backgroundColor = UIColor.blue + btn.backgroundColor = UIColorFromRGB(0x17B3FF) btn.setTitleColor(UIColor.white, for: .normal) - } btn.frame.origin.x = x btn.frame.size = CGSize(width: btn.frame.size.width+20, height: TVStationClass.frame.size.height) btn.tag = 200+index TVStationScrollView.contentSize = CGSize(width: btn.frame.maxX, height: 0) - btn.addTarget(self, action: #selector(ExcellentTVViewController.TVStationBtnClick(btn:)), for: .touchUpInside) + btn.addTarget(self, action: #selector(ExcellentTVInforHeaderView.TVStationBtnClick(btn:)), for: .touchUpInside) TVStationScrollView.addSubview(btn) TVStationClassScrollView.showsHorizontalScrollIndicator = false @@ -89,14 +234,15 @@ class ExcellentTVViewController: UIViewController { x = TVStationClassScrollView.viewWithTag(1000+index*100+ind-1)!.frame.maxX }else{ x = 0 - button.backgroundColor = UIColor.blue + + button.backgroundColor = UIColorFromRGB(0x17B3FF) button.setTitleColor(UIColor.white, for: .normal) } button.frame.origin.x = x button.frame.size = CGSize(width: button.frame.size.width+20, height: TVStationClass.frame.size.height) button.tag = 1000+index*100+ind TVStationClassScrollView.contentSize = CGSize(width: button.frame.maxX, height: 0) - button.addTarget(self, action: #selector(ExcellentTVViewController.TVStationClassBtnClick(btn:)), for: .touchUpInside) + button.addTarget(self, action: #selector(ExcellentTVInforHeaderView.TVStationClassBtnClick(btn:)), for: .touchUpInside) TVStationClassScrollView.addSubview(button) } TVStationClass.addSubview(TVStationClassScrollView) @@ -107,173 +253,60 @@ class ExcellentTVViewController: UIViewController { func TVStationBtnClick(btn:UIButton){ titleSelectBtn = btn.tag%10 classSelectBtn = 0 + getData() for i in 0.. getScreenWidth(){ - if scrollView.contentOffset.x > startOffsetX{ - if scrollView.contentOffset.x - startOffsetX == getScreenWidth(){ - num = btnIndex - }else{ - num = btnIndex+1 - } - if Int(num) >= TVStationClasses[titleSelectBtn].ch.count { - return - } - btn = view.viewWithTag(1000+100*titleSelectBtn+Int(num))! as! UIButton - let TVStationContentOffset = btn.frame.origin.x+btn.frame.width/2 - if TVStationContentOffset < view.contentSize.width-getScreenWidth()/2 && TVStationContentOffset >= getScreenWidth()/2{ - view.contentOffset.x = TVStationContentOffset - getScreenWidth()/2 - } - if TVStationContentOffset >= view.contentSize.width-getScreenWidth()/2{ - view.contentOffset.x = view.contentSize.width-getScreenWidth() - } - } - else{ - let num = btnIndex - if num < 0{ - return - } - btn = view.viewWithTag(1000+100*titleSelectBtn+Int(num))! as! UIButton - let TVStationContentOffset = btn.frame.origin.x+btn.frame.width/2 - if TVStationContentOffset < view.contentSize.width-getScreenWidth()/2 && TVStationContentOffset >= getScreenWidth()/2{ - view.contentOffset.x = TVStationContentOffset-getScreenWidth()/2 - } - if TVStationContentOffset < getScreenWidth()/2{ - view.contentOffset.x = 0 - } - } - }else{ - btn = view.viewWithTag(1000+100*titleSelectBtn+Int(btnIndex))! as! UIButton - } - for i in 0.. UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! ExcellentTVViewCell - cell.superNacigation = self.navigationController + func getData(){ + if TVStationClasses.count == 0{ + return + } + superViewController.allDataSet.removeAll() AppDelegate.instance().httpServer.postExcellentProgram(parameters: ["f_TelevisionId":TVStationClasses[titleSelectBtn].ch[classSelectBtn].id as AnyObject,"pageIndex":1 as AnyObject]) { (str, error) in httpJsonResule(jsonString: str, error: error, successHandler: { (json) in for item in json.contentData()["resultData"].arrayValue{ - cell.datatSet.append(TVStationSubject(json: item)) + self.superViewController.allDataSet.append(TVStationSubject(json: item)) } - cell.inforCollectionView.reloadData() - let height = CGFloat(ceil(CGFloat(cell.datatSet.count)/2))*cell.cellHeight - self.collectionHeight.constant = height == 0 ? cell.cellHeight : height + self.superViewController.collectionView.reloadData() }, failHandler: { (error) in }) } - return cell - } - - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - if TVStationClasses.count > 0{ - return TVStationClasses[titleSelectBtn].ch.count - } - return 0 - } - - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: getScreenWidth(), height: collectionView.frame.size.height) } } -//单项选项中的CollectionView -class ExcellentTVViewCell: UICollectionViewCell,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{ - var f_TelevisionId:String! - @IBOutlet weak var inforCollectionView: UICollectionView! - var datatSet:[TVStationSubject] = [] - var superNacigation:UINavigationController! - var cellHeight:CGFloat = 200 - - override func awakeFromNib() { - super.awakeFromNib() - } - - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - - } - - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell1", for: indexPath) as! ExcellentTVInforViewCell - let item = datatSet[indexPath.row] - cell.model = item - cell.superNavigation = superNacigation - return cell - } - - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return datatSet.count - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: (getScreenWidth()-30)/2, height: cellHeight) - } - - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { - return UIEdgeInsetsMake(10, 10, 10, 10) - } - -} class ExcellentTVInforViewCell: UICollectionViewCell{ diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/MoreTVStationViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/MoreTVStationViewController.swift index 4df689d..53351cb 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/MoreTVStationViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/MoreTVStationViewController.swift @@ -118,7 +118,6 @@ extension MoreTVStationViewController:UICollectionViewDelegate,UICollectionViewD vc.excellentTVStationProgram = excellentTVStationProgram[indexPath.row] self.navigationController?.pushViewController(vc, animated: true) } - } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! MoreTVStationViewCollectionCell diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard b/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard index ce58602..546bbdc 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard +++ b/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard @@ -97,204 +97,140 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - + @@ -544,7 +480,7 @@ - diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/Login.storyboard b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/Login.storyboard new file mode 100644 index 0000000..86e2b6b --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/Login.storyboard @@ -0,0 +1,772 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/LoginViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/LoginViewController.swift index c05cfe2..78bdb63 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/LoginViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/LoginViewController.swift @@ -126,7 +126,7 @@ class LoginViewController: UIViewController,UITextFieldDelegate { } //点击注册按钮 @IBAction func registerBtnClickAction(_ sender: AnyObject) { - let vc = UIStoryboard(name: "User", bundle: nil).instantiateViewController(withIdentifier: "RegisterViewControllerNV") + let vc = UIStoryboard(name: "Login", bundle: nil).instantiateViewController(withIdentifier: "RegisterViewControllerNV") self.present(vc, animated: true, completion: nil) } //键盘监听 diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard deleted file mode 100644 index 86e2b6b..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard +++ /dev/null @@ -1,772 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserEditViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserEditViewController.swift index e79d406..86b00ab 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserEditViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserEditViewController.swift @@ -179,9 +179,8 @@ extension UserEditViewController:UITableViewDelegate,UITableViewDataSource{ let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! UserEditCell cell.titleName.text = titleArr[indexPath.row-1] cell.name.text = contentArr[indexPath.row-1] - if indexPath.row == 0{ + if indexPath.row == 1{ cell.changeBtn.isHidden = false - cell.changeBtn.tag = indexPath.row+100 } return cell } diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift index 97cdf2f..ff8db24 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift @@ -25,6 +25,7 @@ class UserViewController: UIViewController { self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: #imageLiteral(resourceName: "icon_setting"), style: .plain, target: self, action: #selector(UserViewController.editBtnClick)) self.automaticallyAdjustsScrollViewInsets = false setUserInfor() + NotificationCenter.default.addObserver(self, selector: #selector(UserViewController.setUserInfor), name: NSNotification.Name(rawValue: "refreshFirstVC"), object: nil) // Do any additional setup after loading the view. } -- libgit2 0.21.0