diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5440ce8 --- /dev/null +++ b/Example/Example.xcodeproj/project.pbxproj @@ -0,0 +1,378 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 60; + objects = { + +/* Begin PBXBuildFile section */ + 94769E982BCBF9C500747FCA /* ExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94769E972BCBF9C500747FCA /* ExampleApp.swift */; }; + 94769E9A2BCBF9C500747FCA /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94769E992BCBF9C500747FCA /* ContentView.swift */; }; + 94769E9C2BCBF9C700747FCA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 94769E9B2BCBF9C700747FCA /* Assets.xcassets */; }; + 94769E9F2BCBF9C700747FCA /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 94769E9E2BCBF9C700747FCA /* Preview Assets.xcassets */; }; + 94769EA72BCBF9DE00747FCA /* LoremSwiftify in Frameworks */ = {isa = PBXBuildFile; productRef = 94769EA62BCBF9DE00747FCA /* LoremSwiftify */; }; + 94769EA92BCBF9DE00747FCA /* LoremSwiftifyClient in Frameworks */ = {isa = PBXBuildFile; productRef = 94769EA82BCBF9DE00747FCA /* LoremSwiftifyClient */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 94769E942BCBF9C500747FCA /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 94769E972BCBF9C500747FCA /* ExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleApp.swift; sourceTree = ""; }; + 94769E992BCBF9C500747FCA /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 94769E9B2BCBF9C700747FCA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 94769E9E2BCBF9C700747FCA /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 94769E912BCBF9C500747FCA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 94769EA92BCBF9DE00747FCA /* LoremSwiftifyClient in Frameworks */, + 94769EA72BCBF9DE00747FCA /* LoremSwiftify in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 94769E8B2BCBF9C500747FCA = { + isa = PBXGroup; + children = ( + 94769E962BCBF9C500747FCA /* Example */, + 94769E952BCBF9C500747FCA /* Products */, + ); + sourceTree = ""; + }; + 94769E952BCBF9C500747FCA /* Products */ = { + isa = PBXGroup; + children = ( + 94769E942BCBF9C500747FCA /* Example.app */, + ); + name = Products; + sourceTree = ""; + }; + 94769E962BCBF9C500747FCA /* Example */ = { + isa = PBXGroup; + children = ( + 94769E972BCBF9C500747FCA /* ExampleApp.swift */, + 94769E992BCBF9C500747FCA /* ContentView.swift */, + 94769E9B2BCBF9C700747FCA /* Assets.xcassets */, + 94769E9D2BCBF9C700747FCA /* Preview Content */, + ); + path = Example; + sourceTree = ""; + }; + 94769E9D2BCBF9C700747FCA /* Preview Content */ = { + isa = PBXGroup; + children = ( + 94769E9E2BCBF9C700747FCA /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 94769E932BCBF9C500747FCA /* Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 94769EA22BCBF9C700747FCA /* Build configuration list for PBXNativeTarget "Example" */; + buildPhases = ( + 94769E902BCBF9C500747FCA /* Sources */, + 94769E912BCBF9C500747FCA /* Frameworks */, + 94769E922BCBF9C500747FCA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Example; + packageProductDependencies = ( + 94769EA62BCBF9DE00747FCA /* LoremSwiftify */, + 94769EA82BCBF9DE00747FCA /* LoremSwiftifyClient */, + ); + productName = Example; + productReference = 94769E942BCBF9C500747FCA /* Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 94769E8C2BCBF9C500747FCA /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1520; + LastUpgradeCheck = 1520; + TargetAttributes = { + 94769E932BCBF9C500747FCA = { + CreatedOnToolsVersion = 15.2; + }; + }; + }; + buildConfigurationList = 94769E8F2BCBF9C500747FCA /* Build configuration list for PBXProject "Example" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 94769E8B2BCBF9C500747FCA; + packageReferences = ( + 94769EA52BCBF9DE00747FCA /* XCLocalSwiftPackageReference ".." */, + ); + productRefGroup = 94769E952BCBF9C500747FCA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 94769E932BCBF9C500747FCA /* Example */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 94769E922BCBF9C500747FCA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 94769E9F2BCBF9C700747FCA /* Preview Assets.xcassets in Resources */, + 94769E9C2BCBF9C700747FCA /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 94769E902BCBF9C500747FCA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 94769E9A2BCBF9C500747FCA /* ContentView.swift in Sources */, + 94769E982BCBF9C500747FCA /* ExampleApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 94769EA02BCBF9C700747FCA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 94769EA12BCBF9C700747FCA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 94769EA32BCBF9C700747FCA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\""; + DEVELOPMENT_TEAM = L9DND36YTU; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.eneskaraosman.Example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 94769EA42BCBF9C700747FCA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\""; + DEVELOPMENT_TEAM = L9DND36YTU; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.eneskaraosman.Example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 94769E8F2BCBF9C500747FCA /* Build configuration list for PBXProject "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 94769EA02BCBF9C700747FCA /* Debug */, + 94769EA12BCBF9C700747FCA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 94769EA22BCBF9C700747FCA /* Build configuration list for PBXNativeTarget "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 94769EA32BCBF9C700747FCA /* Debug */, + 94769EA42BCBF9C700747FCA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 94769EA52BCBF9DE00747FCA /* XCLocalSwiftPackageReference ".." */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ..; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 94769EA62BCBF9DE00747FCA /* LoremSwiftify */ = { + isa = XCSwiftPackageProductDependency; + productName = LoremSwiftify; + }; + 94769EA82BCBF9DE00747FCA /* LoremSwiftifyClient */ = { + isa = XCSwiftPackageProductDependency; + productName = LoremSwiftifyClient; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 94769E8C2BCBF9C500747FCA /* Project object */; +} diff --git a/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..3fdaa03 --- /dev/null +++ b/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,23 @@ +{ + "pins" : [ + { + "identity" : "fakery", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vadymmarkov/Fakery", + "state" : { + "revision" : "71cb3bf36a808534659d1248780c2bf3c4c4fc91", + "version" : "5.1.0" + } + }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-syntax.git", + "state" : { + "revision" : "fa8f95c2d536d6620cc2f504ebe8a6167c9fc2dd", + "version" : "510.0.1" + } + } + ], + "version" : 2 +} diff --git a/Example/Example/Assets.xcassets/AccentColor.colorset/Contents.json b/Example/Example/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/Example/Example/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example/Assets.xcassets/Contents.json b/Example/Example/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/Example/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example/ContentView.swift b/Example/Example/ContentView.swift new file mode 100644 index 0000000..7fd364d --- /dev/null +++ b/Example/Example/ContentView.swift @@ -0,0 +1,95 @@ +// +// ContentView.swift +// Example +// +// Created by Enes Karaosman on 14.04.2024. +// + +import LoremSwiftify +import SwiftUI + +struct ContentView: View { + let display: ContentView.Display + + var body: some View { + ScrollView { + VStack(alignment: .leading) { + ForEach(display.developers) { developer in + itemView(developer) + } + } + .padding() + } + } + + private func itemView(_ developer: Display.Developer) -> some View { + HStack { + AsyncImage( + url: developer.imageURL, + content: { image in + image + .resizable() + .aspectRatio(contentMode: .fit) + }, + placeholder: { + Color.gray + .frame(width: 80, height: 80) + .overlay { + ProgressView() + .progressViewStyle(CircularProgressViewStyle(tint: .white)) + } + } + ) + .frame(width: 80) + .mask(RoundedRectangle(cornerRadius: 16)) + + VStack(alignment: .leading) { + Text(developer.name) + Text(developer.email) + .font(.footnote) + .foregroundStyle(.gray) + } + + Spacer() + + Image(systemName: "chevron.right") + } + .frame(maxWidth: .infinity, alignment: .leading) + .padding() + .overlay( + RoundedRectangle(cornerRadius: 8) + .stroke(.gray, lineWidth: 1) + ) + .onTapGesture { + print(developer.profileURL) + } + } +} + +extension ContentView { + @LoremSwiftify + struct Display { + let developers: [Developer] + + @LoremSwiftify + struct Developer: Identifiable { + let id: String = UUID().uuidString + + @Lorem(.string(.name)) + let name: String + + @Lorem(.string(.email)) + let email: String + + @Lorem(.url(.image)) + let imageURL: URL + + @Lorem(.url(.website)) + let profileURL: URL + } + } +} + +#Preview { + ContentView(display: .lorem()) +} diff --git a/Example/Example/ExampleApp.swift b/Example/Example/ExampleApp.swift new file mode 100644 index 0000000..cf76725 --- /dev/null +++ b/Example/Example/ExampleApp.swift @@ -0,0 +1,17 @@ +// +// ExampleApp.swift +// Example +// +// Created by Enes Karaosman on 14.04.2024. +// + +import SwiftUI + +@main +struct ExampleApp: App { + var body: some Scene { + WindowGroup { + ContentView(display: .lorem()) + } + } +} diff --git a/Example/Example/Preview Content/Preview Assets.xcassets/Contents.json b/Example/Example/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/Example/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Readme.md b/Readme.md index 98e3d4b..b0f6be4 100644 --- a/Readme.md +++ b/Readme.md @@ -18,10 +18,8 @@ - [X] Color - [X] Custom types supported if it's annotated with macro or confirms `LoremIpsumize` protocol - [ ] Add #if DEBUG -- [ ] Create Example SwiftUI project to demonstrate package usage for previews -- [ ] Provide a way to customize lorem in different categories (like creditCard, phoneNumber, name, price etc..) - - [X] Handle for auto generated init - - [ ] Handle for existing init +- [X] Create Example SwiftUI project to demonstrate package usage for previews +- [X] Provide a way to customize lorem in different categories (like creditCard, phoneNumber, name, price etc..) (works for auto generated init) - [ ] Provide a way to customize loreming for the supported built-in types (to completely determine what to receive for the lorem data) - [ ] Improve diagnostic - [ ] Implement unit test