Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Secretly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@
30C77CB6266AF48300A888DC /* CurrentUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30C77CB5266AF48300A888DC /* CurrentUser.swift */; };
30C77CB8266BD44300A888DC /* CreatePostViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30C77CB7266BD44300A888DC /* CreatePostViewController.swift */; };
30FD0E722659645A006E309A /* Faker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30FD0E712659645A006E309A /* Faker.swift */; };
651015F826DB17460047C3EB /* CommentsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 651015F726DB17460047C3EB /* CommentsViewController.swift */; };
651015FA26DB17D40047C3EB /* Comment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 651015F926DB17D40047C3EB /* Comment.swift */; };
651015FC26DB18090047C3EB /* Author.swift in Sources */ = {isa = PBXBuildFile; fileRef = 651015FB26DB18090047C3EB /* Author.swift */; };
651015FE26DB19620047C3EB /* LeftViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 651015FD26DB19620047C3EB /* LeftViewCell.swift */; };
6510160026DB19AE0047C3EB /* RightViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 651015FF26DB19AE0047C3EB /* RightViewCell.swift */; };
6510160226DB1B3C0047C3EB /* RightViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6510160126DB1B3C0047C3EB /* RightViewCell.xib */; };
6510160426DB1B460047C3EB /* LeftViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6510160326DB1B460047C3EB /* LeftViewCell.xib */; };
6510160626DB20030047C3EB /* UIView+Rounded.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6510160526DB20030047C3EB /* UIView+Rounded.swift */; };
6510160826DB2EF60047C3EB /* FeedCollectionViewController+PostCollectionViewCellDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6510160726DB2EF60047C3EB /* FeedCollectionViewController+PostCollectionViewCellDelegate.swift */; };
6510160A26DB399B0047C3EB /* CommentsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6510160926DB399B0047C3EB /* CommentsService.swift */; };
E021984723FA35E00025C28E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E021984623FA35E00025C28E /* AppDelegate.swift */; };
E021984923FA35E00025C28E /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E021984823FA35E00025C28E /* SceneDelegate.swift */; };
E021984B23FA35E00025C28E /* WelcomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E021984A23FA35E00025C28E /* WelcomeViewController.swift */; };
Expand Down Expand Up @@ -125,6 +135,16 @@
30C77CB5266AF48300A888DC /* CurrentUser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentUser.swift; sourceTree = "<group>"; };
30C77CB7266BD44300A888DC /* CreatePostViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreatePostViewController.swift; sourceTree = "<group>"; };
30FD0E712659645A006E309A /* Faker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Faker.swift; sourceTree = "<group>"; };
651015F726DB17460047C3EB /* CommentsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentsViewController.swift; sourceTree = "<group>"; };
651015F926DB17D40047C3EB /* Comment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Comment.swift; sourceTree = "<group>"; };
651015FB26DB18090047C3EB /* Author.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Author.swift; sourceTree = "<group>"; };
651015FD26DB19620047C3EB /* LeftViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftViewCell.swift; sourceTree = "<group>"; };
651015FF26DB19AE0047C3EB /* RightViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RightViewCell.swift; sourceTree = "<group>"; };
6510160126DB1B3C0047C3EB /* RightViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RightViewCell.xib; sourceTree = "<group>"; };
6510160326DB1B460047C3EB /* LeftViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LeftViewCell.xib; sourceTree = "<group>"; };
6510160526DB20030047C3EB /* UIView+Rounded.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "UIView+Rounded.swift"; path = "../../../../../UIView+Rounded.swift"; sourceTree = "<group>"; };
6510160726DB2EF60047C3EB /* FeedCollectionViewController+PostCollectionViewCellDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FeedCollectionViewController+PostCollectionViewCellDelegate.swift"; sourceTree = "<group>"; };
6510160926DB399B0047C3EB /* CommentsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentsService.swift; sourceTree = "<group>"; };
E021984323FA35E00025C28E /* Secretly.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Secretly.app; sourceTree = BUILT_PRODUCTS_DIR; };
E021984623FA35E00025C28E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
E021984823FA35E00025C28E /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -166,6 +186,8 @@
307A30592661B73A0020DF8B /* ViewControllers */ = {
isa = PBXGroup;
children = (
651015F726DB17460047C3EB /* CommentsViewController.swift */,
6510160726DB2EF60047C3EB /* FeedCollectionViewController+PostCollectionViewCellDelegate.swift */,
E021984A23FA35E00025C28E /* WelcomeViewController.swift */,
30C77CB7266BD44300A888DC /* CreatePostViewController.swift */,
307A305A2661B7A20020DF8B /* FeedCollectionViewController.swift */,
Expand Down Expand Up @@ -197,10 +219,14 @@
307A306326629B590020DF8B /* Views */ = {
isa = PBXGroup;
children = (
6510160326DB1B460047C3EB /* LeftViewCell.xib */,
6510160126DB1B3C0047C3EB /* RightViewCell.xib */,
307A305C2661CD510020DF8B /* PostCollectionViewCell.swift */,
307A305D2661CD510020DF8B /* PostCollectionViewCell.xib */,
307A306426629B990020DF8B /* AuthorView.swift */,
302BB61B267D7CC800FD74F5 /* PreviewPostVIew.swift */,
651015FD26DB19620047C3EB /* LeftViewCell.swift */,
651015FF26DB19AE0047C3EB /* RightViewCell.swift */,
);
path = Views;
sourceTree = "<group>";
Expand All @@ -222,6 +248,7 @@
30C77CAF266AD69700A888DC /* CurrentUserService.swift */,
304E06C726742BDA00A99128 /* CreatePostService.swift */,
304E06C926742CC500A99128 /* FeedService.swift */,
6510160926DB399B0047C3EB /* CommentsService.swift */,
);
path = Services;
sourceTree = "<group>";
Expand All @@ -235,6 +262,7 @@
304E06CB2674442800A99128 /* UIImage+encodeBase64.swift */,
30B9B93A268CA9E6007B1942 /* UIImage+PixelBuffer.swift */,
304E06CE267468DA00A99128 /* UIColor+Pastel.swift */,
6510160526DB20030047C3EB /* UIView+Rounded.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand All @@ -248,6 +276,8 @@
307A30572661AD540020DF8B /* User.swift */,
30C77CB3266AF47300A888DC /* Credentials.swift */,
30C77CB5266AF48300A888DC /* CurrentUser.swift */,
651015F926DB17D40047C3EB /* Comment.swift */,
651015FB26DB18090047C3EB /* Author.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -406,7 +436,9 @@
E021985323FA35E20025C28E /* LaunchScreen.storyboard in Resources */,
302BB620267E316900FD74F5 /* PostInputViewController.xib in Resources */,
E021985023FA35E20025C28E /* Assets.xcassets in Resources */,
6510160226DB1B3C0047C3EB /* RightViewCell.xib in Resources */,
E021984E23FA35E00025C28E /* Main.storyboard in Resources */,
6510160426DB1B460047C3EB /* LeftViewCell.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -431,6 +463,7 @@
302B5845267E658E007133E6 /* HttpResponse.swift in Sources */,
302B584A267E658E007133E6 /* RestClient.swift in Sources */,
302B5848267E658E007133E6 /* HttpClient.swift in Sources */,
6510160626DB20030047C3EB /* UIView+Rounded.swift in Sources */,
30B9B93D268CB063007B1942 /* NudityChecker.swift in Sources */,
30BC8B9D2662ACBC00F7E6A5 /* ImageLoader.swift in Sources */,
302B5859267E720B007133E6 /* ResponseError.swift in Sources */,
Expand All @@ -439,23 +472,29 @@
304E06C626741A5100A99128 /* UIColor+theme.swift in Sources */,
304E06C826742BDA00A99128 /* CreatePostService.swift in Sources */,
E021984723FA35E00025C28E /* AppDelegate.swift in Sources */,
651015FE26DB19620047C3EB /* LeftViewCell.swift in Sources */,
30337955267536980066D94A /* PostInputViewController+CLLocationManagerDelegate.swift in Sources */,
6510160826DB2EF60047C3EB /* FeedCollectionViewController+PostCollectionViewCellDelegate.swift in Sources */,
307A30562661AD480020DF8B /* Image.swift in Sources */,
307A30582661AD540020DF8B /* User.swift in Sources */,
302B5849267E658E007133E6 /* RequestError.swift in Sources */,
302B5846267E658E007133E6 /* AmacaConfig.swift in Sources */,
302BB61C267D7CC800FD74F5 /* PreviewPostVIew.swift in Sources */,
3033795D267537B40066D94A /* FeedCollectionViewController+UICollectionViewDelegateFlowLayout .swift in Sources */,
651015FC26DB18090047C3EB /* Author.swift in Sources */,
651015FA26DB17D40047C3EB /* Comment.swift in Sources */,
30BC8BA82662CEBA00F7E6A5 /* Checksum.swift in Sources */,
30FD0E722659645A006E309A /* Faker.swift in Sources */,
30B9B939268CA989007B1942 /* Nudity.mlmodel in Sources */,
30337957267536E30066D94A /* FeedCollectionViewController+UICollectionViewDelegate.swift in Sources */,
307A305E2661CD510020DF8B /* PostCollectionViewCell.swift in Sources */,
302BB626267E447900FD74F5 /* PostInputViewController+UITextFieldDelegate.swift in Sources */,
6510160A26DB399B0047C3EB /* CommentsService.swift in Sources */,
30BC8BA02662B8A700F7E6A5 /* StorageType.swift in Sources */,
307A305B2661B7A20020DF8B /* FeedCollectionViewController.swift in Sources */,
304E06CC2674442800A99128 /* UIImage+encodeBase64.swift in Sources */,
30BC8BA62662C02300F7E6A5 /* CacheImage.swift in Sources */,
6510160026DB19AE0047C3EB /* RightViewCell.swift in Sources */,
302B5847267E658E007133E6 /* StatusCode.swift in Sources */,
302B584B267E658E007133E6 /* RequestBuilder.swift in Sources */,
307A306526629B990020DF8B /* AuthorView.swift in Sources */,
Expand All @@ -472,6 +511,7 @@
30B9B93B268CA9E6007B1942 /* UIImage+PixelBuffer.swift in Sources */,
303379592675371C0066D94A /* FeedCollectionViewController+UICollectionViewDataSource .swift in Sources */,
304E06CA26742CC500A99128 /* FeedService.swift in Sources */,
651015F826DB17460047C3EB /* CommentsViewController.swift in Sources */,
302BB61F267E316900FD74F5 /* PostInputViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
68 changes: 68 additions & 0 deletions Secretly/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,71 @@
</objects>
<point key="canvasLocation" x="2073.913043478261" y="135.9375"/>
</scene>
<!--Comments View Controller-->
<scene sceneID="2qh-XX-RId">
<objects>
<viewController storyboardIdentifier="CommentsViewController" id="0iC-b6-UeU" customClass="CommentsViewController" customModule="Secretly" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="pr2-cd-qab">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ML2-ne-qzp">
<rect key="frame" x="0.0" y="798" width="414" height="64"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="249" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your message" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="KLE-X8-A8a">
<rect key="frame" x="16" y="12" width="330" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="pgJ-vB-Tb0"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2zm-2Q-AL1">
<rect key="frame" x="362" y="17" width="36" height="30"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<state key="normal" title="Send"/>
<connections>
<action selector="sendComment:" destination="0iC-b6-UeU" eventType="touchUpInside" id="oRt-ih-gwA"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="groupTableViewBackgroundColor"/>
<constraints>
<constraint firstItem="KLE-X8-A8a" firstAttribute="leading" secondItem="ML2-ne-qzp" secondAttribute="leading" constant="16" id="9cm-85-jMI"/>
<constraint firstItem="2zm-2Q-AL1" firstAttribute="leading" secondItem="KLE-X8-A8a" secondAttribute="trailing" constant="16" id="GpD-OU-uED"/>
<constraint firstAttribute="height" constant="64" id="Hhc-po-m9U"/>
<constraint firstItem="KLE-X8-A8a" firstAttribute="centerY" secondItem="ML2-ne-qzp" secondAttribute="centerY" id="RTs-uw-axP"/>
<constraint firstAttribute="trailing" secondItem="2zm-2Q-AL1" secondAttribute="trailing" constant="16" id="SLf-iB-Xic"/>
<constraint firstItem="2zm-2Q-AL1" firstAttribute="centerY" secondItem="ML2-ne-qzp" secondAttribute="centerY" id="vOt-wE-60z"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="aIu-KY-EoR">
<rect key="frame" x="0.0" y="44" width="414" height="754"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableView>
</subviews>
<viewLayoutGuide key="safeArea" id="AQJ-3T-5sn"/>
<color key="backgroundColor" systemColor="groupTableViewBackgroundColor"/>
<constraints>
<constraint firstItem="AQJ-3T-5sn" firstAttribute="trailing" secondItem="aIu-KY-EoR" secondAttribute="trailing" id="5R1-h5-TGF"/>
<constraint firstItem="aIu-KY-EoR" firstAttribute="top" secondItem="AQJ-3T-5sn" secondAttribute="top" id="622-Wi-h2f"/>
<constraint firstItem="ML2-ne-qzp" firstAttribute="leading" secondItem="AQJ-3T-5sn" secondAttribute="leading" id="N73-FI-28U"/>
<constraint firstItem="ML2-ne-qzp" firstAttribute="trailing" secondItem="AQJ-3T-5sn" secondAttribute="trailing" id="OUD-Fr-Erh"/>
<constraint firstItem="aIu-KY-EoR" firstAttribute="leading" secondItem="AQJ-3T-5sn" secondAttribute="leading" id="SXH-s3-zQ8"/>
<constraint firstItem="AQJ-3T-5sn" firstAttribute="bottom" secondItem="ML2-ne-qzp" secondAttribute="bottom" id="dTO-eb-mJJ"/>
<constraint firstItem="ML2-ne-qzp" firstAttribute="top" secondItem="aIu-KY-EoR" secondAttribute="bottom" id="qtE-u4-qOl"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="aOq-oY-4kC"/>
<connections>
<outlet property="commentTextField" destination="KLE-X8-A8a" id="vLu-LS-oeO"/>
<outlet property="tableView" destination="aIu-KY-EoR" id="ARO-7w-d2f"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="9Ab-wT-T0q" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2074" y="879"/>
</scene>
</scenes>
<resources>
<image name="logo-white" width="256" height="256"/>
Expand All @@ -182,6 +247,9 @@
<namedColor name="Champagne pink">
<color red="0.85882352941176465" green="0.792156862745098" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<systemColor name="groupTableViewBackgroundColor">
<color red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="secondaryLabelColor">
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
Expand Down
17 changes: 17 additions & 0 deletions Secretly/Extensions/UIView+Rounded.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// UIView+Rounded.swift
// Secretly
//
// Created by Victor Aceves on 22/09/21.
// Copyright © 2021 3zcurdia. All rights reserved.
//

import UIKit

extension UIView{
func rounded(radius: CGFloat) {
self.layer.cornerRadius = radius
self.clipsToBounds = true
}
}

14 changes: 14 additions & 0 deletions Secretly/Models/Author.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Author.swift
// Secretly
//
// Created by Victor Aceves on 28/08/21.
// Copyright © 2021 3zcurdia. All rights reserved.
//

import Foundation

struct Author: Codable {
var name: String
let avatarUrl: String
}
31 changes: 31 additions & 0 deletions Secretly/Models/Comment.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// Comment.swift
// Secretly
//
// Created by Victor Aceves on 28/08/21.
// Copyright © 2021 3zcurdia. All rights reserved.
//

import Foundation

struct Comment: Restable {
var id: Int?
let content: String
let createdAt: Date?
let updatedAt: Date?
var author: Author?

init(content: String) {
self.id = nil
self.content = content
self.createdAt = nil
self.updatedAt = nil
self.author = nil
}

func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(content, forKey: .content)
}

}
Loading