This repository has been archived by the owner on Mar 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
323 additions
and
87 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,19 @@ | ||
// | ||
// NoteFilter.swift | ||
// Noted | ||
// | ||
// Created by Dominik Hádl on 17/09/16. | ||
// Copyright © 2016 Nodes. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol NoteFilter { | ||
func shouldFilter(note: NoteType) -> Bool | ||
} | ||
|
||
internal struct PassthroughNoteFilter: NoteFilter { | ||
internal func shouldFilter(note: NoteType) -> Bool { | ||
return false | ||
} | ||
} |
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,20 @@ | ||
// | ||
// NoteObserver.swift | ||
// Noted | ||
// | ||
// Created by Dominik Hádl on 17/09/16. | ||
// Copyright © 2016 Nodes. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol NoteObserver: AnyObject { | ||
func didReceive(note: NoteType) | ||
var noteFilter: NoteFilter { get } | ||
} | ||
|
||
extension NoteObserver { | ||
public var noteFilter: NoteFilter { | ||
return Noted.passthroughFilter | ||
} | ||
} |
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,11 @@ | ||
// | ||
// NoteType.swift | ||
// Noted | ||
// | ||
// Created by Dominik Hádl on 17/09/16. | ||
// Copyright © 2016 Nodes. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol NoteType { } |
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.