diff --git a/Podfile b/Podfile index d4706d2..5ae06ab 100644 --- a/Podfile +++ b/Podfile @@ -8,4 +8,5 @@ target 'SpaceDash' do # Pods for SpaceX pod 'MarqueeLabel' pod 'lottie-ios' + pod 'SnapKit' end diff --git a/Podfile.lock b/Podfile.lock index 312934c..844128c 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,20 +1,24 @@ PODS: - lottie-ios (3.1.8) - MarqueeLabel (4.0.2) + - SnapKit (5.0.1) DEPENDENCIES: - lottie-ios - MarqueeLabel + - SnapKit SPEC REPOS: trunk: - lottie-ios - MarqueeLabel + - SnapKit SPEC CHECKSUMS: lottie-ios: 48fac6be217c76937e36e340e2d09cf7b10b7f5f MarqueeLabel: f762aa681ae201f66c1d511858b171f75d83013a + SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb -PODFILE CHECKSUM: ceca5c3fa56ae640c1db8633568bd906f292243e +PODFILE CHECKSUM: af353e05b6f3fa1d359e70ed8077b68d805fa15e -COCOAPODS: 1.8.4 +COCOAPODS: 1.10.0 diff --git a/SpaceDash.xcodeproj/project.pbxproj b/SpaceDash.xcodeproj/project.pbxproj index 20e20cd..94b01c3 100644 --- a/SpaceDash.xcodeproj/project.pbxproj +++ b/SpaceDash.xcodeproj/project.pbxproj @@ -7,7 +7,22 @@ objects = { /* Begin PBXBuildFile section */ + 202CCA972580AAB600BCC0A2 /* Feed.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 202CCA962580AAB600BCC0A2 /* Feed.storyboard */; }; + 2030775F2589699A00DD1F75 /* FeedCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2030775D2589699A00DD1F75 /* FeedCell.swift */; }; + 2030776C25896B3000DD1F75 /* UIStackView+Layout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2030776B25896B3000DD1F75 /* UIStackView+Layout.swift */; }; + 2030777325896B9B00DD1F75 /* UIButton+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2030777225896B9B00DD1F75 /* UIButton+Extension.swift */; }; + 2030777A25896BBC00DD1F75 /* UILabel+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2030777925896BBC00DD1F75 /* UILabel+Extension.swift */; }; + 203077852589728200DD1F75 /* ReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 203077842589728200DD1F75 /* ReusableView.swift */; }; + 2030778C258972A300DD1F75 /* UICollectionView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2030778B258972A300DD1F75 /* UICollectionView+Extensions.swift */; }; 2086C60A16283D2DB5341A79 /* Pods_SpaceDash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DE2958EE217DA2AEF4E463F /* Pods_SpaceDash.framework */; }; + 20953C632588D7D2009ED75E /* UISegementedControl+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20953C622588D7D2009ED75E /* UISegementedControl+Extension.swift */; }; + 20953C732588D9AB009ED75E /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20953C722588D9AB009ED75E /* UIView+Extension.swift */; }; + 20953C7E2588DF7D009ED75E /* UIFont+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20953C7D2588DF7D009ED75E /* UIFont+Extension.swift */; }; + 20953C89258908F9009ED75E /* PlayfairDisplay-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 20953C7C2588DE88009ED75E /* PlayfairDisplay-Bold.ttf */; }; + 20953C8F258908FE009ED75E /* Lora-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 20953C7B2588DE59009ED75E /* Lora-Regular.ttf */; }; + 20953C9625890E12009ED75E /* NewsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20953C9525890E12009ED75E /* NewsViewController.swift */; }; + 20953C9D25890F7C009ED75E /* ArticlesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20953C9C25890F7C009ED75E /* ArticlesViewController.swift */; }; + 20A82BF5257C4BD000E7BF29 /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20A82BF4257C4BD000E7BF29 /* FeedViewController.swift */; }; FF3043D42507E5D0005F8EE6 /* FastlaneSnapshots.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3043D32507E5D0005F8EE6 /* FastlaneSnapshots.swift */; }; FF3043DC2507E615005F8EE6 /* SnapshotHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3043DB2507E615005F8EE6 /* SnapshotHelper.swift */; }; FF42E94E24CD8CA5003E8DFE /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF42E94D24CD8CA5003E8DFE /* Constants.swift */; }; @@ -76,6 +91,21 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 202CCA962580AAB600BCC0A2 /* Feed.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Feed.storyboard; sourceTree = ""; }; + 2030775D2589699A00DD1F75 /* FeedCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedCell.swift; sourceTree = ""; }; + 2030776B25896B3000DD1F75 /* UIStackView+Layout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStackView+Layout.swift"; sourceTree = ""; }; + 2030777225896B9B00DD1F75 /* UIButton+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+Extension.swift"; sourceTree = ""; }; + 2030777925896BBC00DD1F75 /* UILabel+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+Extension.swift"; sourceTree = ""; }; + 203077842589728200DD1F75 /* ReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReusableView.swift; sourceTree = ""; }; + 2030778B258972A300DD1F75 /* UICollectionView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UICollectionView+Extensions.swift"; sourceTree = ""; }; + 20953C622588D7D2009ED75E /* UISegementedControl+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UISegementedControl+Extension.swift"; sourceTree = ""; }; + 20953C722588D9AB009ED75E /* UIView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = ""; }; + 20953C7B2588DE59009ED75E /* Lora-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Lora-Regular.ttf"; sourceTree = ""; }; + 20953C7C2588DE88009ED75E /* PlayfairDisplay-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PlayfairDisplay-Bold.ttf"; sourceTree = ""; }; + 20953C7D2588DF7D009ED75E /* UIFont+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+Extension.swift"; sourceTree = ""; }; + 20953C9525890E12009ED75E /* NewsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewsViewController.swift; sourceTree = ""; }; + 20953C9C25890F7C009ED75E /* ArticlesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticlesViewController.swift; sourceTree = ""; }; + 20A82BF4257C4BD000E7BF29 /* FeedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = ""; }; 5DE2958EE217DA2AEF4E463F /* Pods_SpaceDash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SpaceDash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B15257ADD46DBE38C7F17D09 /* Pods-SpaceDash.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SpaceDash.release.xcconfig"; path = "Target Support Files/Pods-SpaceDash/Pods-SpaceDash.release.xcconfig"; sourceTree = ""; }; B5A11B9FE2BFCA5CB1A21EC0 /* Pods-SpaceX.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SpaceX.debug.xcconfig"; path = "Target Support Files/Pods-SpaceX/Pods-SpaceX.debug.xcconfig"; sourceTree = ""; }; @@ -167,6 +197,41 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2030774B2589676C00DD1F75 /* Cells */ = { + isa = PBXGroup; + children = ( + 2030775D2589699A00DD1F75 /* FeedCell.swift */, + ); + path = Cells; + sourceTree = ""; + }; + 208828C4257C4DBD00D6AD98 /* Storyboards */ = { + isa = PBXGroup; + children = ( + FFF716DB249D3E1C0043EB81 /* Main.storyboard */, + 202CCA962580AAB600BCC0A2 /* Feed.storyboard */, + ); + path = Storyboards; + sourceTree = ""; + }; + 20953C792588DE2A009ED75E /* Helper */ = { + isa = PBXGroup; + children = ( + 20953C7A2588DE3C009ED75E /* Fonts */, + 203077842589728200DD1F75 /* ReusableView.swift */, + ); + path = Helper; + sourceTree = ""; + }; + 20953C7A2588DE3C009ED75E /* Fonts */ = { + isa = PBXGroup; + children = ( + 20953C7C2588DE88009ED75E /* PlayfairDisplay-Bold.ttf */, + 20953C7B2588DE59009ED75E /* Lora-Regular.ttf */, + ); + path = Fonts; + sourceTree = ""; + }; 9E7BE7660A5996338B49D647 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -274,6 +339,9 @@ FFF7170B24A338D10043EB81 /* HomeViewController.swift */, FF60A64924D47B4E0030F5AE /* AboutViewController.swift */, FFB734B924DB2B2B006C1518 /* DetailsViewController.swift */, + 20A82BF4257C4BD000E7BF29 /* FeedViewController.swift */, + 20953C9525890E12009ED75E /* NewsViewController.swift */, + 20953C9C25890F7C009ED75E /* ArticlesViewController.swift */, ); path = ViewControllers; sourceTree = ""; @@ -299,8 +367,9 @@ FFC259DF24A76C720019E354 /* View */ = { isa = PBXGroup; children = ( + 2030774B2589676C00DD1F75 /* Cells */, + 208828C4257C4DBD00D6AD98 /* Storyboards */, FFD549E325055F8200F49DC0 /* Animations */, - FFF716DB249D3E1C0043EB81 /* Main.storyboard */, FFF716E0249D3E210043EB81 /* LaunchScreen.storyboard */, FFF25C6624D871EF00D0E1FF /* DetailsTableViewCell.swift */, FFF25C6724D871EF00D0E1FF /* DetailsTableViewCell.xib */, @@ -322,6 +391,13 @@ children = ( FFC259E624A772150019E354 /* CALayer.swift */, FFB398F924DDDBDC001D4EA1 /* UIImageView.swift */, + 20953C622588D7D2009ED75E /* UISegementedControl+Extension.swift */, + 20953C722588D9AB009ED75E /* UIView+Extension.swift */, + 20953C7D2588DF7D009ED75E /* UIFont+Extension.swift */, + 2030776B25896B3000DD1F75 /* UIStackView+Layout.swift */, + 2030777225896B9B00DD1F75 /* UIButton+Extension.swift */, + 2030777925896BBC00DD1F75 /* UILabel+Extension.swift */, + 2030778B258972A300DD1F75 /* UICollectionView+Extensions.swift */, ); path = Extensions; sourceTree = ""; @@ -367,6 +443,7 @@ FFC259DE24A76C5B0019E354 /* Controller */, FFC259DF24A76C720019E354 /* View */, FFC259E524A7715A0019E354 /* Extensions */, + 20953C792588DE2A009ED75E /* Helper */, FFC259E124A76CCA0019E354 /* Config */, FFF716E3249D3E210043EB81 /* Info.plist */, FFA9CA5724C0CA31006FA5DE /* Assets.xcassets */, @@ -475,7 +552,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1160; - LastUpgradeCheck = 1150; + LastUpgradeCheck = 1220; ORGANIZATIONNAME = "Pushpinder Pal Singh"; TargetAttributes = { FF3043D02507E5D0005F8EE6 = { @@ -555,7 +632,10 @@ buildActionMask = 2147483647; files = ( FF4C3944250565AE00279A39 /* space.json in Resources */, + 20953C8F258908FE009ED75E /* Lora-Regular.ttf in Resources */, + 20953C89258908F9009ED75E /* PlayfairDisplay-Bold.ttf in Resources */, FFF716E2249D3E210043EB81 /* LaunchScreen.storyboard in Resources */, + 202CCA972580AAB600BCC0A2 /* Feed.storyboard in Resources */, FFA9CA5824C0CA31006FA5DE /* Assets.xcassets in Resources */, FFF25C6924D871EF00D0E1FF /* DetailsTableViewCell.xib in Resources */, FFF716DD249D3E1C0043EB81 /* Main.storyboard in Resources */, @@ -644,6 +724,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 2030777A25896BBC00DD1F75 /* UILabel+Extension.swift in Sources */, + 20A82BF5257C4BD000E7BF29 /* FeedViewController.swift in Sources */, FFA9CA8024C1B838006FA5DE /* UpcomingLaunchModel.swift in Sources */, FF7F94FB2511E51000B2830B /* DetailView.swift in Sources */, FFB398F424DDD025001D4EA1 /* RocketsData.swift in Sources */, @@ -651,21 +733,31 @@ FFF25C6824D871EF00D0E1FF /* DetailsTableViewCell.swift in Sources */, FFC259EB24A7AB3C0019E354 /* UpcomingView.swift in Sources */, FFF716D6249D3E1C0043EB81 /* AppDelegate.swift in Sources */, + 2030775F2589699A00DD1F75 /* FeedCell.swift in Sources */, FF8E3EDE24DF066E00077DE3 /* LaunchPadsData.swift in Sources */, + 20953C9D25890F7C009ED75E /* ArticlesViewController.swift in Sources */, + 2030776C25896B3000DD1F75 /* UIStackView+Layout.swift in Sources */, FF8E3EDC24DF003300077DE3 /* ShipsData.swift in Sources */, FFA9CA5D24C0CCCA006FA5DE /* UpcomingLaunchData.swift in Sources */, + 2030777325896B9B00DD1F75 /* UIButton+Extension.swift in Sources */, FFF716D8249D3E1C0043EB81 /* SceneDelegate.swift in Sources */, + 20953C732588D9AB009ED75E /* UIView+Extension.swift in Sources */, + 20953C632588D7D2009ED75E /* UISegementedControl+Extension.swift in Sources */, + 20953C7E2588DF7D009ED75E /* UIFont+Extension.swift in Sources */, FF60A64A24D47B4E0030F5AE /* AboutViewController.swift in Sources */, FFF266B424DEF93800BA5C28 /* CapsulesData.swift in Sources */, FFF7171224A48F730043EB81 /* DetailScrollViews.swift in Sources */, FFA9CA5C24C0CCCA006FA5DE /* NetworkManager.swift in Sources */, FFB398F724DDD2F8001D4EA1 /* DetailsViewModel.swift in Sources */, FFF266B224DEAF7400BA5C28 /* LandpadsData.swift in Sources */, + 203077852589728200DD1F75 /* ReusableView.swift in Sources */, FFF7170C24A338D10043EB81 /* HomeViewController.swift in Sources */, FFC259E724A772150019E354 /* CALayer.swift in Sources */, FFB734BA24DB2B2B006C1518 /* DetailsViewController.swift in Sources */, FFB398FA24DDDBDC001D4EA1 /* UIImageView.swift in Sources */, FFBEA64324DC6C3B00A22F9F /* DetailCellImageView.swift in Sources */, + 2030778C258972A300DD1F75 /* UICollectionView+Extensions.swift in Sources */, + 20953C9625890E12009ED75E /* NewsViewController.swift in Sources */, FFC259E924A7A9C10019E354 /* InfoPanelView.swift in Sources */, FF8E3EE224DF14EB00077DE3 /* LaunchesData.swift in Sources */, ); @@ -904,6 +996,7 @@ 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; @@ -964,6 +1057,7 @@ 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; diff --git a/SpaceDash.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SpaceDash.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/SpaceDash.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SpaceDash.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SpaceDash.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/SpaceDash.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/SpaceDash.xcodeproj/xcshareddata/xcschemes/FastlaneSnapshots.xcscheme b/SpaceDash.xcodeproj/xcshareddata/xcschemes/FastlaneSnapshots.xcscheme index 82c7b09..50d9dd7 100644 --- a/SpaceDash.xcodeproj/xcshareddata/xcschemes/FastlaneSnapshots.xcscheme +++ b/SpaceDash.xcodeproj/xcshareddata/xcschemes/FastlaneSnapshots.xcscheme @@ -1,6 +1,6 @@ + + + + PreviewsEnabled + + + diff --git a/SpaceDash/Assets.xcassets/Colors/Contents.json b/SpaceDash/Assets.xcassets/Colors/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/SpaceDash/Assets.xcassets/Colors/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SpaceDash/Assets.xcassets/DashBlack.colorset/Contents.json b/SpaceDash/Assets.xcassets/Colors/DashBlack.colorset/Contents.json similarity index 100% rename from SpaceDash/Assets.xcassets/DashBlack.colorset/Contents.json rename to SpaceDash/Assets.xcassets/Colors/DashBlack.colorset/Contents.json diff --git a/SpaceDash/Assets.xcassets/DashCream.colorset/Contents.json b/SpaceDash/Assets.xcassets/Colors/DashCream.colorset/Contents.json similarity index 100% rename from SpaceDash/Assets.xcassets/DashCream.colorset/Contents.json rename to SpaceDash/Assets.xcassets/Colors/DashCream.colorset/Contents.json diff --git a/SpaceDash/Assets.xcassets/Colors/DashGray.colorset/Contents.json b/SpaceDash/Assets.xcassets/Colors/DashGray.colorset/Contents.json new file mode 100644 index 0000000..baf4b4b --- /dev/null +++ b/SpaceDash/Assets.xcassets/Colors/DashGray.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.600", + "green" : "0.600", + "red" : "0.600" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.600", + "green" : "0.600", + "red" : "0.600" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SpaceDash/Assets.xcassets/news-icon.imageset/Contents.json b/SpaceDash/Assets.xcassets/news-icon.imageset/Contents.json new file mode 100644 index 0000000..8b023db --- /dev/null +++ b/SpaceDash/Assets.xcassets/news-icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "news-icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SpaceDash/Assets.xcassets/news-icon.imageset/news-icon@2x.png b/SpaceDash/Assets.xcassets/news-icon.imageset/news-icon@2x.png new file mode 100644 index 0000000..95b0995 Binary files /dev/null and b/SpaceDash/Assets.xcassets/news-icon.imageset/news-icon@2x.png differ diff --git a/SpaceDash/Assets.xcassets/stockImage.imageset/Contents.json b/SpaceDash/Assets.xcassets/stockImage.imageset/Contents.json new file mode 100644 index 0000000..b36ba9b --- /dev/null +++ b/SpaceDash/Assets.xcassets/stockImage.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "stockImage.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SpaceDash/Assets.xcassets/stockImage.imageset/stockImage.png b/SpaceDash/Assets.xcassets/stockImage.imageset/stockImage.png new file mode 100644 index 0000000..01ab477 Binary files /dev/null and b/SpaceDash/Assets.xcassets/stockImage.imageset/stockImage.png differ diff --git a/SpaceDash/Controller/ViewControllers/ArticlesViewController.swift b/SpaceDash/Controller/ViewControllers/ArticlesViewController.swift new file mode 100644 index 0000000..4e3c7ef --- /dev/null +++ b/SpaceDash/Controller/ViewControllers/ArticlesViewController.swift @@ -0,0 +1,45 @@ +// +// ArticlesViewController.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + +import UIKit +class ArticlesViewController: UIViewController { + + @IBOutlet weak var collectionView: UICollectionView! + + + override func viewDidLoad() { + super.viewDidLoad() + + collectionView.register(FeedCell.self) + + collectionView.delegate = self + collectionView.dataSource = self + + if let collectionViewLayout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout { + collectionViewLayout.estimatedItemSize = UICollectionViewFlowLayout.automaticSize + } + + } + + +} +extension ArticlesViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout{ + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return 3 + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell: FeedCell = collectionView.dequeueReusableCell(for: indexPath) + return cell + } + + +} + + diff --git a/SpaceDash/Controller/ViewControllers/FeedViewController.swift b/SpaceDash/Controller/ViewControllers/FeedViewController.swift new file mode 100644 index 0000000..7c61412 --- /dev/null +++ b/SpaceDash/Controller/ViewControllers/FeedViewController.swift @@ -0,0 +1,99 @@ +// +// NewsListViewController.swift +// SpaceDash +// +// Created by akhigbe benjamin on 06/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + +import UIKit +import SnapKit + + +class FeedViewController: UIViewController{ + + @IBOutlet weak var segmentedControl: UISegmentedControl! + + @IBOutlet weak var newsContainerView: UIView! + + @IBOutlet weak var articleContainerView: UIView! + + + let segmentindicator: UIView = { + + let v = UIView() + v.backgroundColor = .white + v.translatesAutoresizingMaskIntoConstraints = false + + return v + }() + + + override func viewDidLoad() { + super.viewDidLoad() + customizeSegmentedControl() + } + + fileprivate func customizeSegmentedControl(){ + navigationController?.navigationBar.isHidden = true + view.backgroundColor = .black + segmentedControl.clearBG() + segmentedControl.fontStateStyle(font: UIFont.playFairDisplay(.bold, size: 20), fontColor: UIColor(named: Constants.Colors.DashGray)!, state: .normal) + segmentedControl.fontStateStyle(font: UIFont.playFairDisplay(.bold, size: 20), fontColor: .white, state: .selected) + self.view.addSubview(segmentindicator) + setupConstraint() + } + + func setupConstraint() { + articleContainerView.isHidden = true + segmentindicator.snp.makeConstraints { (make) in + + make.top.equalTo(segmentedControl.snp.bottom).offset(1) + make.height.equalTo(3) + + make.width.equalTo(40 + segmentedControl.titleForSegment(at: 0)!.count * 4) + make.centerX.equalTo(segmentedControl.snp.centerX).dividedBy(segmentedControl.numberOfSegments) + } + } + + @IBAction func indexChanged(_ sender: UISegmentedControl) { + + let numberOfSegments = CGFloat(segmentedControl.numberOfSegments) + let selectedIndex = CGFloat(sender.selectedSegmentIndex) + let titlecount = CGFloat((segmentedControl.titleForSegment(at: sender.selectedSegmentIndex)!.count)) + + segmentindicator.snp.remakeConstraints { (make) in + + make.top.equalTo(segmentedControl.snp.bottom).offset(1) + make.height.equalTo(3) + make.width.equalTo(60 + titlecount * 8) + make.centerX.equalTo(segmentedControl.snp.centerX).dividedBy(numberOfSegments / CGFloat(3.0 + CGFloat(selectedIndex-1.0)*2.0)) + + } + switchView(selectedIndex: Int(selectedIndex)) + + UIView.animate(withDuration: 0.4, animations: { + self.view.layoutIfNeeded() + self.segmentindicator.transform = CGAffineTransform(scaleX: 1.4, y: 1) + }) { (finish) in + UIView.animate(withDuration: 0.3, animations: { + self.segmentindicator.transform = CGAffineTransform.identity + }) + } + + switchView(selectedIndex: Int(selectedIndex)) + } + + func switchView(selectedIndex: Int){ + if selectedIndex == 0 { + newsContainerView.animate(isHidden: false, duration: 0.4) + articleContainerView.animate(isHidden: true, duration: 0.4) + }else{ + newsContainerView.animate(isHidden: true, duration: 0.4) + articleContainerView.animate(isHidden: false, duration: 0.4) + } + + } +} + + diff --git a/SpaceDash/Controller/ViewControllers/NewsViewController.swift b/SpaceDash/Controller/ViewControllers/NewsViewController.swift new file mode 100644 index 0000000..fb0b844 --- /dev/null +++ b/SpaceDash/Controller/ViewControllers/NewsViewController.swift @@ -0,0 +1,45 @@ +// +// NewsViewController.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + +import UIKit + + +class NewsViewController: UIViewController{ + + @IBOutlet weak var collectionView: UICollectionView! + + + + override func viewDidLoad() { + super.viewDidLoad() + + collectionView.register(FeedCell.self) + + if let collectionViewLayout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout { + collectionViewLayout.estimatedItemSize = UICollectionViewFlowLayout.automaticSize + } + + } + + +} +extension NewsViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout{ + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return 3 + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell: FeedCell = collectionView.dequeueReusableCell(for: indexPath) + return cell + } + + +} + + diff --git a/SpaceDash/Extensions/UIButton+Extension.swift b/SpaceDash/Extensions/UIButton+Extension.swift new file mode 100644 index 0000000..9ea3f21 --- /dev/null +++ b/SpaceDash/Extensions/UIButton+Extension.swift @@ -0,0 +1,18 @@ +// +// UIButton+Extension.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + +import UIKit + +extension UIButton { + convenience init(title: String){ + self.init(type: .system) + self.setTitle(title, for: .normal) + } +} + + diff --git a/SpaceDash/Extensions/UICollectionView+Extensions.swift b/SpaceDash/Extensions/UICollectionView+Extensions.swift new file mode 100644 index 0000000..e4b34bf --- /dev/null +++ b/SpaceDash/Extensions/UICollectionView+Extensions.swift @@ -0,0 +1,24 @@ +// +// UICollectionView+Extensions.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + +import UIKit + +extension UICollectionView{ + + func register(_ : T.Type){ + register(T.self, forCellWithReuseIdentifier: T.reuseIdentifier) + } + + func dequeueReusableCell(for indexPath: IndexPath) -> T { + guard let cell = dequeueReusableCell(withReuseIdentifier: T.reuseIdentifier, for: indexPath) as? T else { + fatalError("Unable to Dequeue Reusable Collection View Cell") + } + return cell + } + +} diff --git a/SpaceDash/Extensions/UIFont+Extension.swift b/SpaceDash/Extensions/UIFont+Extension.swift new file mode 100644 index 0000000..450c8c5 --- /dev/null +++ b/SpaceDash/Extensions/UIFont+Extension.swift @@ -0,0 +1,30 @@ +// +// UIFont+Extension.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + +import UIKit + +extension UIFont{ + static func lora(_ type: Constants.Font.FontType = .regular, size: CGFloat = 16) -> UIFont { + return UIFont(name: "\(Constants.Font.lora)\(type.rawValue)", size: size)! + } + + static func playFairDisplay(_ type: Constants.Font.FontType = .bold, size: CGFloat = 24) -> UIFont { + return UIFont(name: "\(Constants.Font.playFairDisplay)\(type.rawValue)", size: size)! + } + + var isBold: Bool { + return fontDescriptor.symbolicTraits.contains(.traitBold) + } + + var isItalic: Bool { + return fontDescriptor.symbolicTraits.contains(.traitItalic) + } +} + + + diff --git a/SpaceDash/Extensions/UIImageView.swift b/SpaceDash/Extensions/UIImageView.swift index a7c4b72..9db15ef 100644 --- a/SpaceDash/Extensions/UIImageView.swift +++ b/SpaceDash/Extensions/UIImageView.swift @@ -23,4 +23,18 @@ extension UIImageView { } } } + + convenience init(cornerRadius: CGFloat){ + self.init(frame: .zero) + self.layer.cornerRadius = cornerRadius + self.clipsToBounds = true + self.contentMode = .scaleAspectFill + } + + convenience init(imageName: String){ + self.init(frame: .zero) + self.image = UIImage(named: imageName) + self.clipsToBounds = true + self.contentMode = .scaleAspectFill + } } diff --git a/SpaceDash/Extensions/UILabel+Extension.swift b/SpaceDash/Extensions/UILabel+Extension.swift new file mode 100644 index 0000000..3152ff6 --- /dev/null +++ b/SpaceDash/Extensions/UILabel+Extension.swift @@ -0,0 +1,20 @@ +// +// UILabel+Extension.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + +import UIKit + +extension UILabel { + convenience init(text: String, font: UIFont, numberOfLine: Int = 0, textColor: UIColor = .label, alignment: NSTextAlignment = .left) { + self.init(frame: .zero) + self.text = text + self.font = font + self.numberOfLines = numberOfLines + self.textColor = textColor + self.textAlignment = alignment + } +} diff --git a/SpaceDash/Extensions/UISegementedControl+Extension.swift b/SpaceDash/Extensions/UISegementedControl+Extension.swift new file mode 100644 index 0000000..de3ecab --- /dev/null +++ b/SpaceDash/Extensions/UISegementedControl+Extension.swift @@ -0,0 +1,36 @@ +// +// UISegementedControl+Extension.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + +import UIKit + + +extension UISegmentedControl { + func clearBG(){ + let clearImage = UIImage().imageWithColor(color: .clear) + setBackgroundImage(clearImage, for: .normal, barMetrics: .default) + setBackgroundImage(clearImage, for: .selected, barMetrics: .default) + setDividerImage(clearImage, forLeftSegmentState: .normal, rightSegmentState: .normal, barMetrics: .default) + } + + func fontStateStyle(font: UIFont, fontColor color: UIColor, state: UIControl.State){ + setTitleTextAttributes([NSAttributedString.Key.font : font, NSAttributedString.Key.foregroundColor: color], for: state) + } +} + +public extension UIImage { + func imageWithColor(color: UIColor) -> UIImage { + let rect = CGRect(x: 0.0, y: 0.0, width: 1.0, height: 1.0) + UIGraphicsBeginImageContext(rect.size) + guard let context = UIGraphicsGetCurrentContext() else { return UIImage()} + context.setFillColor(color.cgColor) + context.fill(rect) + let image = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + return image! + } +} diff --git a/SpaceDash/Extensions/UIStackView+Layout.swift b/SpaceDash/Extensions/UIStackView+Layout.swift new file mode 100644 index 0000000..f86342a --- /dev/null +++ b/SpaceDash/Extensions/UIStackView+Layout.swift @@ -0,0 +1,49 @@ +// +// UIStackView+Layout.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// +import Foundation +import UIKit + +extension UIStackView{ + func addLayout(spacing: CGFloat, distribution: UIStackView.Distribution = .fill, alignment: UIStackView.Alignment = .fill){ + self.spacing = spacing + self.distribution = distribution + self.alignment = alignment + } +} + + +class VerticalStackView: UIStackView { + + init(arrangedSubviews: [UIView], spacing: CGFloat = 0) { + super.init(frame: .zero) + + arrangedSubviews.forEach({addArrangedSubview($0)}) + + self.spacing = spacing + self.axis = .vertical + } + + required init(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +class HorizontalStackView: UIStackView{ + + init(arrangedSubviews: [UIView], spacing: CGFloat = 0) { + super.init(frame: .zero) + arrangedSubviews.forEach({addArrangedSubview($0)}) + self.spacing = spacing + self.axis = .horizontal + } + + required init(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} diff --git a/SpaceDash/Extensions/UIView+Extension.swift b/SpaceDash/Extensions/UIView+Extension.swift new file mode 100644 index 0000000..dbf2f1e --- /dev/null +++ b/SpaceDash/Extensions/UIView+Extension.swift @@ -0,0 +1,165 @@ +// +// UIView+Extension.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + +import UIKit + +extension UIView { + public static let defaultFadingAnimationDuration: TimeInterval = 1.0 + + public func animate(isHidden: Bool, duration: TimeInterval = UIView.defaultFadingAnimationDuration, completion: ((Bool) -> Void)? = nil) { + if isHidden { + easeOut(duration: duration, + completion: completion) + } else { + easeIn(duration: duration, + completion: completion) + } + } + public func easeOut(duration: TimeInterval = UIView.defaultFadingAnimationDuration, completion: ((Bool) -> Void)? = nil) { + UIView.animate(withDuration: duration, delay: 0.0, options: .curveEaseOut, + animations: { + self.alpha = 0.0 + }, + completion: { isFinished in + + self.isHidden = isFinished + + completion?(isFinished) + }) + } + + public func easeIn(duration: TimeInterval = UIView.defaultFadingAnimationDuration, completion: ((Bool) -> Void)? = nil) { + if isHidden { + // Make sure our animation is visible. + isHidden = false + } + + UIView.animate(withDuration: duration, delay: 0.0, options: .curveEaseIn, + animations: { + self.alpha = 1.0 + }, + completion: completion) + } + + func roundCorners(corners: UIRectCorner, radius: Int = 8) { + let maskPath1 = UIBezierPath(roundedRect: bounds, + byRoundingCorners: corners, + cornerRadii: CGSize(width: radius, height: radius)) + let maskLayer1 = CAShapeLayer() + maskLayer1.frame = bounds + maskLayer1.path = maskPath1.cgPath + layer.mask = maskLayer1 + } + +} + + +extension UIView { + + @discardableResult + func anchor(top: NSLayoutYAxisAnchor? = nil, leading: NSLayoutXAxisAnchor? = nil, bottom: NSLayoutYAxisAnchor? = nil, trailing: NSLayoutXAxisAnchor? = nil, padding: UIEdgeInsets = .zero, size: CGSize = .zero) -> AnchoredConstraints { + + translatesAutoresizingMaskIntoConstraints = false + var anchoredConstraints = AnchoredConstraints() + + if let top = top { + anchoredConstraints.top = topAnchor.constraint(equalTo: top, constant: padding.top) + } + + if let leading = leading { + anchoredConstraints.leading = leadingAnchor.constraint(equalTo: leading, constant: padding.left) + } + + if let bottom = bottom { + anchoredConstraints.bottom = bottomAnchor.constraint(equalTo: bottom, constant: -padding.bottom) + } + + if let trailing = trailing { + anchoredConstraints.trailing = trailingAnchor.constraint(equalTo: trailing, constant: -padding.right) + } + + if size.width != 0 { + anchoredConstraints.width = widthAnchor.constraint(equalToConstant: size.width) + } + + if size.height != 0 { + anchoredConstraints.height = heightAnchor.constraint(equalToConstant: size.height) + } + + [anchoredConstraints.top, anchoredConstraints.leading, anchoredConstraints.bottom, anchoredConstraints.trailing, anchoredConstraints.width, anchoredConstraints.height].forEach{ $0?.isActive = true } + + return anchoredConstraints + } + + func fillSuperview(padding: UIEdgeInsets = .zero) { + translatesAutoresizingMaskIntoConstraints = false + if let superviewTopAnchor = superview?.topAnchor { + topAnchor.constraint(equalTo: superviewTopAnchor, constant: padding.top).isActive = true + } + + if let superviewBottomAnchor = superview?.bottomAnchor { + bottomAnchor.constraint(equalTo: superviewBottomAnchor, constant: -padding.bottom).isActive = true + } + + if let superviewLeadingAnchor = superview?.leadingAnchor { + leadingAnchor.constraint(equalTo: superviewLeadingAnchor, constant: padding.left).isActive = true + } + + if let superviewTrailingAnchor = superview?.trailingAnchor { + trailingAnchor.constraint(equalTo: superviewTrailingAnchor, constant: -padding.right).isActive = true + } + } + + func centerInSuperview(size: CGSize = .zero) { + translatesAutoresizingMaskIntoConstraints = false + if let superviewCenterXAnchor = superview?.centerXAnchor { + centerXAnchor.constraint(equalTo: superviewCenterXAnchor).isActive = true + } + + if let superviewCenterYAnchor = superview?.centerYAnchor { + centerYAnchor.constraint(equalTo: superviewCenterYAnchor).isActive = true + } + + if size.width != 0 { + widthAnchor.constraint(equalToConstant: size.width).isActive = true + } + + if size.height != 0 { + heightAnchor.constraint(equalToConstant: size.height).isActive = true + } + } + + func centerXInSuperview() { + translatesAutoresizingMaskIntoConstraints = false + if let superViewCenterXAnchor = superview?.centerXAnchor { + centerXAnchor.constraint(equalTo: superViewCenterXAnchor).isActive = true + } + } + + func centerYInSuperview() { + translatesAutoresizingMaskIntoConstraints = false + if let centerY = superview?.centerYAnchor { + centerYAnchor.constraint(equalTo: centerY).isActive = true + } + } + + func constrainWidth(constant: CGFloat) { + translatesAutoresizingMaskIntoConstraints = false + widthAnchor.constraint(equalToConstant: constant).isActive = true + } + + func constrainHeight(constant: CGFloat) { + translatesAutoresizingMaskIntoConstraints = false + heightAnchor.constraint(equalToConstant: constant).isActive = true + } +} + +struct AnchoredConstraints { + var top, leading, bottom, trailing, width, height: NSLayoutConstraint? +} + diff --git a/SpaceDash/Helper/Fonts/Lora-Regular.ttf b/SpaceDash/Helper/Fonts/Lora-Regular.ttf new file mode 100755 index 0000000..5ad50b2 Binary files /dev/null and b/SpaceDash/Helper/Fonts/Lora-Regular.ttf differ diff --git a/SpaceDash/Helper/Fonts/PlayfairDisplay-Bold.ttf b/SpaceDash/Helper/Fonts/PlayfairDisplay-Bold.ttf new file mode 100755 index 0000000..423c4f0 Binary files /dev/null and b/SpaceDash/Helper/Fonts/PlayfairDisplay-Bold.ttf differ diff --git a/SpaceDash/Helper/ReusableView.swift b/SpaceDash/Helper/ReusableView.swift new file mode 100644 index 0000000..468daa4 --- /dev/null +++ b/SpaceDash/Helper/ReusableView.swift @@ -0,0 +1,33 @@ +// +// ReusableView.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + + +import UIKit + +protocol ReusableView { + static var reuseIdentifier: String { get } +} + +extension ReusableView { + static var reuseIdentifier: String{ + return String(describing: self) + } +} + +extension UICollectionViewCell: ReusableView{} +extension UITableViewCell: ReusableView{} + +protocol NibLoadableView { + static var nibName: String { get } +} + +extension NibLoadableView where Self: UIView{ + static var nibName: String{ + return NSStringFromClass(self).components(separatedBy: ".").last! + } +} diff --git a/SpaceDash/Info.plist b/SpaceDash/Info.plist index 5ab16b4..5a27f87 100644 --- a/SpaceDash/Info.plist +++ b/SpaceDash/Info.plist @@ -45,6 +45,11 @@ UILaunchStoryboardName LaunchScreen + UIAppFonts + + PlayfairDisplay-Bold.ttf + Lora-Regular.ttf + UIMainStoryboardFile Main UIRequiredDeviceCapabilities diff --git a/SpaceDash/Model/Constants.swift b/SpaceDash/Model/Constants.swift index e23efaf..cadcbf3 100644 --- a/SpaceDash/Model/Constants.swift +++ b/SpaceDash/Model/Constants.swift @@ -15,10 +15,30 @@ struct Constants { static let upcomingLaunchURL = "launches/Upcoming" } + struct Colors { static let DashCream = "DashCream" static let DashBlack = "DashBlack" + static let DashGray = "DashGray" + } + + struct Images { + static let stockImage = "stockImage" + } + + + struct Font{ + static let lora = "Lora" + static let playFairDisplay = "PlayfairDisplay" + public enum FontType: String { + case semibold = "-SemiBold" + case regular = "-Regular" + case medium = "-Medium" + case bold = "-Bold" + } } + + struct SegueManager { static let detailViewSegue = "DetailView" @@ -59,4 +79,11 @@ struct Constants { static let okButtonTitle = "Ok" } + struct NewCell { + static let reuseId = "NewsCell" + static let title = "U.S. Stocks Post Biggest Monthly Gains Since April" + static let description = "U.S. stocks wavered with the S&P 500 slipping, but the benchmark still finished August with a 7% advance marked by consistent daily gains.U.S. stocks wavered with the S&P 500 slipping, but the benchmark still finished August with a 7% advance marked by consistent daily gains.U.S. stocks wavered with the S&P 500 slipping, but the benchmark still finished August with a 7% advance marked by consistent daily gains." + } + + } diff --git a/SpaceDash/View/Cells/FeedCell.swift b/SpaceDash/View/Cells/FeedCell.swift new file mode 100644 index 0000000..5d917cf --- /dev/null +++ b/SpaceDash/View/Cells/FeedCell.swift @@ -0,0 +1,67 @@ +// +// NewsCell.swift +// SpaceDash +// +// Created by akhigbe benjamin on 15/12/2020. +// Copyright © 2020 Pushpinder Pal Singh. All rights reserved. +// + +import UIKit + +class FeedCell: UICollectionViewCell { + + + //MARK:- PRIVATE CONSTANTS + private let newImage : UIImageView = { + let imageView = UIImageView(imageName: Constants.Images.stockImage) + imageView.constrainHeight(constant: 170) + return imageView + }() + + public let titleLabel = UILabel(text: Constants.NewCell.title, font: .playFairDisplay(), numberOfLine: 2, textColor: .white) + + public let descriptionLabel = UILabel(text: Constants.NewCell.description, font: .lora(), numberOfLine: 5, textColor: .white) + + //MARK:- PRIVATE VARIABLES + + private var overallStackView = UIStackView() + + private var mainView : UIView = { + let view = UIView() + view.backgroundColor = .black + return view + }() + + override init(frame: CGRect) { + super.init(frame: frame) + + setupView() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + + //MARK:- PRIVATE FUNCTIONS + + private func setupView (){ + + overallStackView = VerticalStackView(arrangedSubviews: [newImage, titleLabel, descriptionLabel], spacing: 16) + titleLabel.numberOfLines = 2 + descriptionLabel.numberOfLines = 5 + addSubview(mainView) + mainView.addSubview(overallStackView) + setupViewConstraints() + + } + + private func setupViewConstraints(){ + + overallStackView.fillSuperview() + mainView.anchor(top: topAnchor, leading: leadingAnchor, bottom: bottomAnchor, trailing: trailingAnchor, padding: .init(top: 20, left: 20, bottom: 0, right: 20)) + + mainView.constrainWidth(constant: UIScreen.main.bounds.width - 40) + } + +} diff --git a/SpaceDash/View/Base.lproj/Main.storyboard b/SpaceDash/View/Storyboards/Base.lproj/Main.storyboard similarity index 96% rename from SpaceDash/View/Base.lproj/Main.storyboard rename to SpaceDash/View/Storyboards/Base.lproj/Main.storyboard index c9b73fa..a0ef9f2 100644 --- a/SpaceDash/View/Base.lproj/Main.storyboard +++ b/SpaceDash/View/Storyboards/Base.lproj/Main.storyboard @@ -1,13 +1,25 @@ - + - + + + + + + + + + + + + + @@ -79,33 +91,34 @@ - - + @@ -119,7 +132,6 @@ - @@ -179,7 +191,7 @@ -