Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
contactos-app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Javier Heisecke
contactos-app
Commits
ef27a35c
Commit
ef27a35c
authored
Mar 25, 2020
by
Javier Heisekce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agrega estilo al header de la seccion
parent
8fc25034
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
26 deletions
+14
-26
ContactsApp/Base.lproj/Main.storyboard
+2
-10
ContactsApp/ContactSection.xib
+1
-1
ContactsApp/ContactSectionView.swift
+1
-7
ContactsApp/ContactsViewController.swift
+10
-8
No files found.
ContactsApp/Base.lproj/Main.storyboard
View file @
ef27a35c
...
...
@@ -19,16 +19,8 @@
<rect
key=
"frame"
x=
"0.0"
y=
"44"
width=
"375"
height=
"623"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<prototypes>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
preservesSuperviewLayoutMargins=
"YES"
selectionStyle=
"default"
indentationWidth=
"10"
id=
"l8U-st-Wic"
>
<rect
key=
"frame"
x=
"0.0"
y=
"28"
width=
"375"
height=
"43.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
preservesSuperviewLayoutMargins=
"YES"
insetsLayoutMarginsFromSafeArea=
"NO"
tableViewCell=
"l8U-st-Wic"
id=
"FAe-5V-uSO"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"43.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
preservesSuperviewLayoutMargins=
"YES"
selectionStyle=
"default"
indentationWidth=
"10"
reuseIdentifier=
"contactName"
id=
"QkB-8k-kbX"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
71.5
"
width=
"375"
height=
"43.5"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"
28
"
width=
"375"
height=
"43.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
preservesSuperviewLayoutMargins=
"YES"
insetsLayoutMarginsFromSafeArea=
"NO"
tableViewCell=
"QkB-8k-kbX"
id=
"AMU-de-w3M"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"43.5"
/>
...
...
@@ -59,7 +51,7 @@
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"On8-yo-4E7"
userLabel=
"First Responder"
customClass=
"UIResponder"
sceneMemberID=
"firstResponder"
/>
</objects>
<point
key=
"canvasLocation"
x=
"141
4.4927536231885"
y=
"63.616071428571423
"
/>
<point
key=
"canvasLocation"
x=
"141
3.5999999999999"
y=
"63.418290854572717
"
/>
</scene>
<!--Single Contact View Controller-->
<scene
sceneID=
"wAp-rN-Dr5"
>
...
...
ContactsApp/ContactSection.xib
View file @
ef27a35c
...
...
@@ -27,7 +27,7 @@
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
<color
key=
"backgroundColor"
red=
"0.90924546632124348"
green=
"0.90924546632124348"
blue=
"0.90924546632124348"
alpha=
"0.59999999999999998"
colorSpace=
"custom"
customColorSpace=
"sRGB
"
/>
<color
key=
"backgroundColor"
cocoaTouchSystemColor=
"lightTextColor
"
/>
<constraints>
<constraint
firstItem=
"vUN-kp-3ea"
firstAttribute=
"bottom"
secondItem=
"2Vg-Y7-9zD"
secondAttribute=
"bottom"
constant=
"1"
id=
"M1Z-qU-8CJ"
/>
<constraint
firstItem=
"rgh-bc-PuT"
firstAttribute=
"leading"
secondItem=
"vUN-kp-3ea"
secondAttribute=
"leading"
constant=
"16"
id=
"PMm-R4-l0c"
/>
...
...
ContactsApp/ContactSectionView.swift
View file @
ef27a35c
...
...
@@ -8,14 +8,8 @@
import
UIKit
class
ContactSectionView
:
UIView
{
class
ContactSectionView
:
UI
TableViewHeaderFooter
View
{
@IBOutlet
weak
var
labelLetter
:
UILabel
!
@IBOutlet
weak
var
labelExpandable
:
UIButton
!
override
func
draw
(
_
rect
:
CGRect
)
{
super
.
draw
(
rect
)
//title.text = "Jahata"
}
}
ContactsApp/ContactsViewController.swift
View file @
ef27a35c
...
...
@@ -18,6 +18,7 @@ class ContactsViewController: UIViewController {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
contactsTable
.
register
(
UINib
(
nibName
:
"ContactSection"
,
bundle
:
nil
),
forHeaderFooterViewReuseIdentifier
:
"headerId"
)
importContacts
()
contactsTable
.
tableFooterView
=
UIView
(
frame
:
.
zero
)
}
...
...
@@ -110,14 +111,15 @@ extension ContactsViewController: UITableViewDelegate, UITableViewDataSource {
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
button
=
UIButton
(
type
:
.
system
)
button
.
setTitle
(
"Λ"
,
for
:
.
normal
)
button
.
setTitleColor
(
.
black
,
for
:
.
normal
)
button
.
titleLabel
?
.
font
=
UIFont
.
boldSystemFont
(
ofSize
:
15
)
button
.
backgroundColor
=
.
systemGray4
button
.
addTarget
(
self
,
action
:
#selector(
interactSection
)
,
for
:
.
touchUpInside
)
button
.
tag
=
section
return
button
//ʌΛ
let
header
=
contactsTable
.
dequeueReusableHeaderFooterView
(
withIdentifier
:
"headerId"
)
as!
ContactSectionView
header
.
contentView
.
backgroundColor
=
.
systemGray4
header
.
labelExpandable
.
setTitle
(
"Λ"
,
for
:
.
normal
)
header
.
labelExpandable
.
setTitleColor
(
.
black
,
for
:
.
normal
)
header
.
labelExpandable
.
titleLabel
?
.
font
=
UIFont
.
boldSystemFont
(
ofSize
:
15
)
header
.
labelExpandable
.
addTarget
(
self
,
action
:
#selector(
interactSection
)
,
for
:
.
touchUpInside
)
header
.
labelExpandable
.
tag
=
section
header
.
labelLetter
.
text
=
contactStructArray
[
section
]
.
letter
return
header
//ʌΛ
}
@objc
func
interactSection
(
button
:
UIButton
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment