Skip to content

Commit

Permalink
Add tvOS example app (close #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBenny committed Jun 25, 2021
1 parent 9716d42 commit 58b0066
Show file tree
Hide file tree
Showing 170 changed files with 6,370 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/news-tvos/.github/workflows/xcodebuild-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Xcode build iOS

on: [push, pull_request]

jobs:
build:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v2

- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_12.2.app

- name: Xcode version
run: /usr/bin/xcodebuild -version

- name: Xcode iOS build
run: |
cd Xcode/
xcodebuild clean build -scheme TheNews -destination 'platform=iOS Simulator,name=iPhone 12,OS=14.2'
21 changes: 21 additions & 0 deletions examples/news-tvos/.github/workflows/xcodebuild-tvos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Xcode build tvOS

on: [push, pull_request]

jobs:
build:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v2

- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_11.7.app

- name: Xcode version
run: /usr/bin/xcodebuild -version

- name: Xcode tvOS build
run: |
cd Xcode/
xcodebuild clean build -scheme TheNews.tvos -destination 'platform=tvOS Simulator,name=Apple TV'
26 changes: 26 additions & 0 deletions examples/news-tvos/.github/workflows/xcodetest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Xcode test

on: [push, pull_request]

jobs:
test:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v2

- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_12.2.app

- name: Xcode version
run: /usr/bin/xcodebuild -version

- name: Xcode unit tests
run: |
cd Xcode/
xcodebuild clean test -scheme TheNews -destination 'platform=iOS Simulator,name=iPhone 12,OS=14.2'
- uses: actions/upload-artifact@v2
with:
name: tests.xcresult
path: /Users/runner/Library/Developer/Xcode/DerivedData/*/Logs/Test/*.xcresult
90 changes: 90 additions & 0 deletions examples/news-tvos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
Binary file added examples/news-tvos/Images/Inspiration/apollo.jpeg
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.
Binary file added examples/news-tvos/Images/Inspiration/axios.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/Inspiration/bbc.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/Inspiration/cnn.PNG
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.
Binary file added examples/news-tvos/Images/Inspiration/nyt.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/Inspiration/reddit.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/apollo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/applenews.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/applenews2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/axios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/bbc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/cnn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/demo.mov
Binary file not shown.
Binary file added examples/news-tvos/Images/facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/facebooknews.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/fastnews.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/flipboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/hero2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/news-tvos/Images/lilnews.png
Binary file added examples/news-tvos/Images/nbcnews.png
Binary file added examples/news-tvos/Images/noun_news_2385047.png
Binary file added examples/news-tvos/Images/nyt.png
Binary file added examples/news-tvos/Images/reddit.png
Binary file added examples/news-tvos/Images/today.png
Binary file added examples/news-tvos/Images/today2.png
Binary file added examples/news-tvos/Images/tvos.png
Binary file added examples/news-tvos/Images/twitter.png
Binary file added examples/news-tvos/Images/uikit.png
Binary file added examples/news-tvos/Images/washingtonpost.png
Binary file added examples/news-tvos/Images/wsj.png
21 changes: 21 additions & 0 deletions examples/news-tvos/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 dkhamsing

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
71 changes: 71 additions & 0 deletions examples/news-tvos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
## News

iOS news app in the style of Apollo, Apple News, Axios, BBC, CNN, Facebook, Facebook News, FastNews, Flipboard, Lil News, NBC News, Reddit, The New York Times, The Washington Post, The Wall Street Journal, Twitter, UIKit :newspaper:

<img src=Images/hero.png width=100%>
<img src=Images/hero2.png width=100%>

<img width=300 src=Images/demo.gif>

<img src=Images/apollo.png height=400> <img src=Images/applenews.png height=400>

<img src=Images/axios.png height=400> <img src=Images/bbc.png height=400>

<img src=Images/cnn.png height=400> <img src=Images/facebook.png height=400>

<img src=Images/facebooknews.png height=400> <img src=Images/flipboard.png height=400>

<img src=Images/fastnews.png height=400> <img src=Images/lilnews.png height=400>

<img src=Images/nbcnews.png height=400> <img src=Images/reddit.png height=400>

<img src=Images/nyt.png height=400> <img src=Images/washingtonpost.png height=400>

<img src=Images/wsj.png height=400> <img src=Images/twitter.png height=400>

<img src=Images/uikit.png height=400>

#### Bonus

| tvOS app | Today extension |
|--------|-------|
|<img src=Images/tvos.png height=300>| <img src=Images/today.png height=300>|

## Requirements

- iOS 14
- tvOS 13

## Credits

- [newsapi.org](https://newsapi.org)
- [App icon by xwoodhillx](https://thenounproject.com/term/news/2385047/)
- [Logos provided by Clearbit](https://clearbit.com)

### Styles

- [Apollo](https://apolloapp.io)
- [Apple News](https://apps.apple.com/app/apple-news/id1066498020)
- [Axios](https://www.axios.com)
- [BBC](https://www.bbc.com)
- [CNN](https://www.cnn.com)
- [Facebook](https://www.facebook.com)
- [Facebook News](https://www.facebook.com)
- FastNews (to be open-sourced)
- [Flipboard](https://flipboard.com)
- [Lil News](https://lil.software/)
- [NBC News](https://www.nbcnews.com)
- [Reddit](https://www.reddit.com)
- [The New York Times](https://www.nytimes.com)
- [The Wall Street Journal](https://www.wsj.com)
- [The Washington Post](https://www.washingtonpost.com)
- [Twitter](https://twitter.com)

## Contact

- [github.com/dkhamsing](https://github.com/dkhamsing)
- [twitter.com/dkhamsing](https://twitter.com/dkhamsing)

## License

This project is available under the MIT license. See the [LICENSE](LICENSE) file for more info.
7 changes: 7 additions & 0 deletions examples/news-tvos/Xcode/Dependencies/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
25 changes: 25 additions & 0 deletions examples/news-tvos/Xcode/Dependencies/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"object": {
"pins": [
{
"package": "FMDB",
"repositoryURL": "https://github.com/ccgus/fmdb",
"state": {
"branch": null,
"revision": "61e51fde7f7aab6554f30ab061cc588b28a97d04",
"version": "2.7.7"
}
},
{
"package": "SnowplowTracker",
"repositoryURL": "https://github.com/snowplow/snowplow-objc-tracker",
"state": {
"branch": "master",
"revision": "30440e513d6fcaef582308b6b9971306cab8215a",
"version": null
}
}
]
},
"version": 1
}
28 changes: 28 additions & 0 deletions examples/news-tvos/Xcode/Dependencies/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Dependencies",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "Dependencies",
targets: ["Dependencies"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(name: "SnowplowTracker", url: "https://github.com/snowplow/snowplow-objc-tracker", from: "2.1.0")
// .package(name: "SnowplowTracker", url: "https://github.com/snowplow/snowplow-objc-tracker", .branch("master")),
// .package(name: "SnowplowTracker", path: "../../../../../snowplow-objc-tracker"),
// .package(name: "SnowplowTracker", path: "../../../.."),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "Dependencies",
dependencies: ["SnowplowTracker"]),
]
)
3 changes: 3 additions & 0 deletions examples/news-tvos/Xcode/Dependencies/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dependencies

A description of this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@_exported import SnowplowTracker

public struct Dependencies {
public var text = "Dummy text"
}
56 changes: 56 additions & 0 deletions examples/news-tvos/Xcode/TheNews.tvos/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//
// AppDelegate.swift
// TheNews.tvos
//
// Created by Daniel on 4/26/20.
// Copyright © 2020 dk. All rights reserved.
//

import UIKit
import SnowplowTracker

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

let tabController = TvTabBarController()

window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = tabController
window?.makeKeyAndVisible()

/*
let remoteConfig = RemoteConfiguration(endpoint: <REMOTE_CONFIG_URL>, method: .get)
Snowplow.setup(remoteConfiguration: remoteConfig, defaultConfiguration: nil) { namespaces in
print(namespaces ?? "Good luck!")
}
*/

Snowplow.createTracker(namespace: "defaultTracker", endpoint: "http://192.168.99.101:9090", method: .get);
return true
}

func applicationWillResignActive(_ application: UIApplication) {
// 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.
// 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.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// 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.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
// 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.
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tvos.png",
"idiom" : "tv"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit 58b0066

Please sign in to comment.