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
import Foundation | |
fileprivate let userDefaults = UserDefaults.main | |
fileprivate let userDefaultsDomain = Bundle.main.bundleIdentifier ?? "" | |
fileprivate extension String { | |
var appendingAppDomain: String { | |
"\(userDefaultsDomain).\(self)" | |
} | |
} |
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
import UIKit | |
class WCGraintCircleLayer: CALayer { | |
override init () { | |
super.init() | |
} | |
convenience init(bounds:CGRect,position:CGPoint,fromColor:UIColor,toColor:UIColor,linewidth:CGFloat,toValue:CGFloat) { | |
self.init() |
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
// MARK: NSFetchedResultsController | |
extension ViewController: NSFetchedResultsControllerDelegate { | |
var blockOperations: [BlockOperation] = [] | |
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) { | |
switch type { | |
case .insert: | |
let insertBlock: () -> Void = { [weak self] in self?.collectionView?.insertItems(at: [newIndexPath!]) } | |
blockOperations.append(BlockOperation(block: insertBlock)) |
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
// | |
// MasterViewController.swift | |
// ProjectXX | |
// | |
// Created by Boris Dipner on 11/08/20. | |
// Copyright © 2020 Boris Dipner. All rights reserved. | |
// | |
import UIKit |
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
// | |
// CircleView.swift | |
// ProjectX | |
// | |
// Created by Boris Dipner on 01.01.2021. | |
// Copyright © 2021 Boris Dipner. All rights reserved. | |
// | |
import UIKit |
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
struct AdaptivePagingScrollView: View { | |
private let items: [AnyView] | |
private let itemPadding: CGFloat | |
private let itemSpacing: CGFloat | |
private let itemWidth: CGFloat | |
private let itemsAmount: Int | |
private let contentWidth: CGFloat | |
private let leadingOffset: CGFloat |
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
struct AdaptivePagingScrollView: View { | |
/// { * * * States * * * } | |
// 01 | |
private func countOffset(for pageIndex: Int) -> CGFloat { | |
let activePageOffset = CGFloat(pageIndex) * (itemWidth + itemPadding) | |
return leadingOffset - activePageOffset | |
} |
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
struct AdaptivePagingScrollView: View { | |
/// { * * * States * * * } | |
/// { * * * Functions * * * } | |
var body: some View { | |
// 01 | |
GeometryReader { viewGeometry in | |
HStack(alignment: .center, spacing: itemSpacing) { |
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
import SwiftUI | |
struct OnboardingCard: Codable, Identifiable, Equatable { | |
var id: UUID | |
var title: String | |
var subTitle: String | |
var image: String | |
} |
OlderNewer