Skip to content

Instantly share code, notes, and snippets.

View fermoya's full-sized avatar

Fernando fermoya

View GitHub Profile
###### 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.
#
CardView(card: card)
// ...
.gesture(DragGesture()
.onChanged({ (value) in
// some code
}).onEnded({ (value) in
// some code
}))
.transition(.moveUpWardsWhileFadingIn)
.disabled(!self.wallet.isFirst(card: card))
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
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 November 13, 2019 20:39
This a snippet of WalletView.swift in my repository BankCards
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))
}
@fermoya
fermoya / makrdown.swift
Created November 6, 2018 16:08
Markdown
/**
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
*/