Skip to content

Commit

Permalink
Merge branch 'release/1.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Baza207 committed Dec 20, 2017
2 parents 846a18f + cb4f930 commit 3d98cb0
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 40 deletions.
10 changes: 10 additions & 0 deletions FrostKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
180128A11FEAB2B9000A7A17 /* DLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 180128A01FEAB2B9000A7A17 /* DLog.swift */; };
180128A21FEAB2B9000A7A17 /* DLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 180128A01FEAB2B9000A7A17 /* DLog.swift */; };
180128A31FEAB2B9000A7A17 /* DLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 180128A01FEAB2B9000A7A17 /* DLog.swift */; };
180128A41FEAB2B9000A7A17 /* DLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 180128A01FEAB2B9000A7A17 /* DLog.swift */; };
18032B1B1A84F99400BEBB41 /* FontExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18DE01EC19DCBB5B008A1506 /* FontExtensions.swift */; };
1806BD2D1D625FE800434A5D /* CloudKitTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1806BD2C1D625FE800434A5D /* CloudKitTableViewController.swift */; };
1811D7B81A0AD1CA00E8B873 /* BaseWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1811D7B41A0AD1CA00E8B873 /* BaseWebViewController.swift */; };
Expand Down Expand Up @@ -254,6 +258,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
180128A01FEAB2B9000A7A17 /* DLog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DLog.swift; sourceTree = "<group>"; };
180664F91A93737200887B9D /* NetworkActivityIndicatorManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkActivityIndicatorManager.swift; sourceTree = "<group>"; };
1806BD2C1D625FE800434A5D /* CloudKitTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CloudKitTableViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
1811D76A1A0ACAED00E8B873 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -540,6 +545,7 @@
children = (
18839B4519DA27AE00760157 /* SocialHelper.swift */,
187661781BEEA0C900C82769 /* AppStoreHelper.swift */,
180128A01FEAB2B9000A7A17 /* DLog.swift */,
);
path = Helpers;
sourceTree = "<group>";
Expand Down Expand Up @@ -1142,6 +1148,7 @@
1826B0671BD906E200DA1669 /* DateExtensions.swift in Sources */,
18CF8C361D6C839100DE9C37 /* CKContainerExtensions.swift in Sources */,
185652861D81746E002E5C99 /* TaskStore.swift in Sources */,
180128A31FEAB2B9000A7A17 /* DLog.swift in Sources */,
1826B0571BD9065B00DA1669 /* FrostKit.swift in Sources */,
1826B06C1BD906E200DA1669 /* FontExtensions.swift in Sources */,
1826B0701BD906F200DA1669 /* FontConstants.swift in Sources */,
Expand Down Expand Up @@ -1181,6 +1188,7 @@
18E0283E1BA2D2D900852022 /* DateExtensions.swift in Sources */,
1846956B1F8632CE006A445F /* CKDatabaseExtensions.swift in Sources */,
182290531BA2E66C00C1CF1D /* LocalStorage.swift in Sources */,
180128A21FEAB2B9000A7A17 /* DLog.swift in Sources */,
182290521BA2E60200C1CF1D /* TaskStore.swift in Sources */,
18E028421BA2D2E400852022 /* BundleExtensions.swift in Sources */,
18E028471BA2D30100852022 /* ImageExtensions.swift in Sources */,
Expand Down Expand Up @@ -1221,6 +1229,7 @@
1844D1DB1D15F31800E87EA8 /* CoreDataCollectionViewController.swift in Sources */,
182884511CBEB12200331A54 /* MapSearchViewController.swift in Sources */,
1811D7BA1A0AD1CA00E8B873 /* WebViewController.swift in Sources */,
180128A11FEAB2B9000A7A17 /* DLog.swift in Sources */,
66AB893C1D71C21D0097ADAC /* CKReferenceExntensions.swift in Sources */,
18C0066819DB762600811755 /* ErrorExtensions.swift in Sources */,
18DD79091A8CA74E00379FB5 /* View.swift in Sources */,
Expand Down Expand Up @@ -1281,6 +1290,7 @@
18CF8C3A1D6C839100DE9C37 /* CKDatabaseExtensions.swift in Sources */,
189D8C961C77E95C00261DF5 /* TimeZoneExtensions.swift in Sources */,
18CF8C371D6C839100DE9C37 /* CKContainerExtensions.swift in Sources */,
180128A41FEAB2B9000A7A17 /* DLog.swift in Sources */,
189D8C951C77E95C00261DF5 /* CalendarExtensions.swift in Sources */,
18E545BD1C77E74D00637E85 /* FrostKit.swift in Sources */,
1846956F1F8632D9006A445F /* CKReferenceExntensions.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion FrostKit/CloudKit/CloudKitTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ open class CloudKitTableViewController: UITableViewController {
DispatchQueue.main.async {

if let anError = error {
NSLog("Query Operation Error: \(anError.localizedDescription)")
DLog("Query Operation Error: \(anError.localizedDescription)")
} else {

self.queryCursor = cursor
Expand Down
2 changes: 1 addition & 1 deletion FrostKit/CoreData/CoreDataCollectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ open class CoreDataCollectionViewController: UICollectionViewController, NSFetch
try fetchedResultsController.performFetch()
collectionView?.reloadData()
} catch let error {
NSLog("Fetch error: \(error.localizedDescription)")
DLog("Fetch error: \(error.localizedDescription)")
}
}
}
2 changes: 1 addition & 1 deletion FrostKit/CoreData/CoreDataController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ open class CoreDataController: NSObject {
do {
try aFetchedResultsController.performFetch()
} catch let error {
NSLog("Fetch error: \(error.localizedDescription)")
DLog("Fetch error: \(error.localizedDescription)")
}

return _fetchedResultsController!
Expand Down
4 changes: 2 additions & 2 deletions FrostKit/CoreData/CoreDataProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class CoreDataProxy {
coordinator = nil
// Replace this with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog("Unresolved error: \(error.localizedDescription)")
DLog("Unresolved error: \(error.localizedDescription)")
}

return coordinator
Expand Down Expand Up @@ -111,7 +111,7 @@ public class CoreDataProxy {
} catch let error {
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog("Unresolved error: \(error.localizedDescription)")
DLog("Unresolved error: \(error.localizedDescription)")
}
}
complete?()
Expand Down
2 changes: 1 addition & 1 deletion FrostKit/CoreData/CoreDataTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ open class CoreDataTableViewController: UITableViewController, NSFetchedResultsC
try fetchedResultsController.performFetch()
tableView.reloadData()
} catch let error {
NSLog("Fetch error: \(error.localizedDescription)")
DLog("Fetch error: \(error.localizedDescription)")
}
}
}
2 changes: 1 addition & 1 deletion FrostKit/Extensions/CKDatabaseExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extension CKDatabase {
if let operation = queryOperation {
add(operation)
} else {
NSLog("Not able to create query operation")
DLog("Not able to create query operation")
}
}

Expand Down
2 changes: 1 addition & 1 deletion FrostKit/Extensions/ColorExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extension Color {
// Default parsed value
break
default:
NSLog("Error: Can't parse color with hex: \(hexString)")
DLog("Error: Can't parse color with hex: \(hexString)")
return Color.clear
}

Expand Down
4 changes: 2 additions & 2 deletions FrostKit/Extensions/FontExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extension Font {
if let font = Font(name: "FontAwesome", size: size) {
return font
} else {
NSLog("ERROR: Unable to load FontAwesome font.")
DLog("ERROR: Unable to load FontAwesome font.")
return Font.systemFont(ofSize: size)
}
}
Expand All @@ -44,7 +44,7 @@ extension Font {
if let font = Font(name: "Ionicons", size: size) {
return font
} else {
NSLog("ERROR: Unable to load Ionicons font.")
DLog("ERROR: Unable to load Ionicons font.")
return Font.systemFont(ofSize: size)
}
}
Expand Down
18 changes: 9 additions & 9 deletions FrostKit/Fonts/CustomFonts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class CustomFonts {
if let name = filename, name.count > 0 && ext.count > 0 {
loadCustomFont(name: name, withExtension: ext, bundle: bundle)
} else {
NSLog("ERROR: Failed to load '\(fontName)' font as the name or extension are invalid!")
DLog("ERROR: Failed to load '\(fontName)' font as the name or extension are invalid!")
}
}
}
Expand All @@ -59,7 +59,7 @@ public class CustomFonts {

guard let url = bundle.url(forResource: name, withExtension: ext),
let provider = CGDataProvider(url: url as CFURL) else {
NSLog("ERROR: Failed to get data provider for \"\(name)\" font!")
DLog("ERROR: Failed to get data provider for \"\(name)\" font!")
return
}

Expand All @@ -73,26 +73,26 @@ public class CustomFonts {
#endif

guard let font = CGFont(provider) else {
NSLog("ERROR: Failed to get data provider for \"\(name)\" font!")
DLog("ERROR: Failed to get data provider for \"\(name)\" font!")
return
}
var error: Unmanaged<CFError>?
guard CTFontManagerRegisterGraphicsFont(font, &error) == true else {
NSLog("ERROR: Failed to register \"\(name)\" font!")
DLog("ERROR: Failed to register \"\(name)\" font!")
return
}

if let anError = error {
let errorCode = CFErrorGetCode(anError.takeRetainedValue())
if errorCode == CTFontManagerError.alreadyRegistered.rawValue {
NSLog("Already loaded '\(name)' font!")
DLog("Already loaded '\(name)' font!")
} else if let errorDescription = CFErrorCopyDescription(anError.takeRetainedValue()) {
NSLog("ERROR: Failed to load '\(name)' font with error: \(errorDescription)!")
DLog("ERROR: Failed to load '\(name)' font with error: \(errorDescription)!")
} else {
NSLog("ERROR: Failed to load '\(name)' font!")
DLog("ERROR: Failed to load '\(name)' font!")
}
} else {
NSLog("Loaded '\(name)' successfully")
DLog("Loaded '\(name)' successfully")
}
}

Expand All @@ -101,7 +101,7 @@ public class CustomFonts {
public class func printAllFontFamilies() {

for fontFamily in UIFont.familyNames {
NSLog("\(fontFamily): \(UIFont.fontNames(forFamilyName: fontFamily))")
DLog("\(fontFamily): \(UIFont.fontNames(forFamilyName: fontFamily))")
}
}
#endif
Expand Down
15 changes: 15 additions & 0 deletions FrostKit/Helpers/DLog.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// DLog.swift
// Vanir
//
// Created by James Barrow on 2017-12-05.
// Copyright © 2017 Frostlight Solutions AB. All rights reserved.
//

import Foundation

public func DLog(_ message: @autoclosure () -> String) {
#if DEBUG
NSLog(message())
#endif
}
24 changes: 12 additions & 12 deletions FrostKit/Helpers/SocialHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class SocialHelper: NSObject, UINavigationControllerDelegate, MFMailCompo

} else {
// TODO: Handle social service unavailability
NSLog("Error: Social Service Unavailable!")
DLog("Error: Social Service Unavailable!")
return false
}

Expand Down Expand Up @@ -135,7 +135,7 @@ public class SocialHelper: NSObject, UINavigationControllerDelegate, MFMailCompo

} else {
// TODO: Handle eamil service unavailability
NSLog("Error: Email Service Unavailable!")
DLog("Error: Email Service Unavailable!")
}
}

Expand Down Expand Up @@ -191,11 +191,11 @@ public class SocialHelper: NSObject, UINavigationControllerDelegate, MFMailCompo

} else {
// TODO: Handle message service unavailability
NSLog("Error: Message Service Unavailable!")
DLog("Error: Message Service Unavailable!")
}
}

private class func presentMessageComposeViewController(recipients: [String]? = nil, subject: String? = nil, body: String? = nil, attachments: [(attachmentURL: URL, alternateFilename: String)]? = nil, viewController: UIViewController, animated: Bool) {
public class func presentMessageComposeViewController(recipients: [String]? = nil, subject: String? = nil, body: String? = nil, attachments: [(attachmentURL: URL, alternateFilename: String)]? = nil, viewController: UIViewController, animated: Bool) {

let messageVC = MFMessageComposeViewController()
messageVC.messageComposeDelegate = SocialHelper.shared
Expand All @@ -222,16 +222,16 @@ public class SocialHelper: NSObject, UINavigationControllerDelegate, MFMailCompo

switch result {
case .cancelled:
NSLog("Email cancelled")
DLog("Email cancelled")
case .saved:
NSLog("Email saved")
DLog("Email saved")
case .sent:
NSLog("Email sent")
DLog("Email sent")
case .failed:
if let anError = error {
NSLog("Email send failed: \(anError.localizedDescription)")
DLog("Email send failed: \(anError.localizedDescription)")
} else {
NSLog("Email send failed!")
DLog("Email send failed!")
}
}

Expand All @@ -244,11 +244,11 @@ public class SocialHelper: NSObject, UINavigationControllerDelegate, MFMailCompo

switch result {
case .cancelled:
NSLog("Message cancelled")
DLog("Message cancelled")
case .sent:
NSLog("Message sent")
DLog("Message sent")
case .failed:
NSLog("Message failed")
DLog("Message failed")
}

controller.dismiss(animated: true, completion: nil)
Expand Down
2 changes: 1 addition & 1 deletion FrostKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.3.2</string>
<string>1.3.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion FrostKit/Maps/MapController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ open class MapController: NSObject, MKMapViewDelegate, CLLocationManagerDelegate
if inApp == true {
routeBetween(sourceMapItem: currentLocationItem, destinationMapItem: destinationItem, complete: { (route, error) in
if let anError = error {
NSLog("Error getting directions: \(anError.localizedDescription)")
DLog("Error getting directions: \(anError.localizedDescription)")
} else if let aRoute = route {
self.plot(route: aRoute)
}
Expand Down
2 changes: 1 addition & 1 deletion FrostKit/Maps/MapSearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ open class MapSearchViewController: UITableViewController, UISearchControllerDel
NotificationCenter.default.post(name: NSNotification.Name(rawValue: NetworkRequestDidBeginNotification), object: nil)
localSearch.start(completionHandler: { (searchResponse, error) in
if let anError = error {
NSLog("Error performing local search: \(anError.localizedDescription)")
DLog("Error performing local search: \(anError.localizedDescription)")
} else {
self.locationSeatchResponse = searchResponse
}
Expand Down
6 changes: 3 additions & 3 deletions FrostKit/Storage/ContentManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ContentManager {

guard shared.contentMetadata.count > 0 else {
#if DEBUG
NSLog("Check of content metadata items not needed, as there are no items managed.")
DLog("Check of content metadata items not needed, as there are no items managed.")
#endif
return
}
Expand Down Expand Up @@ -67,15 +67,15 @@ public class ContentManager {
do {
try LocalStorage.remove(absoluteURL: url)
} catch let error {
NSLog("Error: Unable to remove managed item at URL \(url)\nWith error: \(error.localizedDescription)")
DLog("Error: Unable to remove managed item at URL \(url)\nWith error: \(error.localizedDescription)")
}
}
}
}

#if DEBUG
let finish = NSDate.timeIntervalSinceReferenceDate
NSLog("Check of \(shared.contentMetadata.count) content metadata items complete in \(finish - start) seconds. Removed \(metadataToRemove.count) items.")
DLog("Check of \(shared.contentMetadata.count) content metadata items complete in \(finish - start) seconds. Removed \(metadataToRemove.count) items.")
#endif
}
}
Expand Down
6 changes: 3 additions & 3 deletions FrostKit/Storage/LocalStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class LocalStorage {
case .cachesDirectory:
return cachesURL()
default:
NSLog("Error: Base URL for directory \"\(directory)\" requested is not supported!")
DLog("Error: Base URL for directory \"\(directory)\" requested is not supported!")
return nil
}
}
Expand Down Expand Up @@ -170,7 +170,7 @@ public class LocalStorage {
do {
try FileManager.default.createDirectory(at: url, withIntermediateDirectories: true, attributes: nil)
} catch let error {
NSLog("Error: Directory not able to be created at URL \(url)\nWith error: \(error.localizedDescription)")
DLog("Error: Directory not able to be created at URL \(url)\nWith error: \(error.localizedDescription)")
}
}

Expand Down Expand Up @@ -200,7 +200,7 @@ public class LocalStorage {
let success = NSKeyedArchiver.archiveRootObject(data, toFile: url.path)

if success == false {
NSLog("Error: Can't save object to file at path: \(url.path)")
DLog("Error: Can't save object to file at path: \(url.path)")
}

return success
Expand Down

0 comments on commit 3d98cb0

Please sign in to comment.