Initial commit

This commit is contained in:
deytenit committed 2024-11-08 14:06:05 +03:00
commit 089b832b92
18 files changed
+1029

No files matched your search

+64
View File
@@ -0,0 +1,64 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## User settings
xcuserdata/
## Obj-C/Swift specific
*.hmap
## App packaging
*.ipa
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace
.DS_Store
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build/
# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output
+416
View File
@@ -0,0 +1,416 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objects = {
/* Begin PBXBuildFile section */
AA3266FE2CDD578E00C18C6B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3266FD2CDD578E00C18C6B /* AppDelegate.swift */; };
AA3267002CDD578E00C18C6B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3266FF2CDD578E00C18C6B /* SceneDelegate.swift */; };
AA3267072CDD578F00C18C6B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AA3267062CDD578F00C18C6B /* Assets.xcassets */; };
AA32670A2CDD578F00C18C6B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA3267082CDD578F00C18C6B /* LaunchScreen.storyboard */; };
AAAF65B12CDD65050097F550 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AAAF65B02CDD65050097F550 /* Main.storyboard */; };
AAAF65B32CDD653C0097F550 /* TextedCat.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AAAF65B22CDD653C0097F550 /* TextedCat.storyboard */; };
AAAF65B62CDD6ECA0097F550 /* Fetch.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAAF65B52CDD6ECA0097F550 /* Fetch.swift */; };
AAE5824D2CDD635E0078BB7D /* PlainCat.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AAE5824C2CDD635E0078BB7D /* PlainCat.storyboard */; };
AAE5824F2CDD63970078BB7D /* TextedCatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE5824E2CDD63970078BB7D /* TextedCatViewController.swift */; };
AAE582512CDD63F00078BB7D /* PlainCatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE582502CDD63F00078BB7D /* PlainCatViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
AA3266FA2CDD578E00C18C6B /* iCat.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iCat.app; sourceTree = BUILT_PRODUCTS_DIR; };
AA3266FD2CDD578E00C18C6B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
AA3266FF2CDD578E00C18C6B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
AA3267062CDD578F00C18C6B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
AA3267092CDD578F00C18C6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
AA32670B2CDD578F00C18C6B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
AAAF65B02CDD65050097F550 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
AAAF65B22CDD653C0097F550 /* TextedCat.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = TextedCat.storyboard; sourceTree = "<group>"; };
AAAF65B52CDD6ECA0097F550 /* Fetch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fetch.swift; sourceTree = "<group>"; };
AAE5824C2CDD635E0078BB7D /* PlainCat.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = PlainCat.storyboard; sourceTree = "<group>"; };
AAE5824E2CDD63970078BB7D /* TextedCatViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextedCatViewController.swift; sourceTree = "<group>"; };
AAE582502CDD63F00078BB7D /* PlainCatViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlainCatViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
AA3266F72CDD578E00C18C6B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
AA3266F12CDD578E00C18C6B = {
isa = PBXGroup;
children = (
AA3266FC2CDD578E00C18C6B /* iCat */,
AA3266FB2CDD578E00C18C6B /* Products */,
);
sourceTree = "<group>";
};
AA3266FB2CDD578E00C18C6B /* Products */ = {
isa = PBXGroup;
children = (
AA3266FA2CDD578E00C18C6B /* iCat.app */,
);
name = Products;
sourceTree = "<group>";
};
AA3266FC2CDD578E00C18C6B /* iCat */ = {
isa = PBXGroup;
children = (
AAAF65B42CDD6E3A0097F550 /* Utils */,
AA3267112CDD57AC00C18C6B /* Views */,
AA3266FD2CDD578E00C18C6B /* AppDelegate.swift */,
AA3266FF2CDD578E00C18C6B /* SceneDelegate.swift */,
AA3267062CDD578F00C18C6B /* Assets.xcassets */,
AA32670B2CDD578F00C18C6B /* Info.plist */,
);
path = iCat;
sourceTree = "<group>";
};
AA3267112CDD57AC00C18C6B /* Views */ = {
isa = PBXGroup;
children = (
AAE582492CDD63420078BB7D /* TextedCat */,
AAE582482CDD60200078BB7D /* PlainCat */,
AAE582472CDD5F700078BB7D /* Main */,
AA3267082CDD578F00C18C6B /* LaunchScreen.storyboard */,
);
path = Views;
sourceTree = "<group>";
};
AAAF65B42CDD6E3A0097F550 /* Utils */ = {
isa = PBXGroup;
children = (
AAAF65B52CDD6ECA0097F550 /* Fetch.swift */,
);
path = Utils;
sourceTree = "<group>";
};
AAE582472CDD5F700078BB7D /* Main */ = {
isa = PBXGroup;
children = (
AAAF65B02CDD65050097F550 /* Main.storyboard */,
);
path = Main;
sourceTree = "<group>";
};
AAE582482CDD60200078BB7D /* PlainCat */ = {
isa = PBXGroup;
children = (
AAE5824C2CDD635E0078BB7D /* PlainCat.storyboard */,
AAE582502CDD63F00078BB7D /* PlainCatViewController.swift */,
);
path = PlainCat;
sourceTree = "<group>";
};
AAE582492CDD63420078BB7D /* TextedCat */ = {
isa = PBXGroup;
children = (
AAAF65B22CDD653C0097F550 /* TextedCat.storyboard */,
AAE5824E2CDD63970078BB7D /* TextedCatViewController.swift */,
);
path = TextedCat;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
AA3266F92CDD578E00C18C6B /* iCat */ = {
isa = PBXNativeTarget;
buildConfigurationList = AA32670E2CDD578F00C18C6B /* Build configuration list for PBXNativeTarget "iCat" */;
buildPhases = (
AA3266F62CDD578E00C18C6B /* Sources */,
AA3266F72CDD578E00C18C6B /* Frameworks */,
AA3266F82CDD578E00C18C6B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = iCat;
productName = CatProject;
productReference = AA3266FA2CDD578E00C18C6B /* iCat.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
AA3266F22CDD578E00C18C6B /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1520;
LastUpgradeCheck = 1520;
TargetAttributes = {
AA3266F92CDD578E00C18C6B = {
CreatedOnToolsVersion = 15.2;
};
};
};
buildConfigurationList = AA3266F52CDD578E00C18C6B /* Build configuration list for PBXProject "iCat" */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = AA3266F12CDD578E00C18C6B;
productRefGroup = AA3266FB2CDD578E00C18C6B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
AA3266F92CDD578E00C18C6B /* iCat */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
AA3266F82CDD578E00C18C6B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AA32670A2CDD578F00C18C6B /* LaunchScreen.storyboard in Resources */,
AAAF65B32CDD653C0097F550 /* TextedCat.storyboard in Resources */,
AAAF65B12CDD65050097F550 /* Main.storyboard in Resources */,
AAE5824D2CDD635E0078BB7D /* PlainCat.storyboard in Resources */,
AA3267072CDD578F00C18C6B /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
AA3266F62CDD578E00C18C6B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AAAF65B62CDD6ECA0097F550 /* Fetch.swift in Sources */,
AAE5824F2CDD63970078BB7D /* TextedCatViewController.swift in Sources */,
AAE582512CDD63F00078BB7D /* PlainCatViewController.swift in Sources */,
AA3266FE2CDD578E00C18C6B /* AppDelegate.swift in Sources */,
AA3267002CDD578E00C18C6B /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
AA3267082CDD578F00C18C6B /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
AA3267092CDD578F00C18C6B /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
AA32670C2CDD578F00C18C6B /* 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;
};
AA32670D2CDD578F00C18C6B /* 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;
};
AA32670F2CDD578F00C18C6B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = iCat/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
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.ermnvldmr.iCat;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
AA3267102CDD578F00C18C6B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = iCat/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
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.ermnvldmr.iCat;
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 */
AA3266F52CDD578E00C18C6B /* Build configuration list for PBXProject "iCat" */ = {
isa = XCConfigurationList;
buildConfigurations = (
AA32670C2CDD578F00C18C6B /* Debug */,
AA32670D2CDD578F00C18C6B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
AA32670E2CDD578F00C18C6B /* Build configuration list for PBXNativeTarget "iCat" */ = {
isa = XCConfigurationList;
buildConfigurations = (
AA32670F2CDD578F00C18C6B /* Debug */,
AA3267102CDD578F00C18C6B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = AA3266F22CDD578E00C18C6B /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:/Users/deytenit/Source/CatProject/iCat.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
+33
View File
@@ -0,0 +1,33 @@
//
// AppDelegate.swift
// CatProject
//
// Created by Vladimir Eremin on 11/7/24.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
+25
View File
@@ -0,0 +1,25 @@
<?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>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
+52
View File
@@ -0,0 +1,52 @@
//
// SceneDelegate.swift
// CatProject
//
// Created by Vladimir Eremin on 11/7/24.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
+27
View File
@@ -0,0 +1,27 @@
//
// Fetch.swift
// CatProject
//
// Created by Vladimir Eremin on 11/8/24.
//
import Foundation
func fetchCat(text: String? = nil, completion: @escaping (Data?) -> Void) {
let urlString = text != nil && !text!.isEmpty
? "https://cataas.com/cat/says/\(text!)?fontSize=50&fontColor=white"
: "https://cataas.com/cat"
guard let url = URL(string: urlString) else {
completion(nil)
return
}
let task = URLSession.shared.dataTask(with: url) { data, _, _ in
DispatchQueue.main.async {
completion(data)
}
}
task.resume()
}
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" userInteractionEnabled="NO" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="iCat" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zRW-ua-GuZ">
<rect key="frame" x="168" y="490" width="56" height="39"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="32"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="cat.circle.fill" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="eqY-HK-raY">
<rect key="frame" x="76" y="362" width="240" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="cat.circle.fill" catalog="system" width="128" height="123"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="rSG-eE-egy">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Item 2-->
<scene sceneID="ud7-A7-u2c">
<objects>
<viewController id="w9Y-F0-AhB" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="wNt-y8-8Ar">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="Vgv-h5-RyB"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<tabBarItem key="tabBarItem" title="Item 2" id="DqF-bg-8y7"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ZDq-I0-BTd" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="303" y="602"/>
</scene>
<!--Item 1-->
<scene sceneID="gPv-2Y-W91">
<objects>
<viewController id="a2m-3o-dxR" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="QhV-gi-NCK">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="bUu-Yq-y1z"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<tabBarItem key="tabBarItem" title="Item 1" id="aOo-EU-l3f"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ztw-wy-LYJ" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="390" y="-75"/>
</scene>
<!--Tab Bar Controller-->
<scene sceneID="b9S-nL-Cfa">
<objects>
<tabBarController id="rSG-eE-egy" sceneMemberID="viewController">
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="3Ka-oD-Hfe">
<rect key="frame" x="0.0" y="0.0" width="393" height="49"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tabBar>
<connections>
<segue destination="a2m-3o-dxR" kind="relationship" relationship="viewControllers" id="HuQ-d9-K2A"/>
<segue destination="w9Y-F0-AhB" kind="relationship" relationship="viewControllers" id="Df7-MC-PCE"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="noW-uH-VaM" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-602" y="299"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
+57
View File
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="dMV-MK-ShB">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--TextedCatSB-->
<scene sceneID="7L9-u0-V3n">
<objects>
<viewControllerPlaceholder storyboardName="TextedCat" referencedIdentifier="TextedCatSB" id="mFO-sS-LTI" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Texted Cat" id="B8P-Im-otw">
<imageReference key="image" image="textformat.size.larger" catalog="system" symbolScale="large"/>
</tabBarItem>
</viewControllerPlaceholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="9Wa-Im-5eA" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="98" y="-23"/>
</scene>
<!--PlainCatSB-->
<scene sceneID="5tq-y9-Frt">
<objects>
<viewControllerPlaceholder storyboardName="PlainCat" referencedIdentifier="PlainCatSB" id="bhy-Sv-Agw" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Plain Cat" id="ZVs-LL-eMI">
<imageReference key="image" image="cat.fill" catalog="system" symbolScale="medium"/>
</tabBarItem>
</viewControllerPlaceholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="JvS-LQ-dNq" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="90" y="-394"/>
</scene>
<!--Tab Bar Controller-->
<scene sceneID="IOk-6E-mOa">
<objects>
<tabBarController id="dMV-MK-ShB" sceneMemberID="viewController">
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="ub9-a4-FLg">
<rect key="frame" x="0.0" y="0.0" width="393" height="49"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tabBar>
<connections>
<segue destination="bhy-Sv-Agw" kind="relationship" relationship="viewControllers" id="frb-QC-y78"/>
<segue destination="mFO-sS-LTI" kind="relationship" relationship="viewControllers" id="Tvh-eD-KRH"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="GEX-M2-b4l" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-756" y="-195"/>
</scene>
</scenes>
<resources>
<image name="cat.fill" catalog="system" width="128" height="102"/>
<image name="textformat.size.larger" catalog="system" width="128" height="128"/>
</resources>
</document>
+57
View File
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Plain Cat-->
<scene sceneID="s0d-6b-0kx">
<objects>
<viewController storyboardIdentifier="PlainCatSB" id="Y6W-OH-hqX" customClass="PlainCatViewController" customModule="iCat" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zzh-zw-sHL">
<rect key="frame" x="16" y="80" width="361" height="361"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wR5-y4-xRc">
<rect key="frame" x="134" y="596" width="125" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="Generate Cat"/>
<connections>
<action selector="generateCatTouchUpInside:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="Uhg-SZ-eZ4"/>
</connections>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<tabBarItem key="tabBarItem" title="Plain Cat" id="P2F-5r-9eC">
<imageReference key="image" image="cat.fill" catalog="system" symbolScale="medium"/>
</tabBarItem>
<simulatedTabBarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="generateCatButton" destination="wR5-y4-xRc" id="v6v-Ih-SXM"/>
<outlet property="plainCatImageView" destination="Zzh-zw-sHL" id="A2p-wQ-P5j"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="54.198473282442748" y="-34.507042253521128"/>
</scene>
</scenes>
<resources>
<image name="cat.fill" catalog="system" width="128" height="102"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
@@ -0,0 +1,33 @@
//
// PlainCatViewController.swift
// CatProject
//
// Created by Vladimir Eremin on 11/8/24.
//
import UIKit
class PlainCatViewController: UIViewController {
@IBOutlet weak var plainCatImageView: UIImageView!
@IBOutlet weak var generateCatButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func generateCatTouchUpInside(_ sender: UIButton) {
generateCatButton.isEnabled = false
fetchCat { [weak self] data in
guard let self = self else { return }
self.generateCatButton.isEnabled = true
if let data = data, let image = UIImage(data: data) {
self.plainCatImageView.image = image
} else {
self.plainCatImageView.image = UIImage(named: "Cannot load the cat")
}
}
}
}
+64
View File
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Texted Cat-->
<scene sceneID="vrp-no-BPb">
<objects>
<viewController storyboardIdentifier="TextedCatSB" id="1J8-t8-CN3" customClass="TextedCatViewController" customModule="iCat" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="zKJ-1m-E9r">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UrG-Ur-188">
<rect key="frame" x="16" y="80" width="361" height="361"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="aSh-tl-nbM">
<rect key="frame" x="16" y="502" width="361" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="UKB-ad-CHr">
<rect key="frame" x="97" y="596" width="201" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="Generate Cat With Text"/>
<connections>
<action selector="generateCatTouchUpInside:" destination="1J8-t8-CN3" eventType="touchUpInside" id="WBY-0f-nW7"/>
</connections>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="aZL-Nq-08q"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<tabBarItem key="tabBarItem" title="Texted Cat" id="4C4-6X-5Jv">
<imageReference key="image" image="textformat.size.larger" catalog="system" symbolScale="large"/>
</tabBarItem>
<simulatedTabBarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="generateCatButton" destination="UKB-ad-CHr" id="623-M0-tUI"/>
<outlet property="textedCatImageView" destination="UrG-Ur-188" id="pAZ-k0-gSF"/>
<outlet property="textedCatTextField" destination="aSh-tl-nbM" id="SS3-Ow-3PF"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="5Dk-Vu-xmg" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-90.839694656488547" y="-553.52112676056345"/>
</scene>
</scenes>
<resources>
<image name="textformat.size.larger" catalog="system" width="128" height="128"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
@@ -0,0 +1,43 @@
//
// TextedCatViewController.swift
// CatProject
//
// Created by Vladimir Eremin on 11/8/24.
//
import UIKit
class TextedCatViewController: UIViewController {
final var TEXTED_CAT_TEXT_FIELD_PLACEHOLDER = "Said nothing"
@IBOutlet weak var textedCatImageView: UIImageView!
@IBOutlet weak var textedCatTextField: UITextField!
@IBOutlet weak var generateCatButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
textedCatTextField.placeholder = TEXTED_CAT_TEXT_FIELD_PLACEHOLDER
}
@IBAction func generateCatTouchUpInside(_ sender: UIButton) {
generateCatButton.isEnabled = false
let text = textedCatTextField.text?.isEmpty == false ? textedCatTextField.text : TEXTED_CAT_TEXT_FIELD_PLACEHOLDER
fetchCat(text: text) { [weak self] data in
guard let self = self else { return }
self.generateCatButton.isEnabled = true
if let data = data, let image = UIImage(data: data) {
self.textedCatImageView.image = image
} else {
self.textedCatImageView.image = UIImage(named: "Cannot load the cat")
}
}
}
}