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 SwiftUI | |
| import AVFoundation | |
| class AVSpeechSynthGlue: NSObject, AVSpeechSynthesizerDelegate { | |
| enum State { | |
| case didStart(AVSpeechUtterance) | |
| case willSpeakRangeOfSpeechString(NSRange) | |
| case willSpeak(AVSpeechSynthesisMarker) | |
| case didPause(AVSpeechUtterance) | |
| case didContinue(AVSpeechUtterance) |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | |
| <device id="retina4_7" orientation="portrait"> | |
| <adaptation id="fullscreen"/> | |
| </device> | |
| <dependencies> | |
| <deployment identifier="iOS"/> | |
| <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> | |
| <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> | |
| <capability name="Safe area layout guides" minToolsVersion="9.0"/> |
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
| var myArray: [[String]] = [ | |
| ["1", "picture1.png", "John", "Smith"], | |
| ["2", "picture2.png", "Mike", "Rutherford"], | |
| ] | |
| func sort<T: Comparable>(ArrayOfArrays: [[T]], sortingIndex: Int, sortFunc: (T, T) -> Bool) -> [[T]] { | |
| return ArrayOfArrays.sorted { sortFunc($0[sortingIndex], $1[sortingIndex])} | |
| } | |
| print(sort(ArrayOfArrays: myArray, sortingIndex: 0, sortFunc: <)) | |
| //[["1", "picture1.png", "John", "Smith"], ["2", "picture2.png", "Mike", "Rutherford"]] |
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 collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath){ | |
| // First selection, just set it and reload that cell | |
| guard let selectedIndexPath = selectedIndexPath else { | |
| selectedIndexPath = indexPath | |
| collectionView.reloadItems(at: [indexPath]) | |
| return | |
| } | |
| // Reset to none selected and reload that cell | |
| if(selectedIndexPath == indexPath) { | |
| selectedIndexPath = nil |
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
| // | |
| // UIDeviceHardware.h | |
| // | |
| // Used to determine EXACT version of device software is running on. | |
| #import <Foundation/Foundation.h> | |
| @interface UIDeviceHardware : NSObject | |
| - (NSString *) platform; |
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
| // | |
| // UIDeviceHardware.h | |
| // | |
| // Used to determine EXACT version of device software is running on. | |
| #import <Foundation/Foundation.h> | |
| @interface UIDeviceHardware : NSObject | |
| - (NSString *) platform; |
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
| // | |
| // UIDeviceHardware.h | |
| // | |
| // Used to determine EXACT version of device software is running on. | |
| #import <Foundation/Foundation.h> | |
| @interface UIDeviceHardware : NSObject | |
| - (NSString *) platform; |
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
| // | |
| // UIDeviceHardware.h | |
| // | |
| // Used to determine EXACT version of device software is running on. | |
| #import <Foundation/Foundation.h> | |
| @interface UIDeviceHardware : NSObject | |
| - (NSString *) platform; |