Skip to content

Commit 73fd8d2

Browse files
committed
First commit
1 parent 29b1a8f commit 73fd8d2

40 files changed

+2812
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,5 @@ fastlane/test_output
8888
# https://github.com/johnno1962/injectionforxcode
8989

9090
iOSInjectionProject/
91+
**/Pods
92+
**/.DS_Store

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# references:
2+
# * https://www.objc.io/issues/6-build-tools/travis-ci/
3+
# * https://github.com/supermarin/xcpretty#usage
4+
5+
osx_image: xcode7.3
6+
language: objective-c
7+
# cache: cocoapods
8+
# podfile: Example/Podfile
9+
# before_install:
10+
# - gem install cocoapods # Since Travis is not always on latest version
11+
# - pod install --project-directory=Example
12+
script:
13+
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/HPElectronicProgramGuide.xcworkspace -scheme HPElectronicProgramGuide-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
14+
- pod lib lint

Example/HPElectronicProgramGuide.xcodeproj/project.pbxproj

Lines changed: 625 additions & 0 deletions
Large diffs are not rendered by default.

Example/HPElectronicProgramGuide.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0900"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
18+
BuildableName = "HPElectronicProgramGuide_Example.app"
19+
BlueprintName = "HPElectronicProgramGuide_Example"
20+
ReferencedContainer = "container:HPElectronicProgramGuide.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "607FACE41AFB9204008FA782"
32+
BuildableName = "HPElectronicProgramGuide_Tests.xctest"
33+
BlueprintName = "HPElectronicProgramGuide_Tests"
34+
ReferencedContainer = "container:HPElectronicProgramGuide.xcodeproj">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
</BuildActionEntries>
38+
</BuildAction>
39+
<TestAction
40+
buildConfiguration = "Debug"
41+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
42+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
language = ""
44+
shouldUseLaunchSchemeArgsEnv = "YES">
45+
<Testables>
46+
<TestableReference
47+
skipped = "NO">
48+
<BuildableReference
49+
BuildableIdentifier = "primary"
50+
BlueprintIdentifier = "607FACE41AFB9204008FA782"
51+
BuildableName = "HPElectronicProgramGuide_Tests.xctest"
52+
BlueprintName = "HPElectronicProgramGuide_Tests"
53+
ReferencedContainer = "container:HPElectronicProgramGuide.xcodeproj">
54+
</BuildableReference>
55+
</TestableReference>
56+
</Testables>
57+
<MacroExpansion>
58+
<BuildableReference
59+
BuildableIdentifier = "primary"
60+
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
61+
BuildableName = "HPElectronicProgramGuide_Example.app"
62+
BlueprintName = "HPElectronicProgramGuide_Example"
63+
ReferencedContainer = "container:HPElectronicProgramGuide.xcodeproj">
64+
</BuildableReference>
65+
</MacroExpansion>
66+
<AdditionalOptions>
67+
</AdditionalOptions>
68+
</TestAction>
69+
<LaunchAction
70+
buildConfiguration = "Debug"
71+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
72+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73+
language = ""
74+
launchStyle = "0"
75+
useCustomWorkingDirectory = "NO"
76+
ignoresPersistentStateOnLaunch = "NO"
77+
debugDocumentVersioning = "YES"
78+
debugServiceExtension = "internal"
79+
allowLocationSimulation = "YES">
80+
<BuildableProductRunnable
81+
runnableDebuggingMode = "0">
82+
<BuildableReference
83+
BuildableIdentifier = "primary"
84+
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
85+
BuildableName = "HPElectronicProgramGuide_Example.app"
86+
BlueprintName = "HPElectronicProgramGuide_Example"
87+
ReferencedContainer = "container:HPElectronicProgramGuide.xcodeproj">
88+
</BuildableReference>
89+
</BuildableProductRunnable>
90+
<AdditionalOptions>
91+
</AdditionalOptions>
92+
</LaunchAction>
93+
<ProfileAction
94+
buildConfiguration = "Release"
95+
shouldUseLaunchSchemeArgsEnv = "YES"
96+
savedToolIdentifier = ""
97+
useCustomWorkingDirectory = "NO"
98+
debugDocumentVersioning = "YES">
99+
<BuildableProductRunnable
100+
runnableDebuggingMode = "0">
101+
<BuildableReference
102+
BuildableIdentifier = "primary"
103+
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
104+
BuildableName = "HPElectronicProgramGuide_Example.app"
105+
BlueprintName = "HPElectronicProgramGuide_Example"
106+
ReferencedContainer = "container:HPElectronicProgramGuide.xcodeproj">
107+
</BuildableReference>
108+
</BuildableProductRunnable>
109+
</ProfileAction>
110+
<AnalyzeAction
111+
buildConfiguration = "Debug">
112+
</AnalyzeAction>
113+
<ArchiveAction
114+
buildConfiguration = "Release"
115+
revealArchiveInOrganizer = "YES">
116+
</ArchiveAction>
117+
</Scheme>

