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
// Container View | |
struct SomeView: View { | |
var body: some View { | |
VStack { | |
Text("Welcome to our SwiftUI app") | |
.companyStyled() | |
FeaturedContentView() | |
ArticlesScrollView() | |
FooterView() | |
} |
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
// Container View | |
struct SomeView: View { | |
var body: some View { | |
VStack { | |
Text("Welcome to our SwiftUI app") | |
.modifier(CompanyHeaderLabel()) | |
FeaturedContentView() | |
ArticlesScrollView() | |
FooterView() | |
} |
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
// Container View | |
struct SomeView: View { | |
var body: some View { | |
VStack { | |
Text("Welcome to our SwiftUI app") | |
.font(.custom("Montserrat-Bold", size: 16)) | |
.foregroundColor(.textBlack) | |
.padding() | |
FeaturedContentView() | |
ArticlesScrollView() |
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
// New View | |
struct PodcastScrollView: View { | |
var content: [Podcast] | |
var body: some View { | |
ScrollView(.horizontal) { | |
HStack { | |
ForEach(content, id: \.self) { _ in | |
RoundedRectangle(cornerRadius: 22, style: .continuous) | |
.foregroundColor(Color.blue) |
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 HomeView: View { | |
let featuredPodcasts: [Podcast] | |
let popularPodcasts: [Podcast] | |
let yourPodcasts: [Podcast] | |
var body: some View { | |
NavigationView { | |
VStack(alignment: .leading) { | |
Text("Welcome to SwiftUI") |
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 UIKit | |
@propertyWrapper | |
class ImageDownloading { | |
var wrappedValue: UIImageView | |
private var cancellable: AnyCancellable? | |
init(wrappedValue: UIImageView, url: URL?, urlSession: URLSession) { | |
self.wrappedValue = wrappedValue |
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 | |
@propertyWrapper class Card { | |
var wrappedValue: UIView | |
init(wrappedValue: UIView) { | |
self.wrappedValue = wrappedValue | |
applyCornerRadius() | |
applyCardShadow() | |
} |
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
@propertyWrapper | |
class Title { | |
var wrappedValue: UILabel | |
init(text: String) { | |
self.wrappedValue = UILabel() | |
wrappedValue.text = text | |
configureLabel() | |
} | |
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
@propertyWrapper | |
struct Ubiquitous<T> { | |
private var key: String | |
private var defaultValue: T | |
private var store: NSUbiquitousKeyValueStore | |
init(key: String, defaultValue: T, store: NSUbiquitousKeyValueStore = .default) { | |
self.key = key | |
self.defaultValue = defaultValue | |
self.store = store |
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 CoreData | |
@propertyWrapper | |
class Fetched<Object: NSManagedObject>: NSObject, NSFetchedResultsControllerDelegate { | |
private var _fetchedResultsController: NSFetchedResultsController<Object>? | |
var wrappedValue: [Object] = [] | |
init(context: NSManagedObjectContext = CoreDataService.context, sortDescriptiors: [NSSortDescriptor] = [], predicate: NSPredicate? = nil) { | |
super.init() | |
// Setup a fetch request |