From d98e416eb9b6ba8fa43dfc725088b7b3909f4f6f Mon Sep 17 00:00:00 2001 From: Dwayne Harris Date: Mon, 19 Nov 2018 15:14:16 -0800 Subject: [PATCH] Remove AlamofireImage --- elpha-ios.xcodeproj/project.pbxproj | 150 -------------------- elpha-ios/TimelineTableViewController.swift | 9 +- 2 files changed, 5 insertions(+), 154 deletions(-) diff --git a/elpha-ios.xcodeproj/project.pbxproj b/elpha-ios.xcodeproj/project.pbxproj index cb658d5..9a721f2 100644 --- a/elpha-ios.xcodeproj/project.pbxproj +++ b/elpha-ios.xcodeproj/project.pbxproj @@ -31,8 +31,6 @@ 1564316621A15B2E00816382 /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 157405C3215890BC00EEAAEB /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 1564316E21A15B5400816382 /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 156370B0219FE22E00D51D42 /* Kingfisher.framework */; }; 1564316F21A15B5400816382 /* Kingfisher.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 156370B0219FE22E00D51D42 /* Kingfisher.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 1564317221A15CF300816382 /* AlamofireImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1517EA842159D72200DE80D6 /* AlamofireImage.framework */; }; - 1564317321A15CF300816382 /* AlamofireImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1517EA842159D72200DE80D6 /* AlamofireImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 156902A0219A7D75002BF61F /* ComposeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1569029F219A7D75002BF61F /* ComposeViewController.swift */; }; 156FF015217289380074D9CA /* AccountTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 156FF014217289380074D9CA /* AccountTableViewCell.swift */; }; 156FF0312174797E0074D9CA /* StatusTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 156FF0302174797E0074D9CA /* StatusTableViewController.swift */; }; @@ -73,62 +71,6 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1517EA832159D72200DE80D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4C9043771AABBFC5001B4E60; - remoteInfo = "AlamofireImage iOS"; - }; - 1517EA852159D72200DE80D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4C9043821AABBFC5001B4E60; - remoteInfo = "AlamofireImage iOS Tests"; - }; - 1517EA872159D72200DE80D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CE611321AABC24E00D35044; - remoteInfo = "AlamofireImage macOS"; - }; - 1517EA892159D72200DE80D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CE611471AABC5C900D35044; - remoteInfo = "AlamofireImage macOS Tests"; - }; - 1517EA8B2159D72200DE80D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4C16B37D1BA9399500A66EF0; - remoteInfo = "AlamofireImage tvOS"; - }; - 1517EA8D2159D72200DE80D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4C16B3861BA9399500A66EF0; - remoteInfo = "AlamofireImage tvOS Tests"; - }; - 1517EA8F2159D72200DE80D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4C4D4EC11B92976900C96855; - remoteInfo = "AlamofireImage watchOS"; - }; - 1517EA912159D72200DE80D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4C11830B2150517E007A8298; - remoteInfo = "iOS Example"; - }; 156370AF219FE22E00D51D42 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 15637094219FE22E00D51D42 /* Kingfisher.xcodeproj */; @@ -192,13 +134,6 @@ remoteGlobalIDString = D1ED2D341AD2D09F00CFC3EB; remoteInfo = "Kingfisher-iOS"; }; - 1564317421A15CF300816382 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 4C9043761AABBFC5001B4E60; - remoteInfo = "AlamofireImage iOS"; - }; 157405C2215890BC00EEAAEB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 157405B7215890BC00EEAAEB /* Alamofire.xcodeproj */; @@ -259,7 +194,6 @@ files = ( 1564316621A15B2E00816382 /* Alamofire.framework in Embed Frameworks */, 1564316F21A15B5400816382 /* Kingfisher.framework in Embed Frameworks */, - 1564317321A15CF300816382 /* AlamofireImage.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -273,7 +207,6 @@ 15131EF1216D8D570092B252 /* StatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusView.swift; sourceTree = ""; }; 15131EF3216DB8B90092B252 /* AccountTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountTableViewController.swift; sourceTree = ""; }; 15131EF5216DBA820092B252 /* AccountNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountNavigationController.swift; sourceTree = ""; }; - 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = AlamofireImage.xcodeproj; path = Frameworks/AlamofireImage/AlamofireImage.xcodeproj; sourceTree = ""; }; 15222806219D37A500D2E5A6 /* ComposeAccessoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposeAccessoryView.swift; sourceTree = ""; }; 152734D12186DC74003DB3C8 /* TimelinesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelinesViewController.swift; sourceTree = ""; }; 152FB0F7218ADC1A001D6574 /* AttachmentPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttachmentPageViewController.swift; sourceTree = ""; }; @@ -337,7 +270,6 @@ buildActionMask = 2147483647; files = ( 1564316521A15B2E00816382 /* Alamofire.framework in Frameworks */, - 1564317221A15CF300816382 /* AlamofireImage.framework in Frameworks */, 1564316E21A15B5400816382 /* Kingfisher.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -345,21 +277,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 1517EA702159D72200DE80D6 /* Products */ = { - isa = PBXGroup; - children = ( - 1517EA842159D72200DE80D6 /* AlamofireImage.framework */, - 1517EA862159D72200DE80D6 /* AlamofireImage iOS Tests.xctest */, - 1517EA882159D72200DE80D6 /* AlamofireImage.framework */, - 1517EA8A2159D72200DE80D6 /* AlamofireImage macOS Tests.xctest */, - 1517EA8C2159D72200DE80D6 /* AlamofireImage.framework */, - 1517EA8E2159D72200DE80D6 /* AlamofireImage tvOS Tests.xctest */, - 1517EA902159D72200DE80D6 /* AlamofireImage.framework */, - 1517EA922159D72200DE80D6 /* iOS Example.app */, - ); - name = Products; - sourceTree = ""; - }; 151AD4AB2166DCEE00F07403 /* Storyboards */ = { isa = PBXGroup; children = ( @@ -483,7 +400,6 @@ children = ( 157405AF2151A5DA00EEAAEB /* README.md */, 157405B7215890BC00EEAAEB /* Alamofire.xcodeproj */, - 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */, 15637094219FE22E00D51D42 /* Kingfisher.xcodeproj */, 15960E59213145E100C38CE9 /* elpha-ios */, 15960E58213145E100C38CE9 /* Products */, @@ -569,7 +485,6 @@ dependencies = ( 1564316821A15B2E00816382 /* PBXTargetDependency */, 1564317121A15B5400816382 /* PBXTargetDependency */, - 1564317521A15CF300816382 /* PBXTargetDependency */, ); name = "elpha-ios"; productName = "elpha-ios"; @@ -608,10 +523,6 @@ ProductGroup = 157405B8215890BC00EEAAEB /* Products */; ProjectRef = 157405B7215890BC00EEAAEB /* Alamofire.xcodeproj */; }, - { - ProductGroup = 1517EA702159D72200DE80D6 /* Products */; - ProjectRef = 1517EA6F2159D72200DE80D6 /* AlamofireImage.xcodeproj */; - }, { ProductGroup = 15637095219FE22E00D51D42 /* Products */; ProjectRef = 15637094219FE22E00D51D42 /* Kingfisher.xcodeproj */; @@ -625,62 +536,6 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1517EA842159D72200DE80D6 /* AlamofireImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = AlamofireImage.framework; - remoteRef = 1517EA832159D72200DE80D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1517EA862159D72200DE80D6 /* AlamofireImage iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "AlamofireImage iOS Tests.xctest"; - remoteRef = 1517EA852159D72200DE80D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1517EA882159D72200DE80D6 /* AlamofireImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = AlamofireImage.framework; - remoteRef = 1517EA872159D72200DE80D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1517EA8A2159D72200DE80D6 /* AlamofireImage macOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "AlamofireImage macOS Tests.xctest"; - remoteRef = 1517EA892159D72200DE80D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1517EA8C2159D72200DE80D6 /* AlamofireImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = AlamofireImage.framework; - remoteRef = 1517EA8B2159D72200DE80D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1517EA8E2159D72200DE80D6 /* AlamofireImage tvOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "AlamofireImage tvOS Tests.xctest"; - remoteRef = 1517EA8D2159D72200DE80D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1517EA902159D72200DE80D6 /* AlamofireImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = AlamofireImage.framework; - remoteRef = 1517EA8F2159D72200DE80D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1517EA922159D72200DE80D6 /* iOS Example.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = "iOS Example.app"; - remoteRef = 1517EA912159D72200DE80D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 156370B0219FE22E00D51D42 /* Kingfisher.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -869,11 +724,6 @@ name = "Kingfisher-iOS"; targetProxy = 1564317021A15B5400816382 /* PBXContainerItemProxy */; }; - 1564317521A15CF300816382 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "AlamofireImage iOS"; - targetProxy = 1564317421A15CF300816382 /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ diff --git a/elpha-ios/TimelineTableViewController.swift b/elpha-ios/TimelineTableViewController.swift index 688d7d9..0c71dcf 100644 --- a/elpha-ios/TimelineTableViewController.swift +++ b/elpha-ios/TimelineTableViewController.swift @@ -6,8 +6,8 @@ // Copyright © 2018 Elpha. All rights reserved. // -import Alamofire import CoreData +import Kingfisher import UIKit import SafariServices @@ -54,9 +54,10 @@ class TimelineTableViewController: AbstractStatusTableViewController { navigationItem.rightBarButtonItems = [composeButtonItem] if let account = AuthenticationManager.session?.account { - Alamofire.request(account.avatarURL!).responseImage { response in - if let image = response.result.value { - avatarButtonItem.image = image.af_imageAspectScaled(toFit: CGSize(width: 30, height: 30)).af_imageRounded(withCornerRadius: 10).withRenderingMode(.alwaysOriginal) + let processor = ResizingImageProcessor(referenceSize: CGSize(width: 30, height: 30), mode: .aspectFill) >> RoundCornerImageProcessor(cornerRadius: 10) + ImageDownloader.default.downloadImage(with: account.avatarURL!, retrieveImageTask: nil, options: [.processor(processor)], progressBlock: nil) { image, error, url, data in + if let image = image { + avatarButtonItem.image = image.withRenderingMode(.alwaysOriginal) } } }