commit 34cc49481564385095244cefb41539a1d47ecf48 Author: Dmitrii Ivanov Date: Tue Jul 21 12:29:54 2020 +0200 initial diff --git a/AppStoreReviews.xcodeproj/project.pbxproj b/AppStoreReviews.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b8355af --- /dev/null +++ b/AppStoreReviews.xcodeproj/project.pbxproj @@ -0,0 +1,337 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 345AD11C24C6EDD9004E2EE1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD11B24C6EDD9004E2EE1 /* AppDelegate.swift */; }; + 345AD12524C6EDDC004E2EE1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 345AD12424C6EDDC004E2EE1 /* Assets.xcassets */; }; + 345AD12824C6EDDC004E2EE1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 345AD12624C6EDDC004E2EE1 /* LaunchScreen.storyboard */; }; + 345AD13324C6EE64004E2EE1 /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */; }; + 345AD13424C6EE64004E2EE1 /* ReviewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13024C6EE64004E2EE1 /* ReviewCell.swift */; }; + 345AD13524C6EE64004E2EE1 /* Review.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13124C6EE64004E2EE1 /* Review.swift */; }; + 345AD13624C6EE64004E2EE1 /* DetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 345AD11824C6EDD9004E2EE1 /* AppStoreReviews.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AppStoreReviews.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 345AD11B24C6EDD9004E2EE1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 345AD12424C6EDDC004E2EE1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 345AD12724C6EDDC004E2EE1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 345AD12924C6EDDC004E2EE1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = ""; }; + 345AD13024C6EE64004E2EE1 /* ReviewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReviewCell.swift; sourceTree = ""; }; + 345AD13124C6EE64004E2EE1 /* Review.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Review.swift; sourceTree = ""; }; + 345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailsViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 345AD11524C6EDD9004E2EE1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 345AD10F24C6EDD9004E2EE1 = { + isa = PBXGroup; + children = ( + 345AD11A24C6EDD9004E2EE1 /* AppStoreReviews */, + 345AD11924C6EDD9004E2EE1 /* Products */, + ); + sourceTree = ""; + }; + 345AD11924C6EDD9004E2EE1 /* Products */ = { + isa = PBXGroup; + children = ( + 345AD11824C6EDD9004E2EE1 /* AppStoreReviews.app */, + ); + name = Products; + sourceTree = ""; + }; + 345AD11A24C6EDD9004E2EE1 /* AppStoreReviews */ = { + isa = PBXGroup; + children = ( + 345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */, + 345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */, + 345AD13124C6EE64004E2EE1 /* Review.swift */, + 345AD13024C6EE64004E2EE1 /* ReviewCell.swift */, + 345AD11B24C6EDD9004E2EE1 /* AppDelegate.swift */, + 345AD12424C6EDDC004E2EE1 /* Assets.xcassets */, + 345AD12624C6EDDC004E2EE1 /* LaunchScreen.storyboard */, + 345AD12924C6EDDC004E2EE1 /* Info.plist */, + ); + path = AppStoreReviews; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 345AD11724C6EDD9004E2EE1 /* AppStoreReviews */ = { + isa = PBXNativeTarget; + buildConfigurationList = 345AD12C24C6EDDC004E2EE1 /* Build configuration list for PBXNativeTarget "AppStoreReviews" */; + buildPhases = ( + 345AD11424C6EDD9004E2EE1 /* Sources */, + 345AD11524C6EDD9004E2EE1 /* Frameworks */, + 345AD11624C6EDD9004E2EE1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AppStoreReviews; + productName = AppStoreReviews; + productReference = 345AD11824C6EDD9004E2EE1 /* AppStoreReviews.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 345AD11024C6EDD9004E2EE1 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1160; + LastUpgradeCheck = 1160; + ORGANIZATIONNAME = ING; + TargetAttributes = { + 345AD11724C6EDD9004E2EE1 = { + CreatedOnToolsVersion = 11.6; + }; + }; + }; + buildConfigurationList = 345AD11324C6EDD9004E2EE1 /* Build configuration list for PBXProject "AppStoreReviews" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 345AD10F24C6EDD9004E2EE1; + productRefGroup = 345AD11924C6EDD9004E2EE1 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 345AD11724C6EDD9004E2EE1 /* AppStoreReviews */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 345AD11624C6EDD9004E2EE1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 345AD12824C6EDDC004E2EE1 /* LaunchScreen.storyboard in Resources */, + 345AD12524C6EDDC004E2EE1 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 345AD11424C6EDD9004E2EE1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 345AD13524C6EE64004E2EE1 /* Review.swift in Sources */, + 345AD13424C6EE64004E2EE1 /* ReviewCell.swift in Sources */, + 345AD13324C6EE64004E2EE1 /* FeedViewController.swift in Sources */, + 345AD11C24C6EDD9004E2EE1 /* AppDelegate.swift in Sources */, + 345AD13624C6EE64004E2EE1 /* DetailsViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 345AD12624C6EDDC004E2EE1 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 345AD12724C6EDDC004E2EE1 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 345AD12A24C6EDDC004E2EE1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + 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_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; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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 = 13.6; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 345AD12B24C6EDDC004E2EE1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + 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_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; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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 = 13.6; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 345AD12D24C6EDDC004E2EE1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = AppStoreReviews/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.ing.AppStoreReviews; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 345AD12E24C6EDDC004E2EE1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = AppStoreReviews/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.ing.AppStoreReviews; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 345AD11324C6EDD9004E2EE1 /* Build configuration list for PBXProject "AppStoreReviews" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 345AD12A24C6EDDC004E2EE1 /* Debug */, + 345AD12B24C6EDDC004E2EE1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 345AD12C24C6EDDC004E2EE1 /* Build configuration list for PBXNativeTarget "AppStoreReviews" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 345AD12D24C6EDDC004E2EE1 /* Debug */, + 345AD12E24C6EDDC004E2EE1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 345AD11024C6EDD9004E2EE1 /* Project object */; +} diff --git a/AppStoreReviews.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/AppStoreReviews.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..967a192 --- /dev/null +++ b/AppStoreReviews.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/AppStoreReviews.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/AppStoreReviews.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/AppStoreReviews.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/AppStoreReviews.xcodeproj/project.xcworkspace/xcuserdata/un39nv.xcuserdatad/UserInterfaceState.xcuserstate b/AppStoreReviews.xcodeproj/project.xcworkspace/xcuserdata/un39nv.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..cf7e105 Binary files /dev/null and b/AppStoreReviews.xcodeproj/project.xcworkspace/xcuserdata/un39nv.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/AppStoreReviews.xcodeproj/xcuserdata/un39nv.xcuserdatad/xcschemes/xcschememanagement.plist b/AppStoreReviews.xcodeproj/xcuserdata/un39nv.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..98f21b6 --- /dev/null +++ b/AppStoreReviews.xcodeproj/xcuserdata/un39nv.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + AppStoreReviews.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/AppStoreReviews/AppDelegate.swift b/AppStoreReviews/AppDelegate.swift new file mode 100644 index 0000000..426c7ec --- /dev/null +++ b/AppStoreReviews/AppDelegate.swift @@ -0,0 +1,24 @@ +// +// AppDelegate.swift +// AppStoreReviews +// +// Created by Dmitrii Ivanov on 21/07/2020. +// Copyright © 2020 ING. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + window = UIWindow(frame: UIScreen.main.bounds) + let viewController = FeedViewController() + window?.rootViewController = UINavigationController(rootViewController: viewController) + window?.makeKeyAndVisible() + return true + } +} + diff --git a/AppStoreReviews/Assets.xcassets/AppIcon.appiconset/Contents.json b/AppStoreReviews/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/AppStoreReviews/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AppStoreReviews/Assets.xcassets/Contents.json b/AppStoreReviews/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/AppStoreReviews/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/AppStoreReviews/Base.lproj/LaunchScreen.storyboard b/AppStoreReviews/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/AppStoreReviews/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AppStoreReviews/DetailsViewController.swift b/AppStoreReviews/DetailsViewController.swift new file mode 100644 index 0000000..800a7d1 --- /dev/null +++ b/AppStoreReviews/DetailsViewController.swift @@ -0,0 +1,79 @@ +// +// AppDelegate.swift +// AppStoreReviews +// +// Created by Dmitrii Ivanov on 21/07/2020. +// Copyright © 2020 ING. All rights reserved. +// + +import UIKit + +class DetailsViewController: UIViewController { + + private let review: Review + + private var titleLabel = UILabel() + private var authorLabel = UILabel() + private var contentLabel = UILabel() + private var ratingVersionLabel = UILabel() + + init(review: Review) { + self.review = review + super.init(nibName: nil, bundle: nil) + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = UIColor.white + setupViews() + } + + func setupViews() { + titleLabel.translatesAutoresizingMaskIntoConstraints = false + authorLabel.translatesAutoresizingMaskIntoConstraints = false + contentLabel.translatesAutoresizingMaskIntoConstraints = false + ratingVersionLabel.translatesAutoresizingMaskIntoConstraints = false + + view.addSubview(ratingVersionLabel) + view.addSubview(authorLabel) + view.addSubview(titleLabel) + view.addSubview(contentLabel) + + ratingVersionLabel.text = review.ratingVersionText() + ratingVersionLabel.font = UIFont.italicSystemFont(ofSize: 18) + + authorLabel.text = review.author + authorLabel.font = UIFont.systemFont(ofSize: 18) + + titleLabel.text = review.title + titleLabel.numberOfLines = 0 + titleLabel.font = UIFont.boldSystemFont(ofSize: 22) + + contentLabel.text = review.content + contentLabel.numberOfLines = 0 + + ratingVersionLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 8).isActive = true + ratingVersionLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -8).isActive = true + ratingVersionLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 8).isActive = true + ratingVersionLabel.heightAnchor.constraint(equalToConstant: 24).isActive = true + + authorLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 8).isActive = true + authorLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -8).isActive = true + authorLabel.topAnchor.constraint(equalTo: ratingVersionLabel.bottomAnchor, constant: 8).isActive = true + authorLabel.heightAnchor.constraint(equalToConstant: 24).isActive = true + + titleLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 8).isActive = true + titleLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -8).isActive = true + titleLabel.topAnchor.constraint(equalTo: authorLabel.bottomAnchor, constant: 8).isActive = true + titleLabel.heightAnchor.constraint(lessThanOrEqualToConstant: 72).isActive = true + + contentLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 8).isActive = true + contentLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -8).isActive = true + contentLabel.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 8).isActive = true + contentLabel.heightAnchor.constraint(greaterThanOrEqualToConstant: 24).isActive = true + } +} diff --git a/AppStoreReviews/FeedViewController.swift b/AppStoreReviews/FeedViewController.swift new file mode 100644 index 0000000..ccbc496 --- /dev/null +++ b/AppStoreReviews/FeedViewController.swift @@ -0,0 +1,50 @@ +// +// AppDelegate.swift +// AppStoreReviews +// +// Created by Dmitrii Ivanov on 21/07/2020. +// Copyright © 2020 ING. All rights reserved. +// + +import UIKit + +class FeedViewController: UITableViewController { + + override func viewDidLoad() { + super.viewDidLoad() + tableView.register(ReviewCell.self, forCellReuseIdentifier: "cellId") + tableView.rowHeight = 160 + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 100 + } + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let c = tableView.dequeueReusableCell(withIdentifier: "cellId", for: indexPath) as! ReviewCell + c.update(item: randomReview()) + return c + } + + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + let vc = DetailsViewController(review: randomReview()) + navigationController!.pushViewController(vc, animated: true) + } + + func randomReview() -> Review { + let author = ["Dan Auerbach", "Bo Diddley", "Otis Rush", "Jimi Hendrix", "Albert King", "Buddy Guy", "Muddy Waters", "Eric Clapton"].randomElement()! + let version = ["3.11", "3.12"].randomElement()! + let rating = Int.random(in: 1...5) + let title = ["Awesome app", "Could be better", "Gimme my money back!!", "Lemme tell you a story..."].randomElement()! + let id = UUID().uuidString + let content = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + return Review(author: author, + version: version, + rating: rating, + title: title, + id: id, + content: content) + } +} + diff --git a/AppStoreReviews/Info.plist b/AppStoreReviews/Info.plist new file mode 100644 index 0000000..5a63475 --- /dev/null +++ b/AppStoreReviews/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/AppStoreReviews/Review.swift b/AppStoreReviews/Review.swift new file mode 100644 index 0000000..d83086c --- /dev/null +++ b/AppStoreReviews/Review.swift @@ -0,0 +1,26 @@ +// +// AppDelegate.swift +// AppStoreReviews +// +// Created by Dmitrii Ivanov on 21/07/2020. +// Copyright © 2020 ING. All rights reserved. +// + +import Foundation + +struct Review { + let author: String + let version: String + let rating: Int + let title: String + let id: String + let content: String + + func ratingVersionText() -> String { + var stars = "" + for _ in 0..