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
| // | |
| // DeviceConstants.swift | |
| // SampleApp | |
| // | |
| // Created by RoLY roLLs on 12/31/19. | |
| // Copyright © 2019 RoLYroLLs Enterprises, LLC. All rights reserved. | |
| // | |
| /// Taken from https://developer.apple.com/documentation/swiftui/securefield/3289399-previewdevice |
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
| // | |
| // BottomSheetView.swift | |
| // | |
| // Created by Majid Jabrayilov | |
| // Copyright © 2019 Majid Jabrayilov. All rights reserved. | |
| // | |
| import SwiftUI | |
| fileprivate enum Constants { | |
| static let radius: CGFloat = 16 |
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
| final fileprivate class Weak<A: AnyObject> { | |
| weak var value: A? | |
| init(_ value: A) { | |
| self.value = value | |
| } | |
| } | |
| final class ImageManager { | |
| fileprivate var values: [URL:Weak<Resource<UIImage>>] = [:] | |
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 { | |
| var body: some View { | |
| ZStack(alignment: Alignment.top) { | |
| MapView() | |
| SlideOverCard { | |
| VStack { | |
| CoverImage(imageName: "maitlandbay") | |
| Text("Maitland Bay") |
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 SearchBar : View { | |
| @Binding var searchText: String | |
| var body: some View { | |
| HStack { | |
| Image(systemName: "magnifyingglass").foregroundColor(.secondary) | |
| TextField( | |
| $searchText, | |
| placeholder: Text("Search")) { | |
| UIApplication.shared.keyWindow?.endEditing(true) |
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
| final class Loader: BindableObject { | |
| let didChange = PassthroughSubject<Data?, Never>() | |
| var task: URLSessionDataTask! | |
| var data: Data? = nil { | |
| didSet { | |
| didChange.send(data) | |
| } | |
| } | |
| init(_ url: URL) { |
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
| // | |
| // KeyboardDelegate.swift | |
| // | |
| // Created by Richard Robinson on 2019-05-26. | |
| // Copyright © 2019 Richard Robinson. All rights reserved. | |
| // | |
| import Foundation | |
| import UIKit |
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"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>destination</key> | |
| <string>upload</string> | |
| <key>method</key> | |
| <string>app-store</string> | |
| <key>provisioningProfiles</key> | |
| <dict> |
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 NSAttributedString { | |
| func bold(range: NSRange) -> NSAttributedString { | |
| let mutableAttributedString = NSMutableAttributedString(attributedString: self) | |
| mutableAttributedString.beginEditing() | |
| // option .longestEffectiveRangeNotRequired (we need to look over all attributes in range.) | |
| self.enumerateAttribute(.font, in: range, options: .longestEffectiveRangeNotRequired) { (value, r, stop) in | |
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 UIView { | |
| var isVisible: Bool { | |
| set { | |
| self.isHidden = !newValue | |
| } | |
| get { | |
| return !self.isHidden | |
| } | |
| } | |
| } |