This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import Kingfisher | |
import UIKit | |
public struct NetworkImage: SwiftUI.View { | |
// swiftlint:disable:next redundant_optional_initialization | |
@State private var image: UIImage? = nil | |
public let imageURL: URL? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.swift | |
// BuyPhone | |
// | |
// Created by Ivan Bruel on 04/11/2017. | |
// Copyright © 2017 Ivan Bruel. All rights reserved. | |
// | |
import Foundation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Swizzle.swift | |
// RouterTester | |
// | |
// Created by Ivan Bruel on 17/05/2017. | |
// Copyright © 2017 Unbabel. All rights reserved. | |
// | |
import Foundation | |
import ObjectiveC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
func snakeCased() -> String? { | |
let pattern = "([a-z0-9])([A-Z])" | |
let regex = try? NSRegularExpression(pattern: pattern, options: []) | |
let range = NSRange(location: 0, length: self.characters.count) | |
return regex?.stringByReplacingMatches(in: self, options: [], range: range, withTemplate: "$1_$2").lowercased() | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func login() -> Observable<Void> { | |
return Observable.combineLatest(twitterSession(), Observable.just(Globals.UUID)) { ($0, $1) } | |
.flatMap { (twitterSession, uuid) in | |
Network.request(PhoenixAPI.TwitterLogin(authToken: twitterSession.authToken, | |
authTokenSecret: twitterSession.authTokenSecret, uid: uuid)) | |
} | |
.filterSuccessfulStatusCodes() | |
.debug() | |
.mapObject(Session) | |
.doOnNext { [weak self] (session: Session) in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func login() -> Observable<Void> { | |
return twitterSession() | |
.flatMap { | |
self.network.request(self.twitterLogin(authToken: $0.authToken, | |
authTokenSecret: $0.authTokenSecret, | |
uid: self.uuid)) | |
} | |
.filterSuccessfulStatusCodes() | |
.debug() | |
.mapObject(Session) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func login() -> Observable<Void> { | |
return Observable.combineLatest(twitterSession(), Observable.just(Globals.UUID)) { ($0, $1) } | |
.flatMap { (twitterSession, uuid) in | |
Network.request(PhoenixAPI.TwitterLogin(authToken: twitterSession.authToken, | |
authTokenSecret: twitterSession.authTokenSecret, uid: uuid)) | |
} | |
.filterSuccessfulStatusCodes() | |
.debug() | |
.mapObject(Session) | |
.doOnNext { [weak self] (session: Session) in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adding Build Time Analyzer compatibility | |
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
target.build_configurations.each do |config| | |
other_swift_flags = config.build_settings['OTHER_SWIFT_FLAGS'] || ['$(inherited)'] | |
other_swift_flags << '-Xfrontend' | |
other_swift_flags << '-debug-time-function-bodies' | |
config.build_settings['OTHER_SWIFT_FLAGS'] = other_swift_flags | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIImageViewTopAligned.swift | |
// | |
// Created by Ivan Bruel on 26/08/16. | |
// Copyright © 2016 Faber Ventures. All rights reserved. | |
// | |
import UIKit | |
import Kingfisher |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adding Build Time Analyzer compatibility | |
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
target.build_configurations.each do |config| | |
other_swift_flags = config.build_settings['OTHER_SWIFT_FLAGS'] || ['$(inherited)'] | |
other_swift_flags << '-Xfrontend' | |
other_swift_flags << '-debug-time-function-bodies' | |
config.build_settings['OTHER_SWIFT_FLAGS'] = other_swift_flags | |
end | |
end |
NewerOlder