This file contains hidden or 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
| desc "Increment Patch version" | |
| lane :patch do | |
| version_number = update_version_number_and_commit(bump_type:"patch") | |
| version_number | |
| end | |
| desc "Increment minor version" | |
| lane :minor do | |
| version_number = update_version_number_and_commit(bump_type:"minor") | |
| version_number |
This file contains hidden or 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
| struct Pokemon: Codable { | |
| let name: String | |
| let number: Int | |
| } | |
| let pikachu = Pokemon(name: "Pikachu", number: 25) | |
| let pokemonJSON = try JSONEncoder().encode(pikachu) | |
| let pokemon = try JSONDecoder().decode(Pokemon.self, from: pokemonJSON) | |
This file contains hidden or 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
| import UIKit | |
| var str = "Hello, playground" | |
| //In swift 3.0 | |
| str.characters.count | |
| //In swift 4.0 | |
| str.count |
This file contains hidden or 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
| extension <#YOURCLASS#>: NFCNDEFReaderSessionDelegate { | |
| func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) { | |
| print("reader session invalidate with error: \(error.localizedDescription)") | |
| } | |
| func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) { | |
| print("reader session did detect NDEFs messages: \(messages)") | |
| } |
This file contains hidden or 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
| func startSession() { | |
| let session = NFCNDEFReaderSession(delegate: self, | |
| queue:nil, | |
| invalidateAfterFirstRead:false) | |
| session.begin() | |
| } |
This file contains hidden or 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
| import CoreNFC | |
| protocol NFCScannerProtocol: class { | |
| var scannerSession: NFCReaderSession? { get set } | |
| func startSession() | |
| } | |
| class NFCScanner: NSObject, NFCScannerProtocol { | |
| var scannerSession: NFCReaderSession? |
This file contains hidden or 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
| let nfcscanner = NFCScanner() | |
| nfcscanner.startSession() |
This file contains hidden or 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
| <key>com.apple.developer.nfc.readersession.formats</key> | |
| <array> | |
| <string>NDEF</string> | |
| </array> |
This file contains hidden or 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
| import CreateMLUI | |
| let builder = MLImageClassifierBuilder() | |
| builder.showInLiveView() |