Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
e1f96726
Commit
e1f96726
authored
Sep 07, 2015
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Example] Update the example code
parent
e54a9467
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
AppDelegate.swift
examples/Alamofire Example/Example/AppDelegate.swift
+4
-4
DetailViewController.swift
...ples/Alamofire Example/Example/DetailViewController.swift
+4
-4
No files found.
examples/Alamofire Example/Example/AppDelegate.swift
View file @
e1f96726
...
@@ -29,9 +29,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
...
@@ -29,9 +29,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
// MARK: - UIApplicationDelegate
// MARK: - UIApplicationDelegate
func
application
(
application
:
UIApplication
!
,
didFinishLaunchingWithOptions
launchOptions
:
NSDictionary
!
)
->
Bool
{
func
application
(
application
:
UIApplication
,
didLaunchWithOptions
launchOptions
:
[
NSObject
:
AnyObject
]?
)
->
Bool
{
let
splitViewController
=
self
.
window
!.
rootViewController
as
UISplitViewController
let
splitViewController
=
self
.
window
!.
rootViewController
as
!
UISplitViewController
let
navigationController
=
splitViewController
.
viewControllers
.
last
as
UINavigationController
let
navigationController
=
splitViewController
.
viewControllers
.
last
as
!
UINavigationController
navigationController
.
topViewController
.
navigationItem
.
leftBarButtonItem
=
splitViewController
.
displayModeButtonItem
()
navigationController
.
topViewController
.
navigationItem
.
leftBarButtonItem
=
splitViewController
.
displayModeButtonItem
()
splitViewController
.
delegate
=
self
splitViewController
.
delegate
=
self
...
@@ -40,7 +40,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
...
@@ -40,7 +40,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
// MARK: - UISplitViewControllerDelegate
// MARK: - UISplitViewControllerDelegate
func
splitViewController
(
splitViewController
:
UISplitViewController
!
,
collapseSecondaryViewController
secondaryViewController
:
UIViewController
!
,
ontoPrimaryViewController
primaryViewController
:
UIViewController
!
)
->
Bool
{
func
splitViewController
(
splitViewController
:
UISplitViewController
,
collapseSecondaryViewController
secondaryViewController
:
UIViewController
!
,
ontoPrimaryViewController
primaryViewController
:
UIViewController
!
)
->
Bool
{
if
let
secondaryAsNavController
=
secondaryViewController
as?
UINavigationController
{
if
let
secondaryAsNavController
=
secondaryViewController
as?
UINavigationController
{
if
let
topAsDetailController
=
secondaryAsNavController
.
topViewController
as?
DetailViewController
{
if
let
topAsDetailController
=
secondaryAsNavController
.
topViewController
as?
DetailViewController
{
return
topAsDetailController
.
request
==
nil
return
topAsDetailController
.
request
==
nil
...
...
examples/Alamofire Example/Example/DetailViewController.swift
View file @
e1f96726
...
@@ -100,18 +100,18 @@ class DetailViewController: UITableViewController {
...
@@ -100,18 +100,18 @@ class DetailViewController: UITableViewController {
switch
Sections
(
rawValue
:
indexPath
.
section
)
!
{
switch
Sections
(
rawValue
:
indexPath
.
section
)
!
{
case
.
Headers
:
case
.
Headers
:
let
cell
=
self
.
tableView
.
dequeueReusableCellWithIdentifier
(
"Header"
)
as
UITableViewCell
let
cell
=
self
.
tableView
.
dequeueReusableCellWithIdentifier
(
"Header"
)
as
!
UITableViewCell
let
field
=
self
.
headers
.
keys
.
array
.
sorted
(
<
)[
indexPath
.
row
]
let
field
=
self
.
headers
.
keys
.
array
.
sorted
(
<
)[
indexPath
.
row
]
let
value
=
self
.
headers
[
field
]
let
value
=
self
.
headers
[
field
]
cell
.
textLabel
.
text
=
field
cell
.
textLabel
!
.
text
=
field
cell
.
detailTextLabel
!.
text
=
value
cell
.
detailTextLabel
!.
text
=
value
return
cell
return
cell
case
.
Body
:
case
.
Body
:
let
cell
=
self
.
tableView
.
dequeueReusableCellWithIdentifier
(
"Body"
)
as
UITableViewCell
let
cell
=
self
.
tableView
.
dequeueReusableCellWithIdentifier
(
"Body"
)
as
!
UITableViewCell
cell
.
textLabel
.
text
=
self
.
body
cell
.
textLabel
!
.
text
=
self
.
body
return
cell
return
cell
}
}
...
...
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