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
88cbd54a
Commit
88cbd54a
authored
Mar 16, 2020
by
Javier Heisekce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se colapsa los contactos
parent
92cc2d0f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
44 deletions
+49
-44
.gitignore
+2
-0
ContactsApp.xcodeproj/project.pbxproj
+4
-0
ContactsApp.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+0
-40
ContactsApp/ContactsViewController.swift
+29
-3
ContactsApp/File.swift
+13
-0
ContactsApp/SingleContactViewController.swift
+1
-1
No files found.
.gitignore
0 → 100644
View file @
88cbd54a
ContactsApp.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/
ContactsApp.xcodeproj/project.pbxproj
View file @
88cbd54a
...
...
@@ -12,6 +12,7 @@
CE3351F3241A65D400BA57CA
/* Main.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE3351F1241A65D400BA57CA
/* Main.storyboard */
;
};
CE3351F5241A65D500BA57CA
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE3351F4241A65D500BA57CA
/* Assets.xcassets */
;
};
CE3351F8241A65D500BA57CA
/* LaunchScreen.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CE3351F6241A65D500BA57CA
/* LaunchScreen.storyboard */
;
};
CEC259D8241FAC79005237F5
/* File.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEC259D7241FAC79005237F5
/* File.swift */
;
};
CEC9A37F241BFBD000F024EE
/* ContactsViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEC9A37E241BFBD000F024EE
/* ContactsViewController.swift */
;
};
CEC9A381241C096D00F024EE
/* SingleContactViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CEC9A380241C096D00F024EE
/* SingleContactViewController.swift */
;
};
/* End PBXBuildFile section */
...
...
@@ -24,6 +25,7 @@
CE3351F4241A65D500BA57CA
/* Assets.xcassets */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
folder.assetcatalog
;
path
=
Assets.xcassets
;
sourceTree
=
"<group>"
;
};
CE3351F7241A65D500BA57CA
/* Base */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.storyboard
;
name
=
Base
;
path
=
Base.lproj/LaunchScreen.storyboard
;
sourceTree
=
"<group>"
;
};
CE3351F9241A65D500BA57CA
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
CEC259D7241FAC79005237F5
/* File.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
File.swift
;
sourceTree
=
"<group>"
;
};
CEC9A37E241BFBD000F024EE
/* ContactsViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ContactsViewController.swift
;
sourceTree
=
"<group>"
;
};
CEC9A380241C096D00F024EE
/* SingleContactViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SingleContactViewController.swift
;
sourceTree
=
"<group>"
;
};
/* End PBXFileReference section */
...
...
@@ -66,6 +68,7 @@
CE3351F9241A65D500BA57CA
/* Info.plist */
,
CEC9A37E241BFBD000F024EE
/* ContactsViewController.swift */
,
CEC9A380241C096D00F024EE
/* SingleContactViewController.swift */
,
CEC259D7241FAC79005237F5
/* File.swift */
,
);
path
=
ContactsApp
;
sourceTree
=
"<group>"
;
...
...
@@ -141,6 +144,7 @@
isa
=
PBXSourcesBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
CEC259D8241FAC79005237F5
/* File.swift in Sources */
,
CE3351EC241A65D400BA57CA
/* AppDelegate.swift in Sources */
,
CEC9A37F241BFBD000F024EE
/* ContactsViewController.swift in Sources */
,
CE3351EE241A65D400BA57CA
/* SceneDelegate.swift in Sources */
,
...
...
ContactsApp.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
deleted
100644 → 0
View file @
92cc2d0f
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid =
"FAEBA8FF-01C0-4AC4-9E9A-FC8BDE9B6CFE"
type =
"1"
version =
"2.0"
>
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
uuid =
"DD77F967-46EF-4823-80DE-1DB5A3A787F1"
shouldBeEnabled =
"No"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"ContactsApp/SingleContactViewController.swift"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"26"
endingLineNumber =
"26"
landmarkName =
"viewDidLoad()"
landmarkType =
"7"
>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
uuid =
"ECE5C42C-6FA2-494C-BD01-61ED62BE071C"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"ContactsApp/SingleContactViewController.swift"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"24"
endingLineNumber =
"24"
landmarkName =
"viewDidLoad()"
landmarkType =
"7"
>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
ContactsApp/ContactsViewController.swift
View file @
88cbd54a
...
...
@@ -14,6 +14,7 @@ class ContactsViewController: UIViewController {
@IBOutlet
weak
var
contactsTable
:
UITableView
!
var
contacts
=
[
CNContact
]()
var
contactsBackup
=
[
CNContact
]()
let
contactStore
=
CNContactStore
()
override
func
viewDidLoad
()
{
...
...
@@ -24,9 +25,8 @@ class ContactsViewController: UIViewController {
func
importContacts
()
{
let
keys
=
[
CNContactFormatter
.
descriptorForRequiredKeys
(
for
:
.
fullName
)]
//obtengo
let
request
=
CNContactFetchRequest
(
keysToFetch
:
keys
)
let
keys
=
[
CNContactFormatter
.
descriptorForRequiredKeys
(
for
:
.
fullName
),
CNContactEmailAddressesKey
,
CNContactPhoneNumbersKey
,
CNContactImageDataKey
,
CNContactImageDataAvailableKey
]
as
[
Any
]
let
request
=
CNContactFetchRequest
(
keysToFetch
:
keys
as!
[
CNKeyDescriptor
])
request
.
sortOrder
=
CNContactSortOrder
.
givenName
do
{
try
self
.
contactStore
.
enumerateContacts
(
with
:
request
)
{
...
...
@@ -66,5 +66,31 @@ extension ContactsViewController: UITableViewDelegate, UITableViewDataSource {
performSegue
(
withIdentifier
:
"gotocontact"
,
sender
:
selectedContact
)
}
func
tableView
(
_
tableView
:
UITableView
,
estimatedHeightForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
40
}
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(
closeSection
)
,
for
:
.
touchUpInside
)
return
button
//ʌΛ
}
@objc
func
closeSection
()
{
contactsBackup
=
contacts
let
section
=
0
var
indexPaths
=
[
IndexPath
]()
for
row
in
contacts
.
indices
{
let
indexPath
=
IndexPath
(
row
:
row
,
section
:
section
)
indexPaths
.
append
(
indexPath
)
}
contacts
.
removeAll
()
contactsTable
.
reloadData
()
}
}
ContactsApp/File.swift
0 → 100644
View file @
88cbd54a
//
// File.swift
// ContactsApp
//
// Created by User on 3/16/20.
// Copyright © 2020 jheisecke. All rights reserved.
//
import
Foundation
class
Contacts
{
}
ContactsApp/SingleContactViewController.swift
View file @
88cbd54a
...
...
@@ -21,7 +21,7 @@ class SingleContactViewController: UIViewController {
if
let
contact
=
selectedContact
{
title
=
"
\(
contact
.
givenName
)
\(
contact
.
familyName
)
"
contactFullname
.
text
=
"
\(
contact
.
givenName
)
\(
contact
.
familyName
)
"
phoneNumber
.
text
=
contact
.
phoneNumbers
.
description
//phoneNumber.text = CNLabeledValue.localizedStringForLabel(contact.phoneNumbers)
if
contact
.
imageDataAvailable
{
if
let
image
=
contact
.
imageData
{
...
...
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