Skip to content

Commit

Permalink
Merge pull request #186 from pietrocaselani/prepare_test_flight
Browse files Browse the repository at this point in the history
Preparing to Test Flight
  • Loading branch information
pietrocaselani authored Apr 30, 2019
2 parents a1d9515 + b869415 commit bc9dd8f
Show file tree
Hide file tree
Showing 66 changed files with 849 additions and 330 deletions.
76 changes: 76 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
version: 2

jobs:
build-and-test:
macos:
xcode: '10.1.0'
environment:
LANG: en_US.UTF-8
steps:
- checkout
- restore_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
- restore_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
- run:
name: Setup build dependencies
command: bash setup.sh
- save_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- save_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
paths:
- Pods
- run:
name: Build and run tests
command: bundle exec fastlane lint
# Collect XML test results data to show in the UI,
# and save the same XML files under test-results folder
# in the Artifacts tab
- store_test_results:
path: reports/
- store_test_results:
path: test_output/report.xml
- store_artifacts:
path: /tmp/test-results
destination: scan-test-results
- store_artifacts:
path: ~/Library/Logs/scan
destination: scan-logs
beta-release:
macos:
xcode: '10.1.0'
environment:
LANG: en_US.UTF-8
steps:
- checkout
- restore_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
- restore_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
- run:
name: Setup build dependencies
command: bash setup.sh
- save_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- save_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
paths:
- Pods
- run:
name: Release to Test Flight
command: bundle exec fastlane beta

workflows:
version: 2
build-test-deploy:
jobs:
- build-and-test
- beta-release:
filters:
branches:
only: master
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tap 'blender/homebrew-tap'
brew 'rome'
brew 'swiftlint'
brew 'sonar-scanner'
brew 'tailor'
brew 'swiftformat'
60 changes: 39 additions & 21 deletions CouchTracker.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,48 +1,75 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"idiom" : "iphone",
"filename" : "40.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"idiom" : "iphone",
"filename" : "60.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "58.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"idiom" : "iphone",
"filename" : "87.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "80.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "120.png",
"scale" : "3x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"size" : "60x60",
"filename" : "57.png",
"scale" : "1x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "114.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "120.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "180.png",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "1024.png",
"scale" : "1x"
}
],
Expand Down
6 changes: 6 additions & 0 deletions CouchTracker/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
2 changes: 0 additions & 2 deletions CouchTracker/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Expand Down
6 changes: 4 additions & 2 deletions CouchTrackerApp/Persistence/Realm/RealmAdapters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ extension EpisodeIdsRealm {
}

public extension EpisodeIds {
public func toRealm() -> EpisodeIdsRealm {
func toRealm() -> EpisodeIdsRealm {
let entity = EpisodeIdsRealm()

entity.trakt = trakt
Expand Down Expand Up @@ -217,7 +217,8 @@ extension EpisodeEntityRealm {
overview: overview,
number: number,
season: season,
firstAired: firstAired)
firstAired: firstAired,
absoluteNumber: absoluteNumber.value)
}
}

Expand All @@ -232,6 +233,7 @@ extension EpisodeEntity {
entity.number = number
entity.season = season
entity.firstAired = firstAired
entity.absoluteNumber.value = absoluteNumber

return entity
}
Expand Down
19 changes: 13 additions & 6 deletions CouchTrackerApp/Show/Episode/ShowEpisodeView.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Cartography

public class ShowEpisodeView: View {
public final class ShowEpisodeView: View {
public var didTouchOnPreview: (() -> Void)?
public var didTouchOnWatch: (() -> Void)?

Expand Down Expand Up @@ -49,10 +49,16 @@ public class ShowEpisodeView: View {
return label
}()

public let watchButton: UIButton = {
let button = UIButton()
button.addTarget(self, action: #selector(didTapOnWatch), for: .touchUpInside)
return button
public let seasonAndNumberLabel: UILabel = {
let label = UILabel()
label.textColor = Colors.Text.secondaryTextColor
return label
}()

public lazy var watchButton: LoadingButton = {
let view = LoadingButton()
view.button.addTarget(self, action: #selector(didTapOnWatch), for: .touchUpInside)
return view
}()

// Private Views
Expand All @@ -70,7 +76,7 @@ public class ShowEpisodeView: View {

private lazy var contentStackView: UIStackView = {
let subviews = [previewImageView, titleLabel, overviewLabel,
releaseDateLabel, watchedAtLabel, watchButton]
releaseDateLabel, seasonAndNumberLabel, watchedAtLabel, watchButton]
let stackView = UIStackView(arrangedSubviews: subviews)

let spacing: CGFloat = 20
Expand All @@ -81,6 +87,7 @@ public class ShowEpisodeView: View {
stackView.distribution = .equalSpacing
stackView.layoutMargins = UIEdgeInsets(top: spacing, left: spacing, bottom: spacing, right: spacing)
stackView.isLayoutMarginsRelativeArrangement = true
stackView.isUserInteractionEnabled = true

return stackView
}()
Expand Down
13 changes: 11 additions & 2 deletions CouchTrackerApp/Show/Episode/ShowEpisodeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,21 @@ final class ShowEpisodeViewController: UIViewController {
self?.handleWatch()
}

episodeView.didTouchOnPreview = {
print("Preview!!!")
}

presenter.viewDidLoad()
}

private func handleWatch() {
presenter.handleWatch()
.observeOn(schedulers.mainScheduler)
.subscribe { [weak self] error in
.do(onSubscribe: { [weak self] in
self?.episodeView.watchButton.isLoading = true
}, onDispose: { [weak self] in
self?.episodeView.watchButton.isLoading = false
}).subscribe { [weak self] error in
self?.handleSync(error: error)
}.disposed(by: disposeBag)
}
Expand Down Expand Up @@ -78,12 +86,13 @@ final class ShowEpisodeViewController: UIViewController {
episodeView.overviewLabel.text = episode.episode.overview ?? "No overview"
episodeView.releaseDateLabel.text = episode.episode.firstAired?.shortString() ?? "Unknown".localized
episodeView.watchedAtLabel.text = episode.lastWatched?.shortString() ?? "Unwatched"
episodeView.seasonAndNumberLabel.text = episode.episode.seasonAndNumberFormatted()

let buttonTitle = episode.lastWatched == nil ?
R.string.localizable.addToHistory() :
R.string.localizable.removeFromHistory()

episodeView.watchButton.setTitle(buttonTitle, for: .normal)
episodeView.watchButton.button.setTitle(buttonTitle, for: .normal)
}

private func handleViewState(_ viewState: ShowEpisodeViewState) {
Expand Down
Loading

0 comments on commit bc9dd8f

Please sign in to comment.