Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #20 from amiantos/ios12
Browse files Browse the repository at this point in the history
Updates for iOS 12
  • Loading branch information
amiantos authored Sep 27, 2018
2 parents e6eb7c0 + aeba4da commit 7378289
Show file tree
Hide file tree
Showing 114 changed files with 3,887 additions and 1,765 deletions.
33 changes: 33 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
disabled_rules:
- trailing_whitespace
- force_cast
opt_in_rules:
- empty_count
- empty_string
excluded:
- Carthage
- Pods
- SwiftLint/Common/3rdPartyLib
line_length:
warning: 150
error: 200
ignores_function_declarations: true
ignores_comments: true
ignores_urls: true
function_body_length:
warning: 300
error: 500
function_parameter_count:
warning: 6
error: 8
type_body_length:
warning: 300
error: 500
file_length:
warning: 1000
error: 1500
ignore_comment_only_lines: true
cyclomatic_complexity:
warning: 15
error: 25
reporter: "xcode"
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode9.3
osx_image: xcode10

before_install:
- pod repo update
Expand Down
2,342 changes: 2,342 additions & 0 deletions Design/icon/icon.ai

Large diffs are not rendered by default.

Binary file added Design/icon/numuIcon_1024.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 Design/icon/numuIcon_120.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 Design/icon/numuIcon_152.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 Design/icon/numuIcon_167.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 Design/icon/numuIcon_180.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 Design/icon/numuIcon_20.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 Design/icon/numuIcon_29.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 Design/icon/numuIcon_40.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 Design/icon/numuIcon_58.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 Design/icon/numuIcon_60.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 Design/icon/numuIcon_76.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 Design/icon/numuIcon_80.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 Design/icon/numuIcon_87.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
191 changes: 140 additions & 51 deletions Numu Tracker.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -66,7 +65,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
108 changes: 108 additions & 0 deletions Numu Tracker/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
//
// AppDelegate.swift
// Numu Tracker
//
// Created by Bradley Root on 9/11/16.
// Copyright © 2016 Numu Tracker. All rights reserved.
//

import UIKit
import PusherSwift
import UserNotifications
import SwiftyJSON
import Fabric
import Crashlytics
import CloudKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

// Production
let pusher = Pusher(key: "")

// Development
//let pusher = Pusher(key: "")

func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

Fabric.with([Crashlytics.self])

NumuReviewHelper.incrementActivityCount()

NotificationCenter.default.addObserver(
self, selector: #selector(self.runLogInOperations), name: .LoggedOut, object: nil)

NotificationCenter.default.addObserver(
self, selector: #selector(self.ckDataChange), name: Notification.Name.CKAccountChanged, object: nil)

runLogInOperations()

return true
}

@objc func ckDataChange() {
// Need to re-run authorization procedure here.
runLogInOperations()
}

deinit {
NotificationCenter.default.removeObserver(self)
}

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
pusher.nativePusher.register(deviceToken: deviceToken)
if let username = NumuCredential.shared.getUsername() {
if defaults.newReleased {
pusher.nativePusher.subscribe(interestName: "newReleased_" + username)
print("Turned on new notifications")
} else {
pusher.nativePusher.unsubscribe(interestName: "newReleased_" + username)
print("Turned off new notifications")
}

if defaults.newAnnouncements {
pusher.nativePusher.subscribe(interestName: "newAnnouncements_" + username)
print("Turned on new music friday notifications")
} else {
pusher.nativePusher.unsubscribe(interestName: "newAnnouncements_" + username)
print("Turned off new music friday notifications")
}

if defaults.moreReleases {
pusher.nativePusher.subscribe(interestName: "moreReleases_" + username)
print("Turned on more releases notifications")
} else {
pusher.nativePusher.unsubscribe(interestName: "moreReleases_" + username)
print("Turned off more releases notifications")
}
}
}

@objc fileprivate func runLogInOperations() {
let queue = OperationQueue()

// Get and store CK record ID if available
let getCKUserOperation = GetCKUserOperation()
// If user account exists already, link it to CK or create new account
let registerWithCKOperation = RegisterWithCKOperation()
// Try to auth with any credentials
let authOperation = AuthOperation()

registerWithCKOperation.addDependency(getCKUserOperation)
authOperation.addDependency(registerWithCKOperation)
authOperation.completionBlock = {
print("Finished Auth Process!!!")
DispatchQueue.main.async(execute: {
if defaults.logged {
UIApplication.shared.registerForRemoteNotifications()
}
})
}
queue.addOperations([getCKUserOperation, registerWithCKOperation, authOperation], waitUntilFinished: false)
}

}
139 changes: 0 additions & 139 deletions Numu Tracker/Base.lproj/LaunchScreen.storyboard

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ struct ArtistItem {
var followStatus: String
let thumbUrl: NSURL
let unlistened: String
let total_rels: String
let totalReleases: String

init?(json: JSON) {
guard let artistId = json["artist_id"].string,
let followStatus = json["follow_status"].string,
let recentRelease = json["recent_date"].string,
let unlistened = json["unread"].string,
let total_rels = json["total_releases"].string,
let totalReleases = json["total_releases"].string,
let artistName = json["name"].string else {
return nil
}

self.artistId = artistId
self.followStatus = followStatus
self.artistName = artistName
self.total_rels = total_rels
self.totalReleases = totalReleases
self.unlistened = unlistened
self.recentRelease = recentRelease

Expand All @@ -60,14 +60,14 @@ struct ArtistItem {
self.artistArtXLarge = ""
}

if self.artistArtFull != "" {
if !self.artistArtFull.isEmpty {
self.thumbUrl = NSURL(string: self.artistArtFull)!
} else {
self.thumbUrl = NSURL(string: "")!
}
}

func unfollowArtist(completion: @escaping (String) -> ()) {
func unfollowArtist(completion: @escaping (String) -> Void) {
NumuClient.shared.toggleFollow(artistMbid: self.artistId) { (result) in
completion(result)
NumuReviewHelper.incrementAndAskForReview()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,17 @@ class NumuTabBarController: UITabBarController, UITabBarControllerDelegate {

override func viewDidLoad() {
super.viewDidLoad()

self.viewControllers![0].title = "All Releases"
self.viewControllers![0].tabBarItem.image = UIImage(named: "all")

self.viewControllers![1].title = "Your Releases"
self.viewControllers![1].tabBarItem.image = UIImage(named: "yours")

self.tabBar.tintColor = UIColor(red: 0.24, green: 0.67, blue: 0.73, alpha: 1.0)

delegate = self
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}

func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
func tabBarController(
_ tabBarController: UITabBarController,
shouldSelect viewController: UIViewController) -> Bool {
return true
}

Expand Down
Loading

0 comments on commit 7378289

Please sign in to comment.