Skip to content

Instantly share code, notes, and snippets.

Avatar

Fernando fermoya

View GitHub Profile
View remove_unsupported_libraries.rb
###### CONSISTENCY BETWEEN MACOS AND IOS #####
#
# In order to use the same PodFile with MacOS, we need to unlink the libraries that do not support Catalyst, filter
# files in native targets build phases, filter dependencies and make sure the unsupported frameworks along with their
# their bundle resources are not included in the final archive. For that, we use `platform_filter` to specify 'ios' and
# 'OTHER_LDFLAGS[sdk=iphone*]' to link those libraries for iPhone and iPad. Besides, we modify "*frameworks.sh" and
# "*resrouces.sh" to skip installation for architecture x86_64.
#
# *Notice*: 'sdk=iphone*' excludes macOS, even though Catalyst is compiled with iOS SDK.
#
View DraggableCard.swift
CardView(card: card)
// ...
.gesture(DragGesture()
.onChanged({ (value) in
// some code
}).onEnded({ (value) in
// some code
}))
.transition(.moveUpWardsWhileFadingIn)
.disabled(!self.wallet.isFirst(card: card))
View CardViewWithAnimationProperties.swift
CardView(card: card)
.opacity(self.opacity(for: card))
.offset(x: 0,
y: self.offset(for: card))
.scaleEffect(self.scaleEffect(for: card))
.rotation3DEffect(self.rotationAngle(for: card),
axis: (x: 0.5, y: 1, z: 0))
// 1
.transition(.moveUpWardsWhileFadingIn)
// 2
View WalletTransition.swift
ZStack() {
if self.isPresented {
ForEach(self.wallet.cards) { card in
CardView(card: card)
/*
... Setting up the view ...
*/
}
}
}.padding(.horizontal, Self.padding)
@fermoya
fermoya / CardsInWallet.swift
Last active Nov 13, 2019
This a snippet of WalletView.swift in my repository BankCards
View CardsInWallet.swift
ZStack() {
ForEach(self.wallet.cards) { card in
CardView(card: card)
.opacity(self.opacity(for: card))
.offset(x: 0,
y: self.offset(for: card))
.scaleEffect(self.scaleEffect(for: card))
.rotation3DEffect(self.rotationAngle(for: card),
axis: (x: 0.5, y: 1, z: 0))
}
View makrdown.swift
/**
Initializes a new Show Case View.
- Parameter target: The bar button that's targeted and whose feature is intended to be exaplained
- Parameter label: *Optional*, an identifier for the show case
- Remark: From iOS 11 onwards, the target must be a custom bar button item, that is, it must have been created by using *init(customView: UIView?)* constructor. If not so, it'll return *nil*
- Note: The show case arrow direction will always point upwards
*/