-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to Swift 2.2. Added more date extension enhancements.
- Loading branch information
1 parent
7160c59
commit bec0b39
Showing
19 changed files
with
182 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// CLKComplicationServer.swift | ||
// ZamzamKit | ||
// | ||
// Created by Basem Emara on 3/22/16. | ||
// Copyright © 2016 Zamzam. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import ClockKit | ||
|
||
public extension CLKComplicationServer { | ||
|
||
public func reloadTimelineForComplications() { | ||
if let complications = self.activeComplications | ||
where complications.any() { | ||
for complication in complications { | ||
self.reloadTimelineForComplication(complication) | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// NSTimeInterval.swift | ||
// ZamzamKit | ||
// | ||
// Created by Basem Emara on 3/22/16. | ||
// Copyright © 2016 Zamzam. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public extension NSTimeInterval { | ||
|
||
public var seconds: Int { | ||
return Int(self) | ||
} | ||
|
||
public var minutes: Double { | ||
return self / 60.0 | ||
} | ||
|
||
public var hours: Double { | ||
return self / 3600.0 | ||
} | ||
|
||
public var days: Double { | ||
return self / 86400.0 | ||
} | ||
|
||
public var weeks: Double { | ||
return self / 604800.0 | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//: Playground - noun: a place where people can play | ||
|
||
import UIKit | ||
|
||
let date1 = NSDate(timeIntervalSinceNow: -60) | ||
let seconds = NSDate().timeIntervalSinceDate(date1) | ||
print(seconds) |
2 changes: 1 addition & 1 deletion
2
...amzamKit.playground/contents.xcplayground → ZamzamKit.playground/contents.xcplayground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<playground version='5.0' target-platform='osx'> | ||
<playground version='5.0' target-platform='ios'> | ||
<timeline fileName='timeline.xctimeline'/> | ||
</playground> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.