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
Hide 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 @@
...
@@ -19,16 +19,8 @@
<rect
key=
"frame"
x=
"0.0"
y=
"44"
width=
"375"
height=
"623"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"44"
width=
"375"
height=
"623"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
cocoaTouchSystemColor=
"whiteColor"
/>
<prototypes>
<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"
>
<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"
/>
<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"
>
<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"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"43.5"
/>
...
@@ -59,7 +51,7 @@
...
@@ -59,7 +51,7 @@
</viewController>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"On8-yo-4E7"
userLabel=
"First Responder"
customClass=
"UIResponder"
sceneMemberID=
"firstResponder"
/>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"On8-yo-4E7"
userLabel=
"First Responder"
customClass=
"UIResponder"
sceneMemberID=
"firstResponder"
/>
</objects>
</objects>
<point
key=
"canvasLocation"
x=
"141
4.4927536231885"
y=
"63.616071428571423
"
/>
<point
key=
"canvasLocation"
x=
"141
3.5999999999999"
y=
"63.418290854572717
"
/>
</scene>
</scene>
<!--Single Contact View Controller-->
<!--Single Contact View Controller-->
<scene
sceneID=
"wAp-rN-Dr5"
>
<scene
sceneID=
"wAp-rN-Dr5"
>
...
...
ContactsApp/ContactSection.xib
View file @
ef27a35c
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<nil
key=
"highlightedColor"
/>
<nil
key=
"highlightedColor"
/>
</label>
</label>
</subviews>
</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>
<constraints>
<constraint
firstItem=
"vUN-kp-3ea"
firstAttribute=
"bottom"
secondItem=
"2Vg-Y7-9zD"
secondAttribute=
"bottom"
constant=
"1"
id=
"M1Z-qU-8CJ"
/>
<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"
/>
<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 @@
...
@@ -8,14 +8,8 @@
import
UIKit
import
UIKit
class
ContactSectionView
:
UIView
{
class
ContactSectionView
:
UI
TableViewHeaderFooter
View
{
@IBOutlet
weak
var
labelLetter
:
UILabel
!
@IBOutlet
weak
var
labelLetter
:
UILabel
!
@IBOutlet
weak
var
labelExpandable
:
UIButton
!
@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 {
...
@@ -18,6 +18,7 @@ class ContactsViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
contactsTable
.
register
(
UINib
(
nibName
:
"ContactSection"
,
bundle
:
nil
),
forHeaderFooterViewReuseIdentifier
:
"headerId"
)
importContacts
()
importContacts
()
contactsTable
.
tableFooterView
=
UIView
(
frame
:
.
zero
)
contactsTable
.
tableFooterView
=
UIView
(
frame
:
.
zero
)
}
}
...
@@ -110,14 +111,15 @@ extension ContactsViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -110,14 +111,15 @@ extension ContactsViewController: UITableViewDelegate, UITableViewDataSource {
}
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
button
=
UIButton
(
type
:
.
system
)
let
header
=
contactsTable
.
dequeueReusableHeaderFooterView
(
withIdentifier
:
"headerId"
)
as!
ContactSectionView
button
.
setTitle
(
"Λ"
,
for
:
.
normal
)
header
.
contentView
.
backgroundColor
=
.
systemGray4
button
.
setTitleColor
(
.
black
,
for
:
.
normal
)
header
.
labelExpandable
.
setTitle
(
"Λ"
,
for
:
.
normal
)
button
.
titleLabel
?
.
font
=
UIFont
.
boldSystemFont
(
ofSize
:
15
)
header
.
labelExpandable
.
setTitleColor
(
.
black
,
for
:
.
normal
)
button
.
backgroundColor
=
.
systemGray4
header
.
labelExpandable
.
titleLabel
?
.
font
=
UIFont
.
boldSystemFont
(
ofSize
:
15
)
button
.
addTarget
(
self
,
action
:
#selector(
interactSection
)
,
for
:
.
touchUpInside
)
header
.
labelExpandable
.
addTarget
(
self
,
action
:
#selector(
interactSection
)
,
for
:
.
touchUpInside
)
button
.
tag
=
section
header
.
labelExpandable
.
tag
=
section
return
button
//ʌΛ
header
.
labelLetter
.
text
=
contactStructArray
[
section
]
.
letter
return
header
//ʌΛ
}
}
@objc
func
interactSection
(
button
:
UIButton
)
{
@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