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
| // | |
| // PomodoroPicker.swift | |
| // pomodoro | |
| // | |
| // Created by David Rozmajzl on 1/1/22. | |
| // | |
| import SwiftUI | |
| struct PomodoroPicker<Content, Item: Hashable>: View where Content: View { |
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 Combine | |
| import SwiftUI | |
| import CoreData | |
| class CoreDataViewModel: NSObject, ObservableObject, NSFetchedResultsControllerDelegate { | |
| let container: NSPersistentContainer | |
| private var controllerUpdates = [NSObject: CurrentValueSubject<[NSFetchRequestResult], Never>]() | |
| init(container: NSPersistentContainer) { | |
| self.container = container |
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 | |
| struct ContentView: View { | |
| @State var horizontal: Bool = true | |
| @Namespace var namespace | |
| var body: some View { | |
| VStack(spacing: 40) { | |
| if horizontal { | |
| HStack { items } |
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 | |
| /// Static properties for all preview devices. | |
| /// | |
| /// Usage: | |
| /// | |
| /// ```swift | |
| /// struct TestView_Previews: PreviewProvider { | |
| /// static var previews: some View { | |
| /// Group { |
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 Photos | |
| struct UnexpectedNilError: Error {} | |
| extension PHImageManager { | |
| func requestImage( | |
| for asset: PHAsset, | |
| targetSize: CGSize, | |
| contentMode: PHImageContentMode, | |
| options: PHImageRequestOptions? |
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 AVKit | |
| import Foundation | |
| class VideoHelper { | |
| static func getThumbnail(from player: AVPlayer, at time: CMTime, maximumSize: CGSize? = nil) -> CGImage? { | |
| guard let currentItem = player.currentItem else { return nil } | |
| return getThumbnail(from: currentItem.asset, at: time, maximumSize: maximumSize) | |
| } |
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
| // Excerpt from https://github.com/krzyzanowskim/CoreTextWorkshop | |
| // Licence BSD-2 clause | |
| // Marcin Krzyzanowski marcin@krzyzanowskim.com | |
| func getSizeThatFits(_ attributedString: NSAttributedString, maxWidth: CGFloat) -> CGSize { | |
| let framesetter = CTFramesetterCreateWithAttributedString(attributedString) | |
| let rectPath = CGRect(origin: .zero, size: CGSize(width: maxWidth, height: 50000)) | |
| let ctFrame = CTFramesetterCreateFrame(framesetter, CFRange(), CGPath(rect: rectPath, transform: nil), 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
| ACTION=install | |
| ADDITIONAL_SDKS= | |
| AD_HOC_CODE_SIGNING_ALLOWED=YES | |
| ALL_OTHER_LDFLAGS=' ' | |
| ALL_OTHER_LIBTOOLFLAGS=' ' | |
| ALTERNATE_GROUP=staff | |
| ALTERNATE_LINKER= | |
| ALTERNATE_MODE=u+w,go-w,a+rX | |
| ALTERNATE_OWNER=username | |
| ALTERNATE_PERMISSIONS_FILES= |