-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add feature attach media with use categories
- Loading branch information
Pierre jonny cau
committed
May 11, 2018
1 parent
7f056e7
commit c14344d
Showing
11 changed files
with
216 additions
and
19 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
12 changes: 12 additions & 0 deletions
12
LocalNotifications_Over_iOS10/Assets.xcassets/kandinsky.imageset/Contents.json
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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "kandinsky.jpg" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+158 KB
LocalNotifications_Over_iOS10/Assets.xcassets/kandinsky.imageset/kandinsky.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
35 changes: 35 additions & 0 deletions
35
LocalNotifications_Over_iOS10/NotificationManager/Helpers/UIHelper.swift
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,35 @@ | ||
// | ||
// UIHelper.swift | ||
// iOS10_LocalNotifications | ||
// | ||
// Created by Cau Pierre Jonny on 2017-09-26. | ||
// Copyright © 2017 Cau Pierre Jonny . All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
/// `UIHelper` helper class. | ||
/// | ||
final class UIHelper { | ||
|
||
class func saveImage(name: String) -> URL? { | ||
|
||
guard let image = UIImage(named: name) else { return nil } | ||
|
||
let data = UIImagePNGRepresentation(image) | ||
|
||
let path = FileManager.default.urls(for: FileManager.SearchPathDirectory.cachesDirectory, in: FileManager.SearchPathDomainMask.userDomainMask)[0] | ||
|
||
do { | ||
|
||
let fileURL = path.appendingPathComponent("\(name)") | ||
_ = try data?.write(to: fileURL) | ||
|
||
return fileURL | ||
|
||
} catch { | ||
|
||
return nil | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
LocalNotifications_Over_iOS10/NotificationManager/Models/AttachmentIdentifier.swift
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,37 @@ | ||
// | ||
// AttachmentIdentifier.swift | ||
// iOS10_LocalNotifications | ||
// | ||
// Created by Cau Pierre Jonny on 2017-09-26. | ||
// Copyright © 2017 Cau Pierre Jonny . All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
@objc public class AttachmentIdentifier: NSObject { | ||
|
||
private static let instance = { | ||
return AttachmentIdentifier() | ||
}() | ||
|
||
@objc public static func shared() -> AttachmentIdentifier { | ||
|
||
return AttachmentIdentifier.instance | ||
} | ||
|
||
private override init() { | ||
//This prevents others from using the default '()' initializer for this class. | ||
} | ||
|
||
@objc public func request() -> String { return "requestIdentifier"} | ||
@objc public func reply() -> String { return "replyIdentifier"} | ||
@objc public func share() -> String { return "shareIdentifier"} | ||
@objc public func follow() -> String { return "followIdentifier"} | ||
@objc public func destructive() -> String { return "destructiveIdentifier"} | ||
@objc public func direction() -> String { return "directionIdentifier"} | ||
@objc public func category() -> String { return "categoryIdentifier"} | ||
@objc public func image() -> String { return "imageIdentifier"} | ||
@objc public func video() -> String { return "videoIdentifier"} | ||
@objc public func customContent() -> String { return "customContentIdentifier"} | ||
|
||
} |
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
Oops, something went wrong.