Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hbystudio
Cocoa
提交
59da3538
C
Cocoa
项目概览
hbystudio
/
Cocoa
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cocoa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
59da3538
编写于
5月 18, 2018
作者:
L
libinbin106
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
selectBar
上级
28a6d5c4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
149 addition
and
4 deletion
+149
-4
DYZB01/DYZB01.xcodeproj/project.pbxproj
DYZB01/DYZB01.xcodeproj/project.pbxproj
+8
-0
DYZB01/DYZB01/Base.lproj/Main.storyboard
DYZB01/DYZB01/Base.lproj/Main.storyboard
+27
-3
DYZB01/DYZB01/PrefixHeader.swift
DYZB01/DYZB01/PrefixHeader.swift
+16
-0
DYZB01/DYZB01/ViewController.swift
DYZB01/DYZB01/ViewController.swift
+11
-1
DYZB01/DYZB01/selectBar.swift
DYZB01/DYZB01/selectBar.swift
+87
-0
未找到文件。
DYZB01/DYZB01.xcodeproj/project.pbxproj
浏览文件 @
59da3538
...
...
@@ -12,6 +12,8 @@
24A142FD20AEA6EA007CCF1D
/* Main.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
24A142FB20AEA6EA007CCF1D
/* Main.storyboard */
;
};
24A142FF20AEA6ED007CCF1D
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
24A142FE20AEA6ED007CCF1D
/* Assets.xcassets */
;
};
24A1430220AEA6ED007CCF1D
/* LaunchScreen.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
24A1430020AEA6ED007CCF1D
/* LaunchScreen.storyboard */
;
};
24A1430A20AEAF08007CCF1D
/* selectBar.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
24A1430920AEAF08007CCF1D
/* selectBar.swift */
;
};
24A1430C20AEBF4F007CCF1D
/* PrefixHeader.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
24A1430B20AEBF4F007CCF1D
/* PrefixHeader.swift */
;
};
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
...
...
@@ -22,6 +24,8 @@
24A142FE20AEA6ED007CCF1D
/* Assets.xcassets */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
folder.assetcatalog
;
path
=
Assets.xcassets
;
sourceTree
=
"<group>"
;
};
24A1430120AEA6ED007CCF1D
/* Base */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.storyboard
;
name
=
Base
;
path
=
Base.lproj/LaunchScreen.storyboard
;
sourceTree
=
"<group>"
;
};
24A1430320AEA6ED007CCF1D
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
24A1430920AEAF08007CCF1D
/* selectBar.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
selectBar.swift
;
sourceTree
=
"<group>"
;
};
24A1430B20AEBF4F007CCF1D
/* PrefixHeader.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PrefixHeader.swift
;
sourceTree
=
"<group>"
;
};
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -56,6 +60,8 @@
children
=
(
24A142F720AEA6EA007CCF1D
/* AppDelegate.swift */
,
24A142F920AEA6EA007CCF1D
/* ViewController.swift */
,
24A1430B20AEBF4F007CCF1D
/* PrefixHeader.swift */
,
24A1430920AEAF08007CCF1D
/* selectBar.swift */
,
24A142FB20AEA6EA007CCF1D
/* Main.storyboard */
,
24A142FE20AEA6ED007CCF1D
/* Assets.xcassets */
,
24A1430020AEA6ED007CCF1D
/* LaunchScreen.storyboard */
,
...
...
@@ -135,8 +141,10 @@
isa
=
PBXSourcesBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
24A1430C20AEBF4F007CCF1D
/* PrefixHeader.swift in Sources */
,
24A142FA20AEA6EA007CCF1D
/* ViewController.swift in Sources */
,
24A142F820AEA6EA007CCF1D
/* AppDelegate.swift in Sources */
,
24A1430A20AEAF08007CCF1D
/* selectBar.swift in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
DYZB01/DYZB01/Base.lproj/Main.storyboard
浏览文件 @
59da3538
<?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=
"14109"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
initialViewController=
"O0k-4B-o1Q"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
</device>
<dependencies>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"13104.12"
/>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"14088"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
...
...
@@ -9,16 +13,36 @@
<!--View Controller-->
<scene
sceneID=
"tne-QT-ifu"
>
<objects>
<viewController
id=
"BYZ-38-t0r"
customClass=
"ViewController"
customModuleProvider=
"target"
sceneMemberID=
"viewController"
>
<viewController
id=
"BYZ-38-t0r"
customClass=
"ViewController"
customModule
=
"DYZB01"
customModule
Provider=
"target"
sceneMemberID=
"viewController"
>
<view
key=
"view"
contentMode=
"scaleToFill"
id=
"8bC-Xf-vdC"
>
<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>
<navigationItem
key=
"navigationItem"
id=
"m5V-kJ-u3o"
/>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"dkx-z0-nzr"
sceneMemberID=
"firstResponder"
/>
</objects>
<point
key=
"canvasLocation"
x=
"1076"
y=
"133.5832083958021"
/>
</scene>
<!--Navigation Controller-->
<scene
sceneID=
"tss-g9-Nab"
>
<objects>
<navigationController
automaticallyAdjustsScrollViewInsets=
"NO"
id=
"O0k-4B-o1Q"
sceneMemberID=
"viewController"
>
<toolbarItems/>
<navigationBar
key=
"navigationBar"
contentMode=
"scaleToFill"
insetsLayoutMarginsFromSafeArea=
"NO"
id=
"RK5-8u-c2T"
>
<rect
key=
"frame"
x=
"0.0"
y=
"20"
width=
"375"
height=
"44"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
</navigationBar>
<nil
name=
"viewControllers"
/>
<connections>
<segue
destination=
"BYZ-38-t0r"
kind=
"relationship"
relationship=
"rootViewController"
id=
"Xg5-AC-g2V"
/>
</connections>
</navigationController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"nwN-7v-5V8"
userLabel=
"First Responder"
sceneMemberID=
"firstResponder"
/>
</objects>
<point
key=
"canvasLocation"
x=
"209"
y=
"134"
/>
</scene>
</scenes>
</document>
DYZB01/DYZB01/PrefixHeader.swift
0 → 100644
浏览文件 @
59da3538
//
// PrefixHeader.swift
// DYZB01
//
// Created by temp on 2018/5/18.
// Copyright © 2018年 temp. All rights reserved.
//
import
UIKit
let
ScreenWidth
=
UIScreen
.
main
.
bounds
.
size
.
width
let
ScreenHeight
=
UIScreen
.
main
.
bounds
.
size
.
height
class
PrefixHeader
:
NSObject
{
}
DYZB01/DYZB01/ViewController.swift
浏览文件 @
59da3538
...
...
@@ -8,11 +8,21 @@
import
UIKit
class
ViewController
:
UIViewController
{
class
ViewController
:
UIViewController
,
SelectBarProtocol
{
func
changeSelectBarItem
(
status
:
SelectBarStatus
)
{
}
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
// Do any additional setup after loading the view, typically from a nib.
navigationController
?
.
navigationBar
.
barTintColor
=
UIColor
.
init
(
red
:
247
/
255.5
,
green
:
247
/
255.5
,
blue
:
247
/
255.5
,
alpha
:
1
)
view
.
backgroundColor
=
UIColor
.
white
let
bar
=
selectBar
.
init
(
frame
:
CGRect
(
x
:
0
,
y
:
110
,
width
:
ScreenWidth
,
height
:
40
))
bar
.
delegate
=
self
view
.
addSubview
(
bar
)
}
override
func
didReceiveMemoryWarning
()
{
...
...
DYZB01/DYZB01/selectBar.swift
0 → 100644
浏览文件 @
59da3538
//
// selectBar.swift
// DYZB01
//
// Created by temp on 2018/5/18.
// Copyright © 2018年 temp. All rights reserved.
//
import
UIKit
enum
SelectBarStatus
{
case
SelectBarStatusRecommend
case
SelectBarStatusGame
case
SelectBarStatusAmuse
case
SelectBarStatusFun
}
protocol
SelectBarProtocol
:
class
{
func
changeSelectBarItem
(
status
:
SelectBarStatus
)
}
class
selectBar
:
UIView
{
weak
var
delegate
:
SelectBarProtocol
!
var
recommendBtn
:
UIButton
!
var
gameBtn
:
UIButton
!
var
amuseBtn
:
UIButton
!
var
funBtn
:
UIButton
!
var
bottomLine
:
UIView
!
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
recommendBtn
=
UIButton
.
init
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
frame
.
size
.
width
/
4
,
height
:
39
))
recommendBtn
.
setTitle
(
"推荐"
,
for
:
.
normal
)
recommendBtn
.
addTarget
(
self
,
action
:
#selector(
btnClick
)
,
for
:
.
touchUpInside
)
recommendBtn
.
setTitleColor
(
UIColor
.
orange
,
for
:
.
normal
)
recommendBtn
.
setTitleColor
(
UIColor
.
orange
,
for
:
.
highlighted
)
recommendBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
15
)
addSubview
(
recommendBtn
)
gameBtn
=
UIButton
.
init
(
frame
:
CGRect
(
x
:
frame
.
size
.
width
*
1
/
4
,
y
:
0
,
width
:
frame
.
size
.
width
/
4
,
height
:
39
))
gameBtn
.
setTitle
(
"游戏"
,
for
:
.
normal
)
gameBtn
.
addTarget
(
self
,
action
:
#selector(
btnClick
)
,
for
:
.
touchUpInside
)
gameBtn
.
setTitleColor
(
UIColor
.
orange
,
for
:
.
normal
)
gameBtn
.
setTitleColor
(
UIColor
.
orange
,
for
:
.
highlighted
)
gameBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
15
)
addSubview
(
gameBtn
)
amuseBtn
=
UIButton
.
init
(
frame
:
CGRect
(
x
:
frame
.
size
.
width
*
2
/
4
,
y
:
0
,
width
:
frame
.
size
.
width
/
4
,
height
:
39
))
amuseBtn
.
setTitle
(
"娱乐"
,
for
:
.
normal
)
amuseBtn
.
addTarget
(
self
,
action
:
#selector(
btnClick
)
,
for
:
.
touchUpInside
)
amuseBtn
.
setTitleColor
(
UIColor
.
orange
,
for
:
.
normal
)
amuseBtn
.
setTitleColor
(
UIColor
.
orange
,
for
:
.
highlighted
)
amuseBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
15
)
addSubview
(
amuseBtn
)
funBtn
=
UIButton
.
init
(
frame
:
CGRect
(
x
:
frame
.
size
.
width
*
3
/
4
,
y
:
0
,
width
:
frame
.
size
.
width
/
4
,
height
:
39
))
funBtn
.
setTitle
(
"趣玩"
,
for
:
.
normal
)
funBtn
.
addTarget
(
self
,
action
:
#selector(
btnClick
)
,
for
:
.
touchUpInside
)
funBtn
.
setTitleColor
(
UIColor
.
orange
,
for
:
.
normal
)
funBtn
.
setTitleColor
(
UIColor
.
orange
,
for
:
.
highlighted
)
funBtn
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
15
)
addSubview
(
funBtn
)
bottomLine
=
UIView
.
init
(
frame
:
CGRect
(
x
:
frame
.
size
.
width
/
8
-
20
,
y
:
39
,
width
:
40
,
height
:
1
))
bottomLine
.
backgroundColor
=
UIColor
.
orange
addSubview
(
bottomLine
)
}
required
init
?(
coder
aDecoder
:
NSCoder
)
{
super
.
init
(
coder
:
aDecoder
)
}
@objc
func
btnClick
(
sender
:
UIButton
)
{
print
(
sender
)
recommendBtn
.
setTitleColor
(
UIColor
.
black
,
for
:
.
normal
)
gameBtn
.
setTitleColor
(
UIColor
.
black
,
for
:
.
normal
)
amuseBtn
.
setTitleColor
(
UIColor
.
black
,
for
:
.
normal
)
funBtn
.
setTitleColor
(
UIColor
.
black
,
for
:
.
normal
)
sender
.
setTitleColor
(
UIColor
.
orange
,
for
:
.
normal
)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录