Skip to content

Commit

Permalink
[feat] Add cache system
Browse files Browse the repository at this point in the history
  • Loading branch information
aktassamet committed Mar 12, 2020
1 parent 3a6448e commit e8d9167
Show file tree
Hide file tree
Showing 40 changed files with 683 additions and 320 deletions.
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.
2 changes: 1 addition & 1 deletion Desk360.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Desk360"
s.version = "1.2.1"
s.version = "1.3.0"
s.summary = "Desk360 iOS SDK"
s.description = <<-DESC
Desk360 iOS SDK [WIP]
Expand Down
3 changes: 2 additions & 1 deletion Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
baseConfigurationReference = 12465B6F602FDAB2046B5612 /* Pods-Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = 553744G5P7;
INFOPLIST_FILE = Example/Info.plist;
Expand All @@ -366,7 +367,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.desk360.example;
PRODUCT_BUNDLE_IDENTIFIER = com.fundev.fitness;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Samcro Fitness Dev";
SWIFT_VERSION = 5.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -61,8 +59,6 @@
ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
57 changes: 42 additions & 15 deletions Example/Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Qiq-v8-5gx">
<device id="retina6_1" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Qiq-v8-5gx">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -18,38 +16,67 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="BCo-TW-dOY">
<rect key="frame" x="151" y="435" width="112" height="80"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="RO1-Eu-8Z9">
<rect key="frame" x="20" y="388" width="374" height="120"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ydt-Nk-7VZ">
<rect key="frame" x="0.0" y="0.0" width="112" height="30"/>
<state key="normal" title="Present Support"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="v9Q-eS-geD">
<rect key="frame" x="0.0" y="0.0" width="374" height="30"/>
<state key="normal" title="show with "/>
<connections>
<action selector="didTapPresentButton:" destination="BYZ-38-t0r" eventType="touchUpInside" id="jKg-Z7-w4d"/>
<action selector="didTapShowWithNullDeviceId:" destination="BYZ-38-t0r" eventType="touchUpInside" id="uUh-RH-exA"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1OE-iy-ea0">
<rect key="frame" x="0.0" y="30" width="374" height="30"/>
<state key="normal" title="Show with json data"/>
<connections>
<action selector="didTapShowWithJsonData:" destination="BYZ-38-t0r" eventType="touchUpInside" id="IG5-0g-666"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jLR-gt-EhV">
<rect key="frame" x="0.0" y="50" width="112" height="30"/>
<rect key="frame" x="0.0" y="60" width="374" height="30"/>
<state key="normal" title="Push Support"/>
<connections>
<action selector="didTapPushButton:" destination="BYZ-38-t0r" eventType="touchUpInside" id="UYZ-co-rXB"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ydt-Nk-7VZ">
<rect key="frame" x="0.0" y="90" width="374" height="30"/>
<state key="normal" title="Show Desk360"/>
<connections>
<action selector="didTapPresentButton:" destination="BYZ-38-t0r" eventType="touchUpInside" id="jKg-Z7-w4d"/>
</connections>
</button>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Test Environment" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oNH-L0-Yau">
<rect key="frame" x="111" y="134" width="262" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="M3B-1s-DIg">
<rect key="frame" x="308" y="129" width="49" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</switch>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="BCo-TW-dOY" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="ayj-uc-jJo"/>
<constraint firstItem="BCo-TW-dOY" firstAttribute="centerY" secondItem="6Tk-OE-BBY" secondAttribute="centerY" id="nFl-qe-tZZ"/>
<constraint firstItem="RO1-Eu-8Z9" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="20" id="4Ij-Aq-W9C"/>
<constraint firstItem="RO1-Eu-8Z9" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="5Jv-zO-LKf"/>
<constraint firstItem="oNH-L0-Yau" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="119" id="MGe-eY-i6z"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="oNH-L0-Yau" secondAttribute="trailing" constant="33" id="QbD-vg-BdK"/>
<constraint firstItem="RO1-Eu-8Z9" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="Tj8-6L-ftY"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="RO1-Eu-8Z9" secondAttribute="trailing" constant="20" id="dU3-As-nqL"/>
<constraint firstItem="oNH-L0-Yau" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="41" id="izH-TA-pB7"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="Ev2-xJ-HNz"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1104" y="-535"/>
<point key="canvasLocation" x="1102.8985507246377" y="-535.04464285714278"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="HEm-mN-lLl">
Expand Down
38 changes: 36 additions & 2 deletions Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,32 @@ import Desk360

final class ViewController: UIViewController {

var jsonObject: [String: Any]? = nil
var deviceId: String?
var environment: Desk360Environment = .test


override func viewDidLoad() {
super.viewDidLoad()

configureDesk360()
}

@IBAction func didTapShowWithJsonData(_ sender: Any) {
jsonObject = [
"app": "Demo App",
"device Id": UIDevice.current.identifierForVendor!.uuidString
]

showDesk360()
}

@IBAction func didTapShowWithNullDeviceId(_ sender: Any) {

}

@IBAction func didTapPresentButton(_ sender: UIButton) {
// Desk360.present(in: self)
Desk360.show(on: self, animated: true)
showDesk360()
}

@IBAction func didTapPushButton(_ sender: UIButton) {
Expand All @@ -32,6 +49,23 @@ final class ViewController: UIViewController {
extension ViewController {

func configureDesk360() {

}

}

// MARK: - Helpers
extension ViewController {

func showDesk360() {
#if DEBUG
let environment: Desk360Environment = .test
#else
let environment: Desk360Environment = .production
#endif
Desk360.start(appId: "oFkDNLOatwreoPZp43EWRhDdbGGBbgi8", environment: environment, language: "en", jsonInfo: jsonObject)
jsonObject = nil
Desk360.show(on: self, animated: true)
}

}
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PODS:
- Alamofire (4.9.1)
- Desk360 (1.0.0):
- Desk360 (1.2.1):
- DeviceKit
- Moya
- Moya (= 13.0.1)
- NVActivityIndicatorView
- PersistenceKit
- SnapKit
Expand Down Expand Up @@ -38,7 +38,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18
Desk360: 6062af8febfac9461b65abc335ae24b77f7307a3
Desk360: f7cf8fa872e1ac9249c21b7ffff2dabdaa507f84
DeviceKit: da103891aa928d89f64ea8dd8aca738c5f3d8ac0
Moya: f4a4b80ff2f8a4ffc208dfb31cd91636622fee6e
NVActivityIndicatorView: d24b7ebcf80af5dcd994adb650e2b6c93379270f
Expand All @@ -48,4 +48,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 80a0853c652863e32bee25d114afaabfec9de1ae

COCOAPODS: 1.8.0
COCOAPODS: 1.9.0
Loading

0 comments on commit e8d9167

Please sign in to comment.