Skip to content

Commit

Permalink
Merge pull request #2 from Flipkart/testing_assets
Browse files Browse the repository at this point in the history
APPSCORE-12915 | Changing asset bundling to resolve Asset.car conflicts
  • Loading branch information
naveen-c committed Dec 7, 2023
2 parents f0a9020 + fc1b55b commit 8faa79c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions NowYouSeeMe.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'NowYouSeeMe'
s.version = '1.0.1'
s.version = '1.0.2'
s.summary = 'View tracking framework for iOS'

s.description = <<-DESC
Expand All @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.swift_version = '5'

s.source_files = 'Source/Classes/**/*.{h,m,swift}'
s.resources = 'Source/**/*.{xcassets,xib,storyboard}'
s.resource_bundles = { 'NowYouSeeMe' => ['Source/**/*.{xcassets,xib,storyboard}'] }

s.dependency 'FCChatHeads'

Expand Down
36 changes: 21 additions & 15 deletions Source/Classes/Debug/DebugHelper.swift
Expand Up @@ -88,27 +88,33 @@ internal class DebugHelper: NSObject {
isShown = true

// create chat head image
let bundle: Bundle = Bundle(for: Self.self)
let imageView: UIImageView = UIImageView(image: UIImage(named: "Logo", in: bundle, compatibleWith: nil))
imageView.layer.cornerRadius = 20
imageView.clipsToBounds = true

// create and display chat head with debug options
let chatHead: FCChatHeadsController = FCChatHeadsController()
chatHead.datasource = self
chatHead.delegate = self
chatHead.presentChatHead(with: imageView, chatID: "NowYouSeeMe.debugView")
self.chatHead = chatHead
let bundle: Bundle = Bundle(for: DebugView.self)
if let NYSMBundleUrl: URL = bundle.url(forResource: "NowYouSeeMe", withExtension: "bundle"),
let NYSMBundle: Bundle = Bundle(url: NYSMBundleUrl) {
let imageView: UIImageView = UIImageView(image: UIImage(named: "Logo", in: NYSMBundle, compatibleWith: nil))
imageView.layer.cornerRadius = 20
imageView.clipsToBounds = true

// create and display chat head with debug options
let chatHead: FCChatHeadsController = FCChatHeadsController()
chatHead.datasource = self
chatHead.delegate = self
chatHead.presentChatHead(with: imageView, chatID: "NowYouSeeMe.debugView")
self.chatHead = chatHead
}
}
}

extension DebugHelper: FCChatHeadsControllerDatasource {
internal func chatHeadsController(_ chatHeadsController: FCChatHeadsController!, viewForPopoverForChatHeadWithChatID chatID: String!) -> UIView! {
// provide view for debug options
let bundle: Bundle = Bundle(for: Self.self)
let myView: DebugView? = bundle.loadNibNamed("DebugView", owner: nil, options: nil)?.first as? DebugView

return myView ?? UIView()
let bundle: Bundle = Bundle(for: DebugView.self)
if let NYSMBundleUrl: URL = bundle.url(forResource: "NowYouSeeMe", withExtension: "bundle"),
let NYSMBundle: Bundle = Bundle(url: NYSMBundleUrl),
let myView: DebugView = NYSMBundle.loadNibNamed("DebugView", owner: nil, options: nil)?.first as? DebugView {
return myView
}
return UIView()
}
}

Expand Down

0 comments on commit 8faa79c

Please sign in to comment.