Example/HPElectronicProgramGuide.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//
2+
// AppDelegate.swift
3+
// HPElectronicProgramGuide
4+
//
5+
// Created by Hai Pham on 02/24/2024.
6+
// Copyright (c) 2024 Hai Pham. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
@UIApplicationMain
12+
class AppDelegate: UIResponder, UIApplicationDelegate {
13+
14+
var window: UIWindow?
15+
16+
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18+
// Override point for customization after application launch.
19+
return true
20+
}
21+
22+
func applicationWillResignActive(_ application: UIApplication) {
23+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24+
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25+
}
26+
27+
func applicationDidEnterBackground(_ application: UIApplication) {
28+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30+
}
31+
32+
func applicationWillEnterForeground(_ application: UIApplication) {
33+
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34+
}
35+
36+
func applicationDidBecomeActive(_ application: UIApplication) {
37+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38+
}
39+
40+
func applicationWillTerminate(_ application: UIApplication) {
41+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42+
}
43+
44+
45+
}
46+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// Array+Extensions.swift
3+
// HPElectronicProgramGuide_Example
4+
//
5+
// Created by Hai Pham Huu on 25/02/2024.
6+
// Copyright © 2024 CocoaPods. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
extension Array {
12+
public func get(_ index: Int) -> Element? {
13+
if index < self.count {
14+
return self[index]
15+
}
16+
return nil
17+
}
18+
public func filteredByType<T> (_ : T.Type) -> [T] {
19+
return compactMap { $0 as? T }
20+
}
21+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
6+
<dependencies>
7+
<deployment identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
9+
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
10+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
11+
</dependencies>
12+
<objects>
13+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
14+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
15+
<view contentMode="scaleToFill" id="iN0-l3-epB">
16+
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<subviews>
19+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 CocoaPods. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
20+
<rect key="frame" x="20" y="439" width="441" height="21"/>
21+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
22+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
23+
<nil key="highlightedColor"/>
24+
</label>
25+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="HPElectronicProgramGuide" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
26+
<rect key="frame" x="20" y="140" width="441" height="43"/>
27+
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
28+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
29+
<nil key="highlightedColor"/>
30+
</label>
31+
</subviews>
32+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
33+
<constraints>
34+
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
35+
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
36+
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
37+
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
38+
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
39+
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
40+
</constraints>
41+
<nil key="simulatedStatusBarMetrics"/>
42+
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
43+
<point key="canvasLocation" x="548" y="455"/>
44+
</view>
45+
</objects>
46+
</document>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
3+
<device id="retina4_7" orientation="portrait" appearance="light"/>
4+
<dependencies>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8+
</dependencies>
9+
<scenes>
10+
<!--View Controller-->
11+
<scene sceneID="ufC-wZ-h7g">
12+
<objects>
13+
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="HPElectronicProgramGuide_Example" customModuleProvider="target" sceneMemberID="viewController">
14+
<layoutGuides>
15+
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
16+
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
17+
</layoutGuides>
18+
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
19+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
20+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
21+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
22+
</view>
23+
</viewController>
24+
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
25+
</objects>
26+
<point key="canvasLocation" x="140" y="-1"/>
27+
</scene>
28+
</scenes>
29+
</document>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//
2+
// ChannelCell.swift
3+
// HPElectronicProgramGuide
4+
//
5+
// Created by Hai Pham on 02/24/2024.
6+
// Copyright (c) 2024 Hai Pham. All rights reserved.
7+
//
8+
9+
import Foundation
10+
import UIKit
11+
import HPElectronicProgramGuide
12+
import SnapKit
13+
14+
class ChannelCell: HPEpgCollectionViewCell {
15+
// MARK: - Properties
16+
private let cornerRadius: CGFloat = 3
17+
private lazy var titleLabel: UILabel = {
18+
let label = UILabel()
19+
label.textColor = .lightText
20+
return label
21+
}()
22+
23+
override init(frame: CGRect) {
24+
super.init(frame: frame)
25+
26+
containerView.addSubview(titleLabel)
27+
titleLabel.snp.makeConstraints { make in
28+
make.centerY.equalToSuperview()
29+
make.leading.equalToSuperview()
30+
}
31+
self.cellCornerRadius = cornerRadius
32+
self.cellBorderColor = UIColor.systemGreen.cgColor
33+
}
34+
35+
required init?(coder: NSCoder) {
36+
fatalError("init(coder:) has not been implemented")
37+
}
38+
39+
func setTitle(_ text: String?) {
40+
titleLabel.text = text
41+
}
42+
43+
func setShouldHighlight(_ shouldHighlight: Bool) {
44+
cellBackgroundColor = shouldHighlight ?
45+
UIColor(red: 26/255, green: 176/255, blue: 209/255, alpha: 1) :
46+
.darkGray
47+
}
48+
}

0 commit comments

Comments
 (0)