diff --git a/.DS_Store b/.DS_Store index d768925..166f936 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/KCLHackApp/.DS_Store b/KCLHackApp/.DS_Store index 27206bf..a9c9180 100644 Binary files a/KCLHackApp/.DS_Store and b/KCLHackApp/.DS_Store differ diff --git a/KCLHackApp/KCLHackApp.xcodeproj/project.pbxproj b/KCLHackApp/KCLHackApp.xcodeproj/project.pbxproj index 3d4e791..fde337f 100644 --- a/KCLHackApp/KCLHackApp.xcodeproj/project.pbxproj +++ b/KCLHackApp/KCLHackApp.xcodeproj/project.pbxproj @@ -17,13 +17,19 @@ 808EBDFC2928454000E6BEA5 /* KCLHackAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 808EBDFB2928454000E6BEA5 /* KCLHackAppUITests.swift */; }; 808EBDFE2928454000E6BEA5 /* KCLHackAppUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 808EBDFD2928454000E6BEA5 /* KCLHackAppUITestsLaunchTests.swift */; }; 808EBE0B2928D8FE00E6BEA5 /* ChatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 808EBE0A2928D8FE00E6BEA5 /* ChatViewController.swift */; }; - 808EBE112928DAD100E6BEA5 /* UIButton+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 808EBE102928DAD100E6BEA5 /* UIButton+Ext.swift */; }; - 808EBE132928DAD500E6BEA5 /* UICollectionView+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 808EBE122928DAD500E6BEA5 /* UICollectionView+Ext.swift */; }; - 808EBE152928DADA00E6BEA5 /* UIColor+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 808EBE142928DAD900E6BEA5 /* UIColor+Ext.swift */; }; - 808EBE172928DADD00E6BEA5 /* UILabel+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 808EBE162928DADD00E6BEA5 /* UILabel+Ext.swift */; }; - 808EBE192928DAE000E6BEA5 /* UISearchTextField+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 808EBE182928DAE000E6BEA5 /* UISearchTextField+Ext.swift */; }; - 808EBE1B2928DAE300E6BEA5 /* UITableView+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 808EBE1A2928DAE300E6BEA5 /* UITableView+Ext.swift */; }; - 808EBE1D2928DAE600E6BEA5 /* UIView+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 808EBE1C2928DAE600E6BEA5 /* UIView+Ext.swift */; }; + A72ACFFF2928DDF800A9B58E /* UILabel+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72ACFF82928DDF800A9B58E /* UILabel+Ext.swift */; }; + A72AD0002928DDF800A9B58E /* UIButton+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72ACFF92928DDF800A9B58E /* UIButton+Ext.swift */; }; + A72AD0012928DDF800A9B58E /* UICollectionView+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72ACFFA2928DDF800A9B58E /* UICollectionView+Ext.swift */; }; + A72AD0022928DDF800A9B58E /* UIColor+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72ACFFB2928DDF800A9B58E /* UIColor+Ext.swift */; }; + A72AD0032928DDF800A9B58E /* UIView+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72ACFFC2928DDF800A9B58E /* UIView+Ext.swift */; }; + A72AD0042928DDF800A9B58E /* UISearchTextField+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72ACFFD2928DDF800A9B58E /* UISearchTextField+Ext.swift */; }; + A72AD0052928DDF800A9B58E /* UITableView+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72ACFFE2928DDF800A9B58E /* UITableView+Ext.swift */; }; + A72AD0072928E25100A9B58E /* GroupsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72AD0062928E25100A9B58E /* GroupsCell.swift */; }; + A72AD00A2928E35400A9B58E /* GroupStruct.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72AD0092928E35400A9B58E /* GroupStruct.swift */; }; + A72AD00C2928EE0900A9B58E /* PotViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72AD00B2928EE0900A9B58E /* PotViewController.swift */; }; + A72AD00E2928FC3100A9B58E /* PotView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72AD00D2928FC3100A9B58E /* PotView.swift */; }; + A72AD010292903FE00A9B58E /* FriendStruct.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72AD00F292903FE00A9B58E /* FriendStruct.swift */; }; + A72AD012292904C400A9B58E /* FriendsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A72AD011292904C400A9B58E /* FriendsCell.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -58,13 +64,19 @@ 808EBDFB2928454000E6BEA5 /* KCLHackAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KCLHackAppUITests.swift; sourceTree = ""; }; 808EBDFD2928454000E6BEA5 /* KCLHackAppUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KCLHackAppUITestsLaunchTests.swift; sourceTree = ""; }; 808EBE0A2928D8FE00E6BEA5 /* ChatViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatViewController.swift; sourceTree = ""; }; - 808EBE102928DAD100E6BEA5 /* UIButton+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIButton+Ext.swift"; path = "KCLHackApp/Extensions1/UIButton+Ext.swift"; sourceTree = SOURCE_ROOT; }; - 808EBE122928DAD500E6BEA5 /* UICollectionView+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UICollectionView+Ext.swift"; path = "KCLHackApp/Extensions1/UICollectionView+Ext.swift"; sourceTree = SOURCE_ROOT; }; - 808EBE142928DAD900E6BEA5 /* UIColor+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIColor+Ext.swift"; path = "KCLHackApp/Extensions1/UIColor+Ext.swift"; sourceTree = SOURCE_ROOT; }; - 808EBE162928DADD00E6BEA5 /* UILabel+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UILabel+Ext.swift"; path = "KCLHackApp/Extensions1/UILabel+Ext.swift"; sourceTree = SOURCE_ROOT; }; - 808EBE182928DAE000E6BEA5 /* UISearchTextField+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UISearchTextField+Ext.swift"; path = "KCLHackApp/Extensions1/UISearchTextField+Ext.swift"; sourceTree = SOURCE_ROOT; }; - 808EBE1A2928DAE300E6BEA5 /* UITableView+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UITableView+Ext.swift"; path = "KCLHackApp/Extensions1/UITableView+Ext.swift"; sourceTree = SOURCE_ROOT; }; - 808EBE1C2928DAE600E6BEA5 /* UIView+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIView+Ext.swift"; path = "KCLHackApp/Extensions1/UIView+Ext.swift"; sourceTree = SOURCE_ROOT; }; + A72ACFF82928DDF800A9B58E /* UILabel+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UILabel+Ext.swift"; sourceTree = ""; }; + A72ACFF92928DDF800A9B58E /* UIButton+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIButton+Ext.swift"; sourceTree = ""; }; + A72ACFFA2928DDF800A9B58E /* UICollectionView+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UICollectionView+Ext.swift"; sourceTree = ""; }; + A72ACFFB2928DDF800A9B58E /* UIColor+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColor+Ext.swift"; sourceTree = ""; }; + A72ACFFC2928DDF800A9B58E /* UIView+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Ext.swift"; sourceTree = ""; }; + A72ACFFD2928DDF800A9B58E /* UISearchTextField+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISearchTextField+Ext.swift"; sourceTree = ""; }; + A72ACFFE2928DDF800A9B58E /* UITableView+Ext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UITableView+Ext.swift"; sourceTree = ""; }; + A72AD0062928E25100A9B58E /* GroupsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupsCell.swift; sourceTree = ""; }; + A72AD0092928E35400A9B58E /* GroupStruct.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupStruct.swift; sourceTree = ""; }; + A72AD00B2928EE0900A9B58E /* PotViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PotViewController.swift; sourceTree = ""; }; + A72AD00D2928FC3100A9B58E /* PotView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PotView.swift; sourceTree = ""; }; + A72AD00F292903FE00A9B58E /* FriendStruct.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FriendStruct.swift; sourceTree = ""; }; + A72AD011292904C400A9B58E /* FriendsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FriendsCell.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -115,10 +127,10 @@ 808EBDD92928453E00E6BEA5 /* KCLHackApp */ = { isa = PBXGroup; children = ( - 808EBE0F2928DAB000E6BEA5 /* Extensions */, + A72AD0082928E26600A9B58E /* Groups */, + A72ACFF72928DDD200A9B58E /* Extensions */, 808EBE0C2928D91000E6BEA5 /* Core */, 808EBDE82928454000E6BEA5 /* Info.plist */, - 808EBE0A2928D8FE00E6BEA5 /* ChatViewController.swift */, ); path = KCLHackApp; sourceTree = ""; @@ -153,20 +165,34 @@ path = Core; sourceTree = ""; }; - 808EBE0F2928DAB000E6BEA5 /* Extensions */ = { + A72ACFF72928DDD200A9B58E /* Extensions */ = { isa = PBXGroup; children = ( - 808EBE1A2928DAE300E6BEA5 /* UITableView+Ext.swift */, - 808EBE1C2928DAE600E6BEA5 /* UIView+Ext.swift */, - 808EBE162928DADD00E6BEA5 /* UILabel+Ext.swift */, - 808EBE182928DAE000E6BEA5 /* UISearchTextField+Ext.swift */, - 808EBE142928DAD900E6BEA5 /* UIColor+Ext.swift */, - 808EBE122928DAD500E6BEA5 /* UICollectionView+Ext.swift */, - 808EBE102928DAD100E6BEA5 /* UIButton+Ext.swift */, + A72ACFF92928DDF800A9B58E /* UIButton+Ext.swift */, + A72ACFFA2928DDF800A9B58E /* UICollectionView+Ext.swift */, + A72ACFFB2928DDF800A9B58E /* UIColor+Ext.swift */, + A72ACFF82928DDF800A9B58E /* UILabel+Ext.swift */, + A72ACFFD2928DDF800A9B58E /* UISearchTextField+Ext.swift */, + A72ACFFE2928DDF800A9B58E /* UITableView+Ext.swift */, + A72ACFFC2928DDF800A9B58E /* UIView+Ext.swift */, ); path = Extensions; sourceTree = ""; }; + A72AD0082928E26600A9B58E /* Groups */ = { + isa = PBXGroup; + children = ( + A72AD0062928E25100A9B58E /* GroupsCell.swift */, + 808EBE0A2928D8FE00E6BEA5 /* ChatViewController.swift */, + A72AD0092928E35400A9B58E /* GroupStruct.swift */, + A72AD00B2928EE0900A9B58E /* PotViewController.swift */, + A72AD00D2928FC3100A9B58E /* PotView.swift */, + A72AD00F292903FE00A9B58E /* FriendStruct.swift */, + A72AD011292904C400A9B58E /* FriendsCell.swift */, + ); + path = Groups; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -298,17 +324,23 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 808EBE152928DADA00E6BEA5 /* UIColor+Ext.swift in Sources */, - 808EBE1D2928DAE600E6BEA5 /* UIView+Ext.swift in Sources */, - 808EBE112928DAD100E6BEA5 /* UIButton+Ext.swift in Sources */, + A72AD0032928DDF800A9B58E /* UIView+Ext.swift in Sources */, + A72AD00E2928FC3100A9B58E /* PotView.swift in Sources */, 808EBDDF2928453E00E6BEA5 /* ViewController.swift in Sources */, + A72AD00A2928E35400A9B58E /* GroupStruct.swift in Sources */, + A72AD0052928DDF800A9B58E /* UITableView+Ext.swift in Sources */, + A72AD0042928DDF800A9B58E /* UISearchTextField+Ext.swift in Sources */, 808EBDDB2928453E00E6BEA5 /* AppDelegate.swift in Sources */, 808EBE0B2928D8FE00E6BEA5 /* ChatViewController.swift in Sources */, - 808EBE132928DAD500E6BEA5 /* UICollectionView+Ext.swift in Sources */, - 808EBE192928DAE000E6BEA5 /* UISearchTextField+Ext.swift in Sources */, - 808EBE1B2928DAE300E6BEA5 /* UITableView+Ext.swift in Sources */, - 808EBE172928DADD00E6BEA5 /* UILabel+Ext.swift in Sources */, + A72AD0002928DDF800A9B58E /* UIButton+Ext.swift in Sources */, + A72AD0072928E25100A9B58E /* GroupsCell.swift in Sources */, + A72AD010292903FE00A9B58E /* FriendStruct.swift in Sources */, + A72AD0012928DDF800A9B58E /* UICollectionView+Ext.swift in Sources */, + A72AD00C2928EE0900A9B58E /* PotViewController.swift in Sources */, + A72AD0022928DDF800A9B58E /* UIColor+Ext.swift in Sources */, + A72ACFFF2928DDF800A9B58E /* UILabel+Ext.swift in Sources */, 808EBDDD2928453E00E6BEA5 /* SceneDelegate.swift in Sources */, + A72AD012292904C400A9B58E /* FriendsCell.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -485,7 +517,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = UEA5XWCYV3; + DEVELOPMENT_TEAM = 288ZUH88HD; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = KCLHackApp/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -513,7 +545,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = UEA5XWCYV3; + DEVELOPMENT_TEAM = 288ZUH88HD; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = KCLHackApp/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; diff --git a/KCLHackApp/KCLHackApp.xcodeproj/project.xcworkspace/xcuserdata/artemiymalyshau.xcuserdatad/UserInterfaceState.xcuserstate b/KCLHackApp/KCLHackApp.xcodeproj/project.xcworkspace/xcuserdata/artemiymalyshau.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..067211d Binary files /dev/null and b/KCLHackApp/KCLHackApp.xcodeproj/project.xcworkspace/xcuserdata/artemiymalyshau.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/KCLHackApp/KCLHackApp.xcodeproj/xcuserdata/artemiymalyshau.xcuserdatad/xcschemes/xcschememanagement.plist b/KCLHackApp/KCLHackApp.xcodeproj/xcuserdata/artemiymalyshau.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..ff6d76f --- /dev/null +++ b/KCLHackApp/KCLHackApp.xcodeproj/xcuserdata/artemiymalyshau.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + KCLHackApp.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/KCLHackApp/KCLHackApp/.DS_Store b/KCLHackApp/KCLHackApp/.DS_Store index 8908609..1c69570 100644 Binary files a/KCLHackApp/KCLHackApp/.DS_Store and b/KCLHackApp/KCLHackApp/.DS_Store differ diff --git a/KCLHackApp/KCLHackApp/ChatViewController.swift b/KCLHackApp/KCLHackApp/ChatViewController.swift deleted file mode 100644 index 8221d6b..0000000 --- a/KCLHackApp/KCLHackApp/ChatViewController.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// ChatViewController.swift -// KCLHackApp -// -// Created by Christian Grinling on 19/11/2022. -// - -import UIKit - -class ChatViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - - // Do any additional setup after loading the view. - } - - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destination. - // Pass the selected object to the new view controller. - } - */ - -} diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/BlackRock.imageset/Contents.json b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/BlackRock.imageset/Contents.json new file mode 100644 index 0000000..17dc9a8 --- /dev/null +++ b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/BlackRock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "blackrock-inc-vector-logo-small.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/BlackRock.imageset/blackrock-inc-vector-logo-small.png b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/BlackRock.imageset/blackrock-inc-vector-logo-small.png new file mode 100644 index 0000000..a302b07 Binary files /dev/null and b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/BlackRock.imageset/blackrock-inc-vector-logo-small.png differ diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Gradient.imageset/Contents.json b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Gradient.imageset/Contents.json new file mode 100644 index 0000000..8a87fdf --- /dev/null +++ b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Gradient.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Screenshot 2022-11-19 at 14.46.41.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Gradient.imageset/Screenshot 2022-11-19 at 14.46.41.png b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Gradient.imageset/Screenshot 2022-11-19 at 14.46.41.png new file mode 100644 index 0000000..e545be3 Binary files /dev/null and b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Gradient.imageset/Screenshot 2022-11-19 at 14.46.41.png differ diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member1.imageset/Contents.json b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member1.imageset/Contents.json new file mode 100644 index 0000000..add7141 --- /dev/null +++ b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member1.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Screenshot 2022-11-19 at 11.00.38.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member1.imageset/Screenshot 2022-11-19 at 11.00.38.png b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member1.imageset/Screenshot 2022-11-19 at 11.00.38.png new file mode 100644 index 0000000..c552566 Binary files /dev/null and b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member1.imageset/Screenshot 2022-11-19 at 11.00.38.png differ diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member2.imageset/Contents.json b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member2.imageset/Contents.json new file mode 100644 index 0000000..e17ae91 --- /dev/null +++ b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Screenshot 2022-11-19 at 11.00.47.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member2.imageset/Screenshot 2022-11-19 at 11.00.47.png b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member2.imageset/Screenshot 2022-11-19 at 11.00.47.png new file mode 100644 index 0000000..50fa67f Binary files /dev/null and b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member2.imageset/Screenshot 2022-11-19 at 11.00.47.png differ diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member3.imageset/Contents.json b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member3.imageset/Contents.json new file mode 100644 index 0000000..80e2c0b --- /dev/null +++ b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Screenshot 2022-11-19 at 13.47.41.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member3.imageset/Screenshot 2022-11-19 at 13.47.41.png b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member3.imageset/Screenshot 2022-11-19 at 13.47.41.png new file mode 100644 index 0000000..b13d92c Binary files /dev/null and b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Member3.imageset/Screenshot 2022-11-19 at 13.47.41.png differ diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Pizza.imageset/Contents.json b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Pizza.imageset/Contents.json new file mode 100644 index 0000000..9745976 --- /dev/null +++ b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Pizza.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "download.jpeg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Pizza.imageset/download.jpeg b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Pizza.imageset/download.jpeg new file mode 100644 index 0000000..31ea3c2 Binary files /dev/null and b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Pizza.imageset/download.jpeg differ diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Polygon.imageset/Contents.json b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Polygon.imageset/Contents.json new file mode 100644 index 0000000..d22990d --- /dev/null +++ b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Polygon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "download.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Polygon.imageset/download.png b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Polygon.imageset/download.png new file mode 100644 index 0000000..5c328c5 Binary files /dev/null and b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Polygon.imageset/download.png differ diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Tezos.imageset/Contents.json b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Tezos.imageset/Contents.json new file mode 100644 index 0000000..55117c1 --- /dev/null +++ b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Tezos.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "tezos-xtz-logo-A2C00645ED-seeklogo.com.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Tezos.imageset/tezos-xtz-logo-A2C00645ED-seeklogo.com.png b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Tezos.imageset/tezos-xtz-logo-A2C00645ED-seeklogo.com.png new file mode 100644 index 0000000..2230ee4 Binary files /dev/null and b/KCLHackApp/KCLHackApp/Core/Assets.xcassets/Tezos.imageset/tezos-xtz-logo-A2C00645ED-seeklogo.com.png differ diff --git a/KCLHackApp/KCLHackApp/Extensions1/UIButton+Ext.swift b/KCLHackApp/KCLHackApp/Extensions/UIButton+Ext.swift similarity index 100% rename from KCLHackApp/KCLHackApp/Extensions1/UIButton+Ext.swift rename to KCLHackApp/KCLHackApp/Extensions/UIButton+Ext.swift diff --git a/KCLHackApp/KCLHackApp/Extensions1/UICollectionView+Ext.swift b/KCLHackApp/KCLHackApp/Extensions/UICollectionView+Ext.swift similarity index 100% rename from KCLHackApp/KCLHackApp/Extensions1/UICollectionView+Ext.swift rename to KCLHackApp/KCLHackApp/Extensions/UICollectionView+Ext.swift diff --git a/KCLHackApp/KCLHackApp/Extensions1/UIColor+Ext.swift b/KCLHackApp/KCLHackApp/Extensions/UIColor+Ext.swift similarity index 100% rename from KCLHackApp/KCLHackApp/Extensions1/UIColor+Ext.swift rename to KCLHackApp/KCLHackApp/Extensions/UIColor+Ext.swift diff --git a/KCLHackApp/KCLHackApp/Extensions1/UILabel+Ext.swift b/KCLHackApp/KCLHackApp/Extensions/UILabel+Ext.swift similarity index 100% rename from KCLHackApp/KCLHackApp/Extensions1/UILabel+Ext.swift rename to KCLHackApp/KCLHackApp/Extensions/UILabel+Ext.swift diff --git a/KCLHackApp/KCLHackApp/Extensions1/UISearchTextField+Ext.swift b/KCLHackApp/KCLHackApp/Extensions/UISearchTextField+Ext.swift similarity index 100% rename from KCLHackApp/KCLHackApp/Extensions1/UISearchTextField+Ext.swift rename to KCLHackApp/KCLHackApp/Extensions/UISearchTextField+Ext.swift diff --git a/KCLHackApp/KCLHackApp/Extensions1/UITableView+Ext.swift b/KCLHackApp/KCLHackApp/Extensions/UITableView+Ext.swift similarity index 100% rename from KCLHackApp/KCLHackApp/Extensions1/UITableView+Ext.swift rename to KCLHackApp/KCLHackApp/Extensions/UITableView+Ext.swift diff --git a/KCLHackApp/KCLHackApp/Extensions1/UIView+Ext.swift b/KCLHackApp/KCLHackApp/Extensions/UIView+Ext.swift similarity index 100% rename from KCLHackApp/KCLHackApp/Extensions1/UIView+Ext.swift rename to KCLHackApp/KCLHackApp/Extensions/UIView+Ext.swift diff --git a/KCLHackApp/KCLHackApp/Groups/ChatViewController.swift b/KCLHackApp/KCLHackApp/Groups/ChatViewController.swift new file mode 100644 index 0000000..249b137 --- /dev/null +++ b/KCLHackApp/KCLHackApp/Groups/ChatViewController.swift @@ -0,0 +1,95 @@ +import UIKit + +class ChatViewController: UIViewController { + + var groups = [group]() + + lazy var friendsTitle: UILabel = { + let text = UILabel() + text.layout(colour: .white, size: 26, text: "Groups", bold: true) + return text + }() + + lazy var addButton: UIButton = { + let addButton = UIButton() + addButton.setsizedImage(symbol: "plus", size: 12, colour: .white) + addButton.backgroundColor = .darkGray + addButton.layer.cornerRadius = 17 + addButton.layer.masksToBounds = true + addButton.translatesAutoresizingMaskIntoConstraints = false + return addButton + }() + + lazy var groupCollectionView: UICollectionView = { + let flowlayout: UICollectionViewFlowLayout = UICollectionViewFlowLayout() + flowlayout.scrollDirection = .vertical + let collectionview = UICollectionView(frame: self.view.bounds, collectionViewLayout: flowlayout) + collectionview.register(GroupsCell.self, forCellWithReuseIdentifier: "groupCell") + collectionview.backgroundColor = .clear + collectionview.isUserInteractionEnabled = true + collectionview.delegate = self + collectionview.dataSource = self + return collectionview + }() + + override func viewDidLoad() { + super.viewDidLoad() + setUpView() + groups = [ + group(image: "BlackRock", name: "BlackRock Friends", memberCount: "Members: 3"), + group(image: "Polygon", name: "Polygon Bros", memberCount: "Members: 8"), + group(image: "Tezos", name: "Tezos Group", memberCount: "Members: 5") + ] + + } + + func setUpView(){ + view.addSubview(friendsTitle) + view.addSubview(addButton) + view.addSubview(groupCollectionView) + + friendsTitle.anchor(top: view.safeAreaLayoutGuide.topAnchor, paddingTop: 10, bottom: nil, paddingBottom: 0, left: view.leftAnchor, paddingLeft: 20, right: nil, paddingRight: 0, width: 0, height: 0) + + addButton.anchor(top: view.safeAreaLayoutGuide.topAnchor, paddingTop: 8, bottom: nil, paddingBottom: 0, left: nil, paddingLeft: 0, right: view.rightAnchor, paddingRight: 20, width: 34, height: 34) + + groupCollectionView.anchor(top: view.safeAreaLayoutGuide.topAnchor, paddingTop: 70, bottom: view.bottomAnchor, paddingBottom: 0, left: view.leftAnchor, paddingLeft: 0, right: view.rightAnchor, paddingRight: 0, width: 0, height: 0) + } + +} + +extension ChatViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return groups.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell( + withReuseIdentifier: "groupCell", + for: indexPath) as? GroupsCell else { return UICollectionViewCell() } + let data = groups[indexPath.item] + cell.configure(data: data) + cell.backgroundColor = .clear + return cell + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + let itemWidth = collectionView.bounds.width + let itemHeight = CGFloat(56)//view.bounds.height / 15 + let itemSize = CGSize(width: itemWidth, height: itemHeight) + return itemSize + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { + return 20 + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { + return 15 + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + let vc = PotViewController() + self.navigationController?.pushViewController(vc, animated: true) + } +} diff --git a/KCLHackApp/KCLHackApp/Groups/FriendStruct.swift b/KCLHackApp/KCLHackApp/Groups/FriendStruct.swift new file mode 100644 index 0000000..cbf16ae --- /dev/null +++ b/KCLHackApp/KCLHackApp/Groups/FriendStruct.swift @@ -0,0 +1,8 @@ +import Foundation + +struct friend { + var image: String + var name: String + var saverStatus: String + var num: String +} diff --git a/KCLHackApp/KCLHackApp/Groups/FriendsCell.swift b/KCLHackApp/KCLHackApp/Groups/FriendsCell.swift new file mode 100644 index 0000000..0fb193f --- /dev/null +++ b/KCLHackApp/KCLHackApp/Groups/FriendsCell.swift @@ -0,0 +1,74 @@ +import UIKit + +class FriendsCell: UICollectionViewCell { + + lazy var imageView: UIImageView = { + let imageView = UIImageView() + imageView.image = UIImage(named: "Polygon") + imageView.contentMode = .scaleAspectFill + imageView.layer.masksToBounds = true + imageView.layer.cornerRadius = 22 + return imageView + }() + + lazy var titleLabel: UILabel = { + let text = UILabel() + text.layout(colour: .white, size: 18, text: "Polygon X EasyA", bold: true) + return text + }() + + lazy var descriptionLabel: UILabel = { + let text = UILabel() + text.layout(colour: .gray, size: 14, text: "Technology, Hackathon", bold: true) + text.numberOfLines = 0 + return text + }() + + lazy var featuredStackView: UIStackView = { + let stackView = UIStackView() + stackView.axis = .vertical + stackView.distribution = .fill + stackView.alignment = .leading + stackView.spacing = 4 + stackView.addArrangedSubview(titleLabel) + stackView.addArrangedSubview(descriptionLabel) + return stackView + }() + + lazy var percentLabel: UILabel = { + let label = UILabel() + label.layout(colour: .white, size: 16, text: "69%", bold: true) + return label + }() + + override init(frame: CGRect) { + super.init(frame: frame) + setupView() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func configure(data: friend) { + imageView.image = UIImage(named: data.image) + titleLabel.text = data.name + descriptionLabel.text = data.saverStatus + percentLabel.text = data.num + } + + func setupView() { + addSubview(imageView) + addSubview(featuredStackView) + addSubview(percentLabel) + + imageView.anchor(top: topAnchor, paddingTop: 6, bottom: bottomAnchor, paddingBottom: 6, left: leftAnchor, paddingLeft: 0, right: nil, paddingRight: 0, width: 44, height: 44) + + featuredStackView.anchor(top: nil, paddingTop: 0, bottom: nil, paddingBottom: 0, left: imageView.rightAnchor, paddingLeft: 14, right: rightAnchor, paddingRight: 0, width: 0, height: 0) + featuredStackView.centerYAnchor.constraint(equalTo: imageView.centerYAnchor).isActive = true + + percentLabel.anchor(top: nil, paddingTop: 0, bottom: nil, paddingBottom: 0, left: nil, paddingLeft: 0, right: rightAnchor, paddingRight: 0, width: 0, height: 0) + percentLabel.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true + + } +} diff --git a/KCLHackApp/KCLHackApp/Groups/GroupStruct.swift b/KCLHackApp/KCLHackApp/Groups/GroupStruct.swift new file mode 100644 index 0000000..b30a094 --- /dev/null +++ b/KCLHackApp/KCLHackApp/Groups/GroupStruct.swift @@ -0,0 +1,7 @@ +import Foundation + +struct group { + var image: String + var name: String + var memberCount: String +} diff --git a/KCLHackApp/KCLHackApp/Groups/GroupsCell.swift b/KCLHackApp/KCLHackApp/Groups/GroupsCell.swift new file mode 100644 index 0000000..927ce93 --- /dev/null +++ b/KCLHackApp/KCLHackApp/Groups/GroupsCell.swift @@ -0,0 +1,75 @@ +import UIKit + +class GroupsCell: UICollectionViewCell { + + lazy var imageView: UIImageView = { + let imageView = UIImageView() + imageView.image = UIImage(named: "Polygon") + imageView.contentMode = .scaleAspectFill + imageView.layer.masksToBounds = true + imageView.layer.cornerRadius = 22 + return imageView + }() + + lazy var titleLabel: UILabel = { + let text = UILabel() + text.layout(colour: .white, size: 18, text: "Polygon X EasyA", bold: true) + return text + }() + + lazy var descriptionLabel: UILabel = { + let text = UILabel() + text.layout(colour: .gray, size: 14, text: "Technology, Hackathon", bold: true) + text.numberOfLines = 0 + return text + }() + + lazy var featuredStackView: UIStackView = { + let stackView = UIStackView() + stackView.axis = .vertical + stackView.distribution = .fill + stackView.alignment = .leading + stackView.spacing = 8 + stackView.addArrangedSubview(titleLabel) + stackView.addArrangedSubview(descriptionLabel) + return stackView + }() + + lazy var chevronButton: UIButton = { + let button = UIButton() + button.setsizedImage(symbol: "chevron.right", size: 14, colour: .white) + button.isUserInteractionEnabled = false + return button + }() + + override init(frame: CGRect) { + super.init(frame: frame) + setupView() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func configure(data: group) { + imageView.image = UIImage(named: data.image) + titleLabel.text = data.name + descriptionLabel.text = data.memberCount + } + + func setupView() { + addSubview(imageView) + addSubview(featuredStackView) + addSubview(chevronButton) + + imageView.anchor(top: topAnchor, paddingTop: 6, bottom: bottomAnchor, paddingBottom: 6, left: leftAnchor, paddingLeft: 18, right: nil, paddingRight: 0, width: 44, height: 44) + + featuredStackView.anchor(top: nil, paddingTop: 0, bottom: nil, paddingBottom: 0, left: imageView.rightAnchor, paddingLeft: 14, right: rightAnchor, paddingRight: 0, width: 0, height: 0) + + featuredStackView.centerYAnchor.constraint(equalTo: imageView.centerYAnchor).isActive = true + + chevronButton.anchor(top: nil, paddingTop: 0, bottom: nil, paddingBottom: 0, left: nil, paddingLeft: 0, right: rightAnchor, paddingRight: 30, width: 0, height: 0) + chevronButton.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true + + } +} diff --git a/KCLHackApp/KCLHackApp/Groups/PotView.swift b/KCLHackApp/KCLHackApp/Groups/PotView.swift new file mode 100644 index 0000000..a1a1d82 --- /dev/null +++ b/KCLHackApp/KCLHackApp/Groups/PotView.swift @@ -0,0 +1,59 @@ +import UIKit + +class PotView: UIView { + + lazy var amountLabel: UILabel = { + let text = UILabel() + text.layout(colour: .white, size: 30, text: "£12", bold: true) + text.translatesAutoresizingMaskIntoConstraints = false + return text + }() + + lazy var emojiLabel: UILabel = { + let emoji = UILabel() + emoji.layout(colour: .white, size: 70, text: "💰", bold: true) + emoji.translatesAutoresizingMaskIntoConstraints = false + return emoji + }() + + override init(frame: CGRect) { + super.init(frame: frame) + layer.cornerRadius = 10 + layer.masksToBounds = true + setUpView() + } + + override func layoutSubviews() { + super.layoutSubviews() + gradientLayer.frame = bounds + } + + private lazy var gradientLayer: CAGradientLayer = { + let l = CAGradientLayer() + l.frame = self.bounds + l.colors = [UIColor.purple.cgColor, UIColor.systemPink.cgColor] + l.startPoint = CGPoint(x: 0, y: 0.5) + l.endPoint = CGPoint(x: 1, y: 0.5) + l.cornerRadius = 16 + layer.insertSublayer(l, at: 0) + return l + }() + + + func setUpView() { + addSubview(amountLabel) + addSubview(emojiLabel) + + // amountLabel.anchor(top: topAnchor, paddingTop: 0, bottom: bottomAnchor, paddingBottom: 0, left: leftAnchor, paddingLeft: 0, right: rightAnchor, paddingRight: 0, width: 0, height: 0) + + amountLabel.centerYAnchor.constraint(equalTo: centerYAnchor, constant: -40).isActive = true + amountLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true + + emojiLabel.centerYAnchor.constraint(equalTo: centerYAnchor, constant: 25).isActive = true + emojiLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} diff --git a/KCLHackApp/KCLHackApp/Groups/PotViewController.swift b/KCLHackApp/KCLHackApp/Groups/PotViewController.swift new file mode 100644 index 0000000..6e954c9 --- /dev/null +++ b/KCLHackApp/KCLHackApp/Groups/PotViewController.swift @@ -0,0 +1,169 @@ +import UIKit + +class PotViewController: UIViewController { + + var friends = [friend]() + + var centery: NSLayoutYAxisAnchor? + + lazy var member1: UIImageView = { + let member1 = UIImageView() + member1.image = UIImage(named: "Member1") + member1.contentMode = .scaleAspectFill + member1.layer.masksToBounds = true + member1.layer.cornerRadius = 20 + return member1 + }() + + lazy var member2: UIImageView = { + let member2 = UIImageView() + member2.image = UIImage(named: "Member2") + member2.contentMode = .scaleAspectFill + member2.layer.masksToBounds = true + member2.layer.cornerRadius = 20 + return member2 + }() + + lazy var addButton: UIButton = { + let addButton = UIButton() + addButton.setsizedImage(symbol: "plus", size: 14, colour: .white) + addButton.backgroundColor = .darkGray + addButton.layer.cornerRadius = 17 + addButton.layer.masksToBounds = true + addButton.translatesAutoresizingMaskIntoConstraints = false + return addButton + }() + + lazy var groupTitle: UILabel = { + let text = UILabel() + text.layout(colour: .white, size: 22, text: "BlackRock Friends", bold: true) + return text + }() + + lazy var bellButton: UIButton = { + let addButton = UIButton() + addButton.setsizedImage(symbol: "bell.badge.fill", size: 16, colour: .white) + return addButton + }() + + lazy var potLabel: UILabel = { + let text = UILabel() + text.layout(colour: .white, size: 20, text: "Current pot value", bold: true) + return text + }() + + lazy var boxView: PotView = { + let view = PotView() + return view + }() + + lazy var friendsTitle: UILabel = { + let text = UILabel() + text.layout(colour: .white, size: 20, text: "This weeks ranking", bold: true) + return text + }() + + lazy var friendCollectionView: UICollectionView = { + let flowlayout: UICollectionViewFlowLayout = UICollectionViewFlowLayout() + flowlayout.scrollDirection = .vertical + let collectionview = UICollectionView(frame: self.view.bounds, collectionViewLayout: flowlayout) + collectionview.register(FriendsCell.self, forCellWithReuseIdentifier: "friendCell") + collectionview.backgroundColor = .clear + collectionview.isUserInteractionEnabled = true + collectionview.delegate = self + collectionview.dataSource = self + return collectionview + }() + + override func viewDidLoad() { + super.viewDidLoad() + setUpView() + friends = [ + friend(image: "Member1", name: "Artemiy", saverStatus: "Super Saver", num: "65%"), + friend(image: "Member2", name: "Christian", saverStatus: "Medium Saver", num: "34%"), + friend(image: "Member3", name: "Adesh", saverStatus: "Mediocre Saver", num: "3%") + ] + view.backgroundColor = .black + + } + + func setUpView(){ + + view.addSubview(member2) + view.addSubview(member1) + view.addSubview(addButton) + view.addSubview(groupTitle) + view.addSubview(bellButton) + + view.addSubview(boxView) + view.addSubview(potLabel) + view.addSubview(friendsTitle) + view.addSubview(friendCollectionView) + + + + centery = member1.centerYAnchor + + member1.anchor(top: nil, paddingTop: 0, bottom: nil, paddingBottom: 0, left: view.leftAnchor, paddingLeft: 20, right: nil, paddingRight: 0, width: 40, height: 40) + member1.centerYAnchor.constraint(equalTo: centery!).isActive = true + + member2.anchor(top: nil, paddingTop: 0, bottom: nil, paddingBottom: 0, left: member1.leftAnchor, paddingLeft: 32, right: nil, paddingRight: 0, width: 40, height: 40) + member2.centerYAnchor.constraint(equalTo: centery!).isActive = true + + addButton.anchor(top: view.safeAreaLayoutGuide.topAnchor, paddingTop: 8, bottom: nil, paddingBottom: 0, left: member2.rightAnchor, paddingLeft: 6, right: nil, paddingRight: 0, width: 34, height: 34) + addButton.centerYAnchor.constraint(equalTo: centery!).isActive = true + + groupTitle.anchor(top: view.safeAreaLayoutGuide.topAnchor, paddingTop: 10, bottom: nil, paddingBottom: 0, left: addButton.rightAnchor, paddingLeft: 20, right: nil, paddingRight: 0, width: 0, height: 0) + groupTitle.centerYAnchor.constraint(equalTo: centery!).isActive = true + + bellButton.anchor(top: view.safeAreaLayoutGuide.topAnchor, paddingTop: 12, bottom: nil, paddingBottom: 0, left: nil, paddingLeft: 0, right: view.rightAnchor, paddingRight: 8, width: 0, height: 0) + bellButton.centerYAnchor.constraint(equalTo: centery!).isActive = true + + boxView.anchor(top: member1.bottomAnchor, paddingTop: 55, bottom: nil, paddingBottom: 0, left: view.leftAnchor, paddingLeft: 30, right: view.rightAnchor, paddingRight: 30, width: 0, height: 200) + + potLabel.anchor(top: view.safeAreaLayoutGuide.topAnchor, paddingTop: 65, bottom: nil, paddingBottom: 0, left: boxView.leftAnchor, paddingLeft: 0, right: nil, paddingRight: 0, width: 0, height: 0) + + + friendsTitle.anchor(top: boxView.bottomAnchor, paddingTop: -55, bottom: nil, paddingBottom: 0, left: boxView.leftAnchor, paddingLeft: 0, right: view.rightAnchor, paddingRight: 30, width: 0, height: 200) + + friendCollectionView.anchor(top: view.safeAreaLayoutGuide.topAnchor, paddingTop: 365, bottom: view.bottomAnchor, paddingBottom: 0, left: boxView.leftAnchor, paddingLeft: 0, right: boxView.rightAnchor, paddingRight: 0, width: 0, height: 0) + + } +} + +extension PotViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return friends.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell( + withReuseIdentifier: "friendCell", + for: indexPath) as? FriendsCell else { return UICollectionViewCell() } + let data = friends[indexPath.item] + cell.configure(data: data) + cell.backgroundColor = .clear + return cell + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + let itemWidth = collectionView.bounds.width + let itemHeight = CGFloat(56)//view.bounds.height / 15 + let itemSize = CGSize(width: itemWidth, height: itemHeight) + return itemSize + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { + return 20 + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { + return 15 + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + let vc = PotViewController() + self.navigationController?.pushViewController(vc, animated: true) + } +}