Bookmark clean up

This commit is contained in:
Chris Li 2016-07-18 11:04:45 -04:00
parent b5232b2df6
commit 79e09c74a9
3 changed files with 0 additions and 177 deletions

View File

@ -1,58 +0,0 @@
//
// BookmarkOverlayVC.swift
// Kiwix
//
// Created by Chris Li on 1/6/16.
// Copyright © 2016 Chris. All rights reserved.
//
import UIKit
class BookmarkHUDVC: UIViewController {
@IBOutlet weak var dimView: UIView!
@IBOutlet weak var blurView: UIVisualEffectView!
@IBOutlet weak var stackView: UIStackView!
@IBOutlet weak var starImageView: UIImageView!
@IBOutlet weak var label: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
blurView.layer.borderColor = UIColor.blackColor().colorWithAlphaComponent(0.4).CGColor
blurView.layer.borderWidth = 1.0
blurView.transform = CGAffineTransformMakeScale(0.5, 0.5)
stackView.transform = CGAffineTransformMakeScale(0.5, 0.5)
}
func show(isAddingBookmark: Bool) {
label.text = isAddingBookmark ? LocalizedStrings.bookmarked : LocalizedStrings.removed
starImageView.highlighted = isAddingBookmark
UIView.animateWithDuration(0.2, delay: 0.0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0.0, options: .CurveEaseInOut, animations: { () -> Void in
self.blurView.transform = CGAffineTransformIdentity
self.stackView.transform = CGAffineTransformIdentity
self.dimView.alpha = 0.6
}) { (completed) -> Void in
NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: #selector(BookmarkHUDVC.hide), userInfo: nil, repeats: false)
}
}
func hide() {
UIView.animateWithDuration(0.1, delay: 0.0, options: .CurveEaseInOut, animations: { () -> Void in
self.blurView.transform = CGAffineTransformMakeScale(0.001, 0.001)
self.stackView.transform = CGAffineTransformMakeScale(0.001, 0.001)
self.dimView.alpha = 0.0
}) { (completed) -> Void in
self.blurView.hidden = true
self.stackView.hidden = true
self.view.removeFromSuperview()
self.removeFromParentViewController()
}
}
}
extension LocalizedStrings {
class var bookmarked: String {return NSLocalizedString("Bookmarked", comment: "")}
class var removed: String {return NSLocalizedString("Removed", comment: "")}
}

View File

@ -93,119 +93,6 @@
</objects>
<point key="canvasLocation" x="1853" y="1137"/>
</scene>
<!--BookmarkHUDVC-->
<scene sceneID="PBK-Zl-kOY">
<objects>
<viewController storyboardIdentifier="BookmarkHUDVC" id="tjC-SA-XHM" customClass="BookmarkHUDVC" customModule="Kiwix" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="uB6-Td-Hg2"/>
<viewControllerLayoutGuide type="bottom" id="JAv-Yv-juz"/>
</layoutGuides>
<view key="view" userInteractionEnabled="NO" contentMode="scaleToFill" id="4UF-cV-U0r">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view alpha="0.0" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sko-5a-blt">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</view>
<visualEffectView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wP8-9U-0HN">
<rect key="frame" x="276" y="198" width="47" height="42"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="Zeh-zn-rD9">
<rect key="frame" x="0.0" y="0.0" width="47" height="42"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<visualEffectView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lxd-sP-jhH">
<rect key="frame" x="0.0" y="0.0" width="47" height="42"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="BUM-P2-Nel">
<rect key="frame" x="0.0" y="0.0" width="47" height="42"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</view>
<vibrancyEffect>
<blurEffect style="light"/>
</vibrancyEffect>
</visualEffectView>
</subviews>
<constraints>
<constraint firstItem="lxd-sP-jhH" firstAttribute="leading" secondItem="Zeh-zn-rD9" secondAttribute="leading" id="2F1-sU-0Xf"/>
<constraint firstAttribute="bottom" secondItem="lxd-sP-jhH" secondAttribute="bottom" id="UDt-iG-8BW"/>
<constraint firstAttribute="trailing" secondItem="lxd-sP-jhH" secondAttribute="trailing" id="goK-40-JHI"/>
<constraint firstItem="lxd-sP-jhH" firstAttribute="top" secondItem="Zeh-zn-rD9" secondAttribute="top" id="x5P-2b-K18"/>
</constraints>
</view>
<constraints>
<constraint firstAttribute="width" constant="240" id="lTb-76-sqh"/>
<constraint firstAttribute="height" constant="128" id="vPM-2q-Z8u"/>
</constraints>
<blurEffect style="extraLight"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<variation key="default">
<mask key="constraints">
<exclude reference="lTb-76-sqh"/>
<exclude reference="vPM-2q-Z8u"/>
</mask>
</variation>
</visualEffectView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="Eyz-t1-ycg">
<rect key="frame" x="280.5" y="204" width="39" height="30"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Star" highlightedImage="StarHighlighted" translatesAutoresizingMaskIntoConstraints="NO" id="Mi8-s2-8u5">
<rect key="frame" x="0.0" y="3" width="24" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="AdX-U6-c4z"/>
<constraint firstAttribute="width" secondItem="Mi8-s2-8u5" secondAttribute="height" multiplier="1:1" id="z6D-p6-X7U"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wu8-QM-pzh">
<rect key="frame" x="34" y="0.0" width="5" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="1JQ-pm-adG"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.69999999999999996" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="wP8-9U-0HN" firstAttribute="bottom" secondItem="JAv-Yv-juz" secondAttribute="top" multiplier="0.4" id="3OF-Wl-1dY"/>
<constraint firstItem="wP8-9U-0HN" firstAttribute="top" secondItem="Eyz-t1-ycg" secondAttribute="bottom" constant="16" id="79p-2m-KJs"/>
<constraint firstItem="Eyz-t1-ycg" firstAttribute="top" secondItem="wP8-9U-0HN" secondAttribute="top" id="9jk-M8-StF"/>
<constraint firstItem="wP8-9U-0HN" firstAttribute="height" secondItem="Eyz-t1-ycg" secondAttribute="height" multiplier="1.4" id="Ary-Lx-WO2"/>
<constraint firstItem="JAv-Yv-juz" firstAttribute="top" secondItem="sko-5a-blt" secondAttribute="bottom" id="CVc-ka-PsW"/>
<constraint firstItem="sko-5a-blt" firstAttribute="leading" secondItem="4UF-cV-U0r" secondAttribute="leadingMargin" constant="-20" id="T9k-li-0gP"/>
<constraint firstItem="wP8-9U-0HN" firstAttribute="width" secondItem="Eyz-t1-ycg" secondAttribute="width" multiplier="1.2" id="ZTx-iy-irF"/>
<constraint firstItem="sko-5a-blt" firstAttribute="top" secondItem="uB6-Td-Hg2" secondAttribute="bottom" constant="-20" id="eVR-at-Hwa"/>
<constraint firstAttribute="trailingMargin" secondItem="sko-5a-blt" secondAttribute="trailing" constant="-20" id="gPq-08-6AX"/>
<constraint firstItem="Eyz-t1-ycg" firstAttribute="centerX" secondItem="4UF-cV-U0r" secondAttribute="centerX" id="hef-sh-bTu"/>
<constraint firstItem="Eyz-t1-ycg" firstAttribute="centerY" secondItem="wP8-9U-0HN" secondAttribute="centerY" id="wTZ-6h-6BO"/>
<constraint firstItem="wP8-9U-0HN" firstAttribute="centerX" secondItem="4UF-cV-U0r" secondAttribute="centerX" id="y5g-lX-szS"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="79p-2m-KJs"/>
<exclude reference="9jk-M8-StF"/>
</mask>
</variation>
</view>
<connections>
<outlet property="blurView" destination="wP8-9U-0HN" id="4wa-xA-wFE"/>
<outlet property="dimView" destination="sko-5a-blt" id="DHu-Vy-BrI"/>
<outlet property="label" destination="wu8-QM-pzh" id="6AU-IY-4Ow"/>
<outlet property="stackView" destination="Eyz-t1-ycg" id="dta-TC-oH9"/>
<outlet property="starImageView" destination="Mi8-s2-8u5" id="pPa-PP-KKL"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="mm8-aW-1rt" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3519" y="723"/>
</scene>
<!--Table Of Contents Controller-->
<scene sceneID="sFA-xU-ByH">
<objects>
@ -681,7 +568,5 @@
<image name="BookmarkAdded" width="348" height="331"/>
<image name="BookmarkRemoved" width="348" height="331"/>
<image name="DownArrow" width="21" height="21"/>
<image name="Star" width="21" height="20"/>
<image name="StarHighlighted" width="21" height="20"/>
</resources>
</document>

View File

@ -86,7 +86,6 @@
971A105B1D022DAD007FC62C /* LibraryOnlineTBVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971A10561D022DAD007FC62C /* LibraryOnlineTBVC.swift */; };
971A105C1D022DAD007FC62C /* LibraryTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971A10571D022DAD007FC62C /* LibraryTabBarController.swift */; };
971A10601D022DF2007FC62C /* LanguageTBVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971A105F1D022DF2007FC62C /* LanguageTBVC.swift */; };
971A106A1D022E15007FC62C /* BookmarkHUDVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971A10691D022E15007FC62C /* BookmarkHUDVC.swift */; };
971A106C1D022E50007FC62C /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971A106B1D022E50007FC62C /* Utilities.swift */; };
971A106F1D022E62007FC62C /* DownloadProgress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971A106D1D022E62007FC62C /* DownloadProgress.swift */; };
971A10701D022E62007FC62C /* Network.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971A106E1D022E62007FC62C /* Network.swift */; };
@ -330,7 +329,6 @@
971A10561D022DAD007FC62C /* LibraryOnlineTBVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LibraryOnlineTBVC.swift; path = "Kiwix-iOS/Controller/LibraryOnlineTBVC.swift"; sourceTree = SOURCE_ROOT; };
971A10571D022DAD007FC62C /* LibraryTabBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LibraryTabBarController.swift; path = "Kiwix-iOS/Controller/LibraryTabBarController.swift"; sourceTree = SOURCE_ROOT; };
971A105F1D022DF2007FC62C /* LanguageTBVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LanguageTBVC.swift; path = "Kiwix-iOS/Controller/LanguageTBVC.swift"; sourceTree = SOURCE_ROOT; };
971A10691D022E15007FC62C /* BookmarkHUDVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BookmarkHUDVC.swift; path = "Kiwix-iOS/Controller/BookmarkHUDVC.swift"; sourceTree = SOURCE_ROOT; };
971A106B1D022E50007FC62C /* Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Utilities.swift; path = "Kiwix-iOS/Model/Utilities.swift"; sourceTree = SOURCE_ROOT; };
971A106D1D022E62007FC62C /* DownloadProgress.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DownloadProgress.swift; path = "Kiwix-iOS/Model/DownloadProgress.swift"; sourceTree = SOURCE_ROOT; };
971A106E1D022E62007FC62C /* Network.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Network.swift; path = "Kiwix-iOS/Model/Network.swift"; sourceTree = SOURCE_ROOT; };
@ -952,7 +950,6 @@
97E108221C5D5A0D00E27FD3 /* Search */,
9771DC4B1C37278E009ECFF0 /* Setting */,
97D55EF51D2075180081B523 /* TableOfContentsController.swift */,
971A10691D022E15007FC62C /* BookmarkHUDVC.swift */,
97A7017E1D2C59CA00AAE2D8 /* GetStartedController.swift */,
);
name = Controllers;
@ -1663,7 +1660,6 @@
971A10341D022AEC007FC62C /* BookmarkTBVC.swift in Sources */,
975227A01D020C00001D1DDE /* resourceTools.cpp in Sources */,
971A10601D022DF2007FC62C /* LanguageTBVC.swift in Sources */,
971A106A1D022E15007FC62C /* BookmarkHUDVC.swift in Sources */,
971A106C1D022E50007FC62C /* Utilities.swift in Sources */,
970E68BC1D3809A3001E8514 /* MainControllerLoading.swift in Sources */,
973DD4281D36E3E4009D45DB /* SettingSingleSwitchTBVC.swift in Sources */,