Commit 84d5202c by Dmitriy Stepanets

Added initial model

parent 2719e434
......@@ -12,7 +12,7 @@
<key>OneWeatherNotificationServiceExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>57</integer>
<integer>55</integer>
</dict>
<key>PG (Playground) 1.xcscheme</key>
<dict>
......
......@@ -2,6 +2,9 @@
<Workspace
version = "1.0">
<FileRef
location = "group:InMobiShortsSource/InMobiShortsSource.xcodeproj">
</FileRef>
<FileRef
location = "group:OneWeatherAnalytics/OneWeatherAnalytics.xcodeproj">
</FileRef>
<FileRef
......
......@@ -135,7 +135,7 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
<integer>60</integer>
</dict>
<key>PG (Playground) 1.xcscheme</key>
<dict>
......@@ -268,7 +268,7 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>1</integer>
<integer>61</integer>
</dict>
</dict>
</dict>
......
//
// InMobiShortSource.swift
// InMobiShortsSource
//
// Created by Dmitry Stepanets on 07.06.2021.
//
import Foundation
public class InMobiShortSource {
private static let apiKey = "9b5f4682b74f75cbedb34ee235c988f9"
private static let region = "US"
private static let sdkV = "80000"
public func getShorts(completion: @escaping (_ shorts:[GlanceDetails]) -> Void) {
}
}
//
// InMobiShortsSource.h
// InMobiShortsSource
//
// Created by Dmitry Stepanets on 07.06.2021.
//
#import <Foundation/Foundation.h>
//! Project version number for InMobiShortsSource.
FOUNDATION_EXPORT double InMobiShortsSourceVersionNumber;
//! Project version string for InMobiShortsSource.
FOUNDATION_EXPORT const unsigned char InMobiShortsSourceVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <InMobiShortsSource/PublicHeader.h>
<?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>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>
//
// Glance.swift
// InMobiShortsSource
//
// Created by Dmitry Stepanets on 07.06.2021.
//
import Foundation
enum GlanceUpdateType: String, Codable {
case ADD = "ADD"
case REMOVE = "REMOVE"
}
struct Glance: Codable {
let glanceId: String
let updatedAtInSecs: TimeInterval
let glanceType: String
let updateType: GlanceUpdateType
}
//
// GlanceDetails.swift
// InMobiShortsSource
//
// Created by Dmitry Stepanets on 07.06.2021.
//
import Foundation
public struct GlanceIteractionDetails: Codable {
let likeCount: Int
let shareCount: Int
}
public struct GlanceDetails: Codable {
public let id: String
public let image: GlanceImage
public let updatedAtInSecs: TimeInterval
public let startsAtInSecs: TimeInterval
public let endsAtInSecs: TimeInterval
public let shareURL: URL?
public let peekData: PeekData
public let peek: Peek
public let glanceIteractionDetails: GlanceIteractionDetails
}
//
// GlanceImage.swift
// InMobiShortsSource
//
// Created by Dmitry Stepanets on 07.06.2021.
//
import Foundation
public struct GlanceImageFormat: Codable {
let width:Int
let height:Int
let url:URL
}
public struct GlanceImage: Codable {
let id:String
let supportedImages:[GlanceImageFormat]
}
//
// Peek.swift
// InMobiShortsSource
//
// Created by Dmitry Stepanets on 07.06.2021.
//
import Foundation
public struct Peek: Codable {
let articlePeek: ArticlePeek
}
struct ArticlePeek: Codable {
let summary: String
let cta: GlanceCTA
}
struct GlanceCTA: Codable {
let url: URL
let text: String
}
//
// PeekData.swift
// InMobiShortsSource
//
// Created by Dmitry Stepanets on 07.06.2021.
//
import Foundation
public struct PeekData: Codable {
public let title:String
public let sourceName:String
public let heartCount:Int
public let shortURL:URL?
public let ctaText:String
}
//
// InMobiShortsSourceTests.swift
// InMobiShortsSourceTests
//
// Created by Dmitry Stepanets on 07.06.2021.
//
import XCTest
@testable import InMobiShortsSource
class InMobiShortsSourceTests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
<?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>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment