Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Merged
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
11 changes: 11 additions & 0 deletions Classes/Login/LoginSplashViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ final class LoginSplashViewController: UIViewController, GitHubSessionListener {
private var client: Client!
private var sessionManager: GitHubSessionManager!

@IBOutlet weak var splashView: SplashView!
@IBOutlet weak var signInButton: UIButton!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
private weak var safariController: SFSafariViewController?
Expand Down Expand Up @@ -62,6 +63,12 @@ final class LoginSplashViewController: UIViewController, GitHubSessionListener {
sessionManager.addListener(listener: self)
signInButton.layer.cornerRadius = Styles.Sizes.eventGutter
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

setupSplashView()
}

// MARK: Public API

Expand Down Expand Up @@ -137,6 +144,10 @@ final class LoginSplashViewController: UIViewController, GitHubSessionListener {
dismiss: true
)
}

private func setupSplashView() {
splashView.configureView()
}

// MARK: GitHubSessionListener

Expand Down
27 changes: 10 additions & 17 deletions Classes/Login/OauthLogin.storyboard
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="bA6-il-lQA">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="bA6-il-lQA">
<device id="retina3_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
<array key="AvenirNext.ttc">
<string>AvenirNext-DemiBold</string>
</array>
</customFonts>
<scenes>
<!--Login Splash View Controller-->
<scene sceneID="yQn-wv-qWF">
Expand All @@ -37,25 +32,25 @@
<action selector="onSignInButton:" destination="bA6-il-lQA" eventType="touchUpInside" id="Sk4-NF-4Oh"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splash" translatesAutoresizingMaskIntoConstraints="NO" id="ai9-fN-d9O">
<rect key="frame" x="73" y="98" width="174" height="174"/>
<view userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ai9-fN-d9O" customClass="SplashView" customModule="Freetime" customModuleProvider="target">
<rect key="frame" x="49" y="74" width="222" height="222"/>
<constraints>
<constraint firstAttribute="height" constant="174" id="42V-gr-pfO">
<constraint firstAttribute="height" constant="222" id="42V-gr-pfO">
<variation key="heightClass=compact" constant="140"/>
</constraint>
<constraint firstAttribute="width" constant="174" id="tK6-2i-UMP">
<constraint firstAttribute="width" constant="222" id="tK6-2i-UMP">
<variation key="heightClass=compact" constant="140"/>
</constraint>
</constraints>
</imageView>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Welcome to GitHawk" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cfb-Yp-akO">
<rect key="frame" x="22" y="288" width="276" height="38.5"/>
<rect key="frame" x="22" y="312" width="276" height="38.5"/>
<fontDescription key="fontDescription" name="AvenirNext-DemiBold" family="Avenir Next" pointSize="28"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="An open source app for open source projects." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N6P-rW-9YX">
<rect key="frame" x="32" y="340" width="256" height="42"/>
<rect key="frame" x="32" y="364" width="256" height="42"/>
<constraints>
<constraint firstAttribute="height" constant="42" id="Aeq-jM-Nwc"/>
</constraints>
Expand Down Expand Up @@ -104,14 +99,12 @@
<connections>
<outlet property="activityIndicator" destination="aQ2-N2-0DI" id="aEQ-Lx-iG0"/>
<outlet property="signInButton" destination="joJ-g2-qXR" id="l3F-no-8AX"/>
<outlet property="splashView" destination="ai9-fN-d9O" id="0Bh-h2-8Sv"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="HfT-GH-NEk" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-116" y="137.18140929535232"/>
</scene>
</scenes>
<resources>
<image name="splash" width="174" height="174"/>
</resources>
</document>
82 changes: 82 additions & 0 deletions Classes/Login/SplashView/SplashView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
//
// SplashView.swift
// Freetime
//
// Created by Yury Bogdanov on 25/07/2018.
// Copyright © 2018 Ryan Nystrom. All rights reserved.
//

import UIKit
import SnapKit

final class SplashView: UIView {

// MARK: Private properties

private var birdImageView: UIImageView!
private var branchesImageView: UIImageView!


// MARK: Public API

override init(frame: CGRect) {
super.init(frame: frame)

setupView()
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)

setupView()
}

func configureView() {
addBirdAnimation()
addBranchesAnimation()
}


// MARK: Private API

private func setupView() {
branchesImageView = UIImageView(image: UIImage(named: "splash_branches"))
addSubview(branchesImageView)
branchesImageView.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
}

birdImageView = UIImageView(image: UIImage(named: "splash"))
addSubview(birdImageView)
birdImageView.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview().inset(30)
}
}

private func addBirdAnimation() {
let pulseAnimation = CABasicAnimation(keyPath: "transform.scale")

pulseAnimation.autoreverses = true
pulseAnimation.repeatCount = .infinity
pulseAnimation.fromValue = 1.0
pulseAnimation.toValue = 0.9
pulseAnimation.duration = 2
pulseAnimation.fillMode = kCAFillModeForwards
pulseAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)

birdImageView.layer.add(pulseAnimation, forKey: "scaling")
}

private func addBranchesAnimation() {
let rotateAnimation = CABasicAnimation(keyPath: "transform.rotation")

rotateAnimation.repeatCount = .infinity
rotateAnimation.byValue = 2 * Double.pi
rotateAnimation.duration = 120
rotateAnimation.fillMode = kCAFillModeForwards
rotateAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)

branchesImageView.layer.add(rotateAnimation, forKey: "rotation")
}

}
12 changes: 12 additions & 0 deletions Freetime.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
15245487205DC016005810A6 /* IssueTargetBranchModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15245484205DC016005810A6 /* IssueTargetBranchModel.swift */; };
15245488205DC016005810A6 /* IssueBranchesSectionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15245485205DC016005810A6 /* IssueBranchesSectionController.swift */; };
15245489205DC016005810A6 /* IssueTargetBranchCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15245486205DC016005810A6 /* IssueTargetBranchCell.swift */; };
15F28F992108DBA6006421B6 /* SplashView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15F28F982108DBA6006421B6 /* SplashView.swift */; };
290056F3210028B20046EAE5 /* UIViewController+MenuDone.swift in Sources */ = {isa = PBXBuildFile; fileRef = 290056F2210028B20046EAE5 /* UIViewController+MenuDone.swift */; };
2905AFAB1F7357B40015AE32 /* RepositoryOverviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2905AFAA1F7357B40015AE32 /* RepositoryOverviewViewController.swift */; };
2905AFAD1F7357C50015AE32 /* RepositoryIssuesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2905AFAC1F7357C50015AE32 /* RepositoryIssuesViewController.swift */; };
Expand Down Expand Up @@ -511,6 +512,7 @@
15245484205DC016005810A6 /* IssueTargetBranchModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IssueTargetBranchModel.swift; path = Classes/Issues/Branches/IssueTargetBranchModel.swift; sourceTree = SOURCE_ROOT; };
15245485205DC016005810A6 /* IssueBranchesSectionController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IssueBranchesSectionController.swift; path = Classes/Issues/Branches/IssueBranchesSectionController.swift; sourceTree = SOURCE_ROOT; };
15245486205DC016005810A6 /* IssueTargetBranchCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IssueTargetBranchCell.swift; path = Classes/Issues/Branches/IssueTargetBranchCell.swift; sourceTree = SOURCE_ROOT; };
15F28F982108DBA6006421B6 /* SplashView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashView.swift; sourceTree = "<group>"; };
290056F2210028B20046EAE5 /* UIViewController+MenuDone.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+MenuDone.swift"; sourceTree = "<group>"; };
2905AFAA1F7357B40015AE32 /* RepositoryOverviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepositoryOverviewViewController.swift; sourceTree = "<group>"; };
2905AFAC1F7357C50015AE32 /* RepositoryIssuesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepositoryIssuesViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1025,6 +1027,14 @@
path = "New Group";
sourceTree = "<group>";
};
15F28F972108DB8C006421B6 /* SplashView */ = {
isa = PBXGroup;
children = (
15F28F982108DBA6006421B6 /* SplashView.swift */,
);
path = SplashView;
sourceTree = "<group>";
};
290744B01F250A1D00FD9E48 /* Autocomplete */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1549,6 +1559,7 @@
297AE8581EC0D5C100B44A1F /* Login */ = {
isa = PBXGroup;
children = (
15F28F972108DB8C006421B6 /* SplashView */,
299F4A88204CEDDC004BA4F0 /* Client+AccessToken.swift */,
29416BFA1F113D0A00D03E1A /* LoginSplashViewController.swift */,
29416BF81F1138B700D03E1A /* OauthLogin.storyboard */,
Expand Down Expand Up @@ -2671,6 +2682,7 @@
29B94E6D1FCB472400715D7E /* IssueFileChangesModel.swift in Sources */,
986B87191F2B875800AAB55C /* GithubClient+Search.swift in Sources */,
29C0E7071ECBC6C50051D756 /* GithubClient.swift in Sources */,
15F28F992108DBA6006421B6 /* SplashView.swift in Sources */,
2986B35A1FD30F0B00E3CFC6 /* IssueManagingModel.swift in Sources */,
2981A8A41EFE9FC700E25EF1 /* GithubEmoji.swift in Sources */,
2924C18B20D5B3A100FCFCFF /* LabelMenuCell.swift in Sources */,
Expand Down
18 changes: 18 additions & 0 deletions Resources/Assets.xcassets/splash_branches.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "splash_branches@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "splash_branches@3x.png",
"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.