Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4f3277f
Implement basic client
3zcurdia Oct 5, 2019
b235a3f
Implement RequestBuilder with TDD
3zcurdia Oct 5, 2019
55f061f
RestClient basic implementations
3zcurdia Oct 11, 2019
ed41a35
Include gitignore into proyect
3zcurdia Oct 11, 2019
011a0d5
Add cocoapods with DVR pod
3zcurdia Oct 11, 2019
98023b8
Add tests for RestClient and implement endpoints
3zcurdia Oct 12, 2019
5335fa4
Refactor by implementing serializer
3zcurdia Oct 12, 2019
585b87b
Implement views with XIB and programatic views
3zcurdia Oct 12, 2019
acaf37b
Replace spagetti code with RestClient
3zcurdia Oct 18, 2019
fb29e46
Replace TableViewController with CollectionView through delegates
3zcurdia Oct 19, 2019
de0cedb
Implement post creation with images using base64
3zcurdia Oct 19, 2019
484cec9
Organize view controllers and utils in groups
3zcurdia Oct 19, 2019
0f14a6b
Refresh control and create account and store token
3zcurdia Oct 19, 2019
13e9ae0
create post service
3zcurdia Nov 9, 2019
acd4af8
Implement storage layer
3zcurdia Nov 9, 2019
eaa20ba
Implement cache on images through checksum and image store
3zcurdia Nov 9, 2019
655fba5
Implement Keychain wrapper
3zcurdia Nov 9, 2019
038a2ef
Implement camera
3zcurdia Nov 16, 2019
01d3456
Upload images from camera and implement NotificationCenter
3zcurdia Nov 16, 2019
b4b15a7
Se cambio el tipo de camara a uno más general
jhovan Nov 23, 2019
e3eb34e
Implement call method
jhovan Feb 13, 2020
be6fdea
Implement like feature
jhovan Feb 13, 2020
636a9db
Add CreateLikeServiceTest
jhovan Feb 13, 2020
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
140 changes: 140 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@

# Created by https://www.gitignore.io/api/osx,swift,xcode,cocoapods
# Edit at https://www.gitignore.io/?templates=osx,swift,xcode,cocoapods

### CocoaPods ###
## CocoaPods GitIgnore Template

# CocoaPods - Only use to conserve bandwidth / Save time on Pushing
# - Also handy if you have a large number of dependant pods
# - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGNORE THE LOCK FILE
Pods/

### OSX ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
.build/
# Add this line if you want to avoid checking in Xcode SPM integration.
# .swiftpm/xcode

# CocoaPods
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# Pods/
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# Accio dependency management
Dependencies/
.accio/

# fastlane
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

### Xcode ###
# Xcode
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)

## Xcode Patch
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno

### Xcode Patch ###
**/xcshareddata/WorkspaceSettings.xcsettings

# End of https://www.gitignore.io/api/osx,swift,xcode,cocoapods
14 changes: 14 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'

target 'fakestagram' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for fakestagram
pod 'SAMKeychain'

target 'fakestagramTests' do
inherit! :search_paths
pod 'DVR'
end
end
20 changes: 20 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
PODS:
- DVR (2.0.0)
- SAMKeychain (1.5.3)

DEPENDENCIES:
- DVR
- SAMKeychain

SPEC REPOS:
trunk:
- DVR
- SAMKeychain

SPEC CHECKSUMS:
DVR: 062c287b9dc613a84120e44640176e4ef3ecf943
SAMKeychain: 483e1c9f32984d50ca961e26818a534283b4cd5c

PODFILE CHECKSUM: 02c21c317ba9be4fdecdfff242f3fa20e9b269bd

COCOAPODS: 1.8.3
369 changes: 353 additions & 16 deletions fakestagram.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>classNames</key>
<dict>
<key>CheckSumTest</key>
<dict>
<key>testPerformanceExample()</key>
<dict>
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>6.55e-05</real>
<key>baselineIntegrationDisplayName</key>
<string>Local Baseline</string>
</dict>
</dict>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>runDestinationsByUUID</key>
<dict>
<key>4B2163FF-53B3-4A2D-B0E0-0AF6257FC48D</key>
<dict>
<key>localComputer</key>
<dict>
<key>busSpeedInMHz</key>
<integer>100</integer>
<key>cpuCount</key>
<integer>1</integer>
<key>cpuKind</key>
<string>Intel Core i7</string>
<key>cpuSpeedInMHz</key>
<integer>2900</integer>
<key>logicalCPUCoresPerPackage</key>
<integer>8</integer>
<key>modelCode</key>
<string>MacBookPro14,3</string>
<key>physicalCPUCoresPerPackage</key>
<integer>4</integer>
<key>platformIdentifier</key>
<string>com.apple.platform.macosx</string>
</dict>
<key>targetArchitecture</key>
<string>x86_64</string>
<key>targetDevice</key>
<dict>
<key>modelCode</key>
<string>iPhone12,1</string>
<key>platformIdentifier</key>
<string>com.apple.platform.iphonesimulator</string>
</dict>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "F7219896-2365-4801-9BE6-68A14F0B6FA0"
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>fakestagram.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>4</integer>
</dict>
</dict>
</dict>
Expand Down
10 changes: 10 additions & 0 deletions fakestagram.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions fakestagram.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
12 changes: 12 additions & 0 deletions fakestagram/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
StorageType.permanent.ensureExists()
StorageType.cache.ensureExists()
loadOrCreateAccount()
return true
}

Expand All @@ -30,4 +33,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}

func loadOrCreateAccount() {
if Credentials.apiToken.get() != nil { return }
let account = Account(id: nil, name: "José Gallardo", deviceNumber: UIDevice.identifier, deviceModel: UIDevice.modelName)
let client = RestClient<Account>(client: Client.fakestagram, basePath: "/api/v1/accounts")
client.create(account) { account in
guard let account = account, let idx = account.id else { return }
_ = Credentials.apiToken.set(value: idx)
}
}
}
21 changes: 21 additions & 0 deletions fakestagram/Assets.xcassets/spacecat.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "spacecat.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions fakestagram/Assets.xcassets/test_picture.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Black_from_a_camera.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading