Skip to content

Commit

Permalink
Merge pull request #1 from turkeyaa/storyboard
Browse files Browse the repository at this point in the history
storyboard分支
  • Loading branch information
于先笙 authored Oct 15, 2018
2 parents 7b0b0b6 + a3160d0 commit b03f0c4
Show file tree
Hide file tree
Showing 10 changed files with 168 additions and 53 deletions.
8 changes: 4 additions & 4 deletions TemplateSwiftAPP/TemplateSwiftAPP.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
/* Begin PBXFileReference section */
6005BCA7213B6B490034417B /* redame */ = {isa = PBXFileReference; lastKnownFileType = text; path = redame; sourceTree = "<group>"; };
6005BCA9213B6B7E0034417B /* Main.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Main.xcassets; sourceTree = "<group>"; };
601FB822215CC70100148614 /* Swiftcn-Brigding-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Swiftcn-Brigding-Header.h"; sourceTree = "<group>"; };
6013730C2174274300D5E13D /* Swiftcn-Brigding-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Swiftcn-Brigding-Header.h"; sourceTree = "<group>"; };
6021698C2145011D005E6281 /* GCDUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GCDUtil.swift; sourceTree = "<group>"; };
6022B4102136C0BE005D7A30 /* MineVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MineVC.swift; sourceTree = "<group>"; };
603821982147B3E50054645D /* readme */ = {isa = PBXFileReference; lastKnownFileType = text; path = readme; sourceTree = "<group>"; };
Expand Down Expand Up @@ -534,7 +534,7 @@
children = (
C655F6692058BB6E00F65568 /* AppDelegate.swift */,
C6D9432D2062463C007974A9 /* TabBarVC.swift */,
601FB822215CC70100148614 /* Swiftcn-Brigding-Header.h */,
6013730C2174274300D5E13D /* Swiftcn-Brigding-Header.h */,
C655F6642058BB6E00F65568 /* Assets.xcassets */,
C655F6652058BB6E00F65568 /* LaunchScreen.storyboard */,
C655F6672058BB6E00F65568 /* Main.storyboard */,
Expand Down Expand Up @@ -1274,7 +1274,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = DS.TemplateSwiftAPP;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "/Users/wenhua/Desktop/service/open source/templateSwiftAPP/TemplateSwiftAPP/TemplateSwiftAPP/APP/Swiftcn-Brigding-Header.h";
SWIFT_OBJC_BRIDGING_HEADER = "/Users/wenhua/Desktop/service/open source/templateStoryboardSwiftAPP/TemplateSwiftAPP/TemplateSwiftAPP/APP/Swiftcn-Brigding-Header.h";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand All @@ -1292,7 +1292,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = DS.TemplateSwiftAPP;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "/Users/wenhua/Desktop/service/open source/templateSwiftAPP/TemplateSwiftAPP/TemplateSwiftAPP/APP/Swiftcn-Brigding-Header.h";
SWIFT_OBJC_BRIDGING_HEADER = "/Users/wenhua/Desktop/service/open source/templateStoryboardSwiftAPP/TemplateSwiftAPP/TemplateSwiftAPP/APP/Swiftcn-Brigding-Header.h";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand Down
10 changes: 6 additions & 4 deletions TemplateSwiftAPP/TemplateSwiftAPP/APP/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

// 1. UI
tabBar = TabBarVC()
window?.backgroundColor = UIColor.white
window?.rootViewController = tabBar
// 0. UI - storyboard实现

// 1. UI - 代码实现
// tabBar = TabBarVC()
// window?.backgroundColor = UIColor.white
// window?.rootViewController = tabBar

// 1.1 导航栏字体和颜色
UINavigationBar.appearance().tintColor = .white
Expand Down
133 changes: 124 additions & 9 deletions TemplateSwiftAPP/TemplateSwiftAPP/APP/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,24 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" 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="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="VdB-ZE-tCY">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<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">
<!--首页-->
<scene sceneID="xU5-8M-9mV">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<navigationController id="W5v-YC-kSb" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="首页" image="main" selectedImage="mainSel" id="aZJ-az-DbY"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="kXu-fs-gbA">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="qGc-5k-wAz" kind="relationship" relationship="rootViewController" id="brI-yD-sHZ"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="thg-jy-ZLD" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="164" y="-546"/>
</scene>
<!--首页-->
<scene sceneID="Uzk-5z-1l7">
<objects>
<viewController id="qGc-5k-wAz" customClass="MainVC" customModule="TemplateSwiftAPP" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="VuP-JI-Ndg">
<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="7Vu-ho-uAf"/>
</view>
<navigationItem key="navigationItem" title="首页" id="5Iy-9W-1WW"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="jiL-S0-sgx" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="993" y="-546"/>
</scene>
<!--功能-->
<scene sceneID="b2g-fa-bMQ">
<objects>
<navigationController id="BOE-gq-ykH" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="功能" image="information" selectedImage="informationSel" id="ogR-Z8-AOb"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="b8M-Iy-1La">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="a98-wi-TFL" kind="relationship" relationship="rootViewController" id="Ozw-3w-vKq"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="wBh-S0-RJL" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="164" y="893"/>
</scene>
<!--功能-->
<scene sceneID="IkH-XQ-klW">
<objects>
<viewController id="a98-wi-TFL" customClass="InformationVC" customModule="TemplateSwiftAPP" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Dwr-1A-saX">
<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"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="iEU-8D-HQr"/>
</view>
<navigationItem key="navigationItem" title="功能" id="5JK-Vb-wAu"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="nac-6x-LGh" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="994" y="893"/>
</scene>
<!--分类-->
<scene sceneID="qqf-Jl-ChU">
<objects>
<navigationController id="Qge-Xx-2um" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="分类" image="library" selectedImage="librarySel" id="Lzp-mK-40Z"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Uph-iL-mJq">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="kRC-mq-Zlk" kind="relationship" relationship="rootViewController" id="MrK-cP-cbg"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="RgR-II-13u" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="164" y="145"/>
</scene>
<!--Category ManageVC-->
<scene sceneID="gSN-aw-p3o">
<objects>
<viewController id="kRC-mq-Zlk" customClass="CategoryManageVC" customModule="TemplateSwiftAPP" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Q3d-JH-lWi">
<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="J9I-KF-it8"/>
</view>
<navigationItem key="navigationItem" id="wse-2r-Esd"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="N7x-nm-8lT" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="995" y="156"/>
</scene>
<!--Tab Bar Controller-->
<scene sceneID="bM2-3j-PhC">
<objects>
<tabBarController id="VdB-ZE-tCY" sceneMemberID="viewController">
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="nE2-CD-KXP">
<rect key="frame" x="0.0" y="0.0" width="375" height="49"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tabBar>
<connections>
<segue destination="W5v-YC-kSb" kind="relationship" relationship="viewControllers" id="050-3P-h4U"/>
<segue destination="Qge-Xx-2um" kind="relationship" relationship="viewControllers" id="2lg-XV-SUS"/>
<segue destination="BOE-gq-ykH" kind="relationship" relationship="viewControllers" id="WuD-of-ltt"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="oux-nD-a9m" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-951" y="145"/>
</scene>
</scenes>
<resources>
<image name="information" width="20" height="22"/>
<image name="informationSel" width="20" height="23"/>
<image name="library" width="23" height="23"/>
<image name="librarySel" width="22" height="22"/>
<image name="main" width="21" height="22"/>
<image name="mainSel" width="22" height="23"/>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let AppStatus_Product = 1 // 正式环境
let AppStatus_Develop = 2 // 开发环境
let AppStatus_Test = 3 // 测试环境

let APP_STATUS = 2
let APP_STATUS = 1

class URLHelper: NSObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ class BaseLoadTC: BaseTC {
var offset: Int = 0
var limit: Int = 10

override init() {
super.init()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// override init() {
// super.init()
// }
//
// required init?(coder aDecoder: NSCoder) {
// fatalError("init(coder:) has not been implemented")
// }

override func viewDidLoad() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import UIKit
import DNSPageView

class BasePageVC: BaseVC {

// private var titles = [String]()
// private var controllers = [UIViewController]()

override func viewDidLoad() {
super.viewDidLoad()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ class BaseTC: BaseVC,UITableViewDelegate,UITableViewDataSource {
return view
}()

override init() {
super.init()
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// override init() {
// super.init()
// }
//
// required init?(coder aDecoder: NSCoder) {
// fatalError("init(coder:) has not been implemented")
// }

override func viewDidLoad() {
super.viewDidLoad()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ class BaseVC: UIViewController {
return view
}()

init() {
super.init(nibName: nil, bundle: nil)
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// init() {
// super.init(nibName: nil, bundle: nil)
// }
//
// required init?(coder aDecoder: NSCoder) {
// fatalError("init(coder:) has not been implemented")
// }

override func viewDidLoad() {
super.viewDidLoad()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@ class CategoryDetailVC: BaseLoadTC {

var categoryId: Int = 1

init(categoryId: Int) {
self.categoryId = categoryId
super.init()

self.isHideNav = true
}
// init(categoryId: Int) {
// self.categoryId = categoryId
// super.init()
// self.isHideNav = true
// }
//
// required init?(coder aDecoder: NSCoder) {
// fatalError("init(coder:) has not been implemented")
// }

var parentNav: UINavigationController?

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func tableViewFrame() -> CGRect {
return CGRect.init(x: 0, y: 0, width: Device_width, height: self.view.frame.size.height-Device_tab-Device_status)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class CategoryManageVC: BasePageVC {

var controllers = [UIViewController]()
for index in 0..<configTitles().count {
let vc = CategoryDetailVC.init(categoryId: index+1)
// let vc = CategoryDetailVC.init(categoryId: index+1)
let vc = CategoryDetailVC()
vc.categoryId = index+1
vc.parentNav = self.navigationController!
controllers.append(vc)
}
Expand Down

0 comments on commit b03f0c4

Please sign in to comment.