Skip to content

Commit

Permalink
Update syntax (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
treastrain authored Nov 20, 2022
1 parent dd8049a commit 82ca04f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Sources/Core/NFCReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public actor NFCReader<TagType: NFCTagType> {
NotificationCenter.default.post(name: .didChangeNFCReaderSessionAndDelegate, object: sessionAndDelegateChangedObserver, userInfo: [.isNilSessionAndDelegate: sessionAndDelegate == nil])
}
}
private var sessionAndDelegateChangedObserver: NSObjectProtocol?
private var sessionAndDelegateChangedObserver: (any NSObjectProtocol)?
#endif

public init() {}
Expand Down
4 changes: 2 additions & 2 deletions Sources/FeliCa/FeliCaTagReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public typealias FeliCaTagReader = NFCReader<NativeTag>

extension FeliCaTagReader {
public typealias ReaderSessionProtocol = FeliCaTagReaderSessionProtocol
public typealias ReaderSessionProtocol = any FeliCaTagReaderSessionProtocol
}

extension FeliCaTagReader {
Expand All @@ -24,7 +24,7 @@ extension FeliCaTagReader {
detectingAlertMessage: detectingAlertMessage,
didBecomeActive: didBecomeActive,
didInvalidate: didInvalidate,
didDetect: { try await didDetect($0 as! FeliCaTagReaderSessionProtocol, $1) }
didDetect: { try await didDetect($0 as! any FeliCaTagReaderSessionProtocol, $1) }
)
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/FeliCa/FeliCaTagReaderSessionProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public protocol FeliCaTagReaderSessionProtocol: NFCNativeTagReaderSessionProtoco

extension FeliCaTagReaderSessionProtocol {
#if canImport(CoreNFC)
public func connectAsFeliCaTag(to tag: NFCTag) async throws -> NFCFeliCaTag {
public func connectAsFeliCaTag(to tag: NFCTag) async throws -> any NFCFeliCaTag {
guard case .feliCa(let feliCaTag) = tag else {
throw NFCReaderError(.readerErrorInvalidParameter)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/NDEFMessage/NDEFMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public enum NDEFMessage: NFCTagType {
#if canImport(CoreNFC)
public typealias ReaderSession = NFCNDEFReaderSession
public typealias ReaderSessionProtocol = NFCNDEFMessageReaderSessionProtocol
public typealias ReaderSessionProtocol = any NFCNDEFMessageReaderSessionProtocol
public typealias ReaderSessionDetectObject = [NFCNDEFMessage]
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/NDEFTag/NDEFTag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public enum NDEFTag: NFCTagType {
#if canImport(CoreNFC)
public typealias ReaderSession = NFCNDEFReaderSession
public typealias ReaderSessionProtocol = NFCNDEFTagReaderSessionProtocol
public typealias ReaderSessionProtocol = any NFCNDEFTagReaderSessionProtocol
public typealias ReaderSessionDetectObject = [NFCNDEFTag]
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/NativeTag/NativeTag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public enum NativeTag: NFCTagType {
#if canImport(CoreNFC)
public typealias ReaderSession = NFCTagReaderSession
public typealias ReaderSessionProtocol = NFCNativeTagReaderSessionProtocol
public typealias ReaderSessionProtocol = any NFCNativeTagReaderSessionProtocol
public typealias ReaderSessionDetectObject = [NFCTag]
#endif
}
Expand Down

0 comments on commit 82ca04f

Please sign in to comment.