iOS 13.0
์ด์
โ LuckyBiteiOS.xcframework๋ฅผ ํ๋ก์ ํธ์ ๋ฃ์ต๋๋ค.
โก TARGETS์์ SDK๋ฅผ ์ฌ์ฉํ ๋์ ์ฑ์ ์ฐพ์ต๋๋ค.
โข General์ Frameworks, Libraries, and Embedded Content ์์ญ์์ LuckyBiteiOS.xcframework๋ฅผ ์ฐพ์ต๋๋ค.
โฃ Embed์ ๊ฐ์ 'Embed & Sign' ์ผ๋ก ์ค์ ํฉ๋๋ค.
โ ํ๋ก์ ํธ์ Podfile์ pod 'LuckyBiteiOS'
๋ฅผ ์ถ๊ฐ.
โก ํ๋ก์ ํธ์ Podfile์ ์๋ ๋ก์ง์ ์ ์ฉ.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if target.name == "LuckyBiteiOS"
config.build_settings['CODE_SIGNING_ALLOWED'] = 'YES'
config.build_settings['CODE_SIGNING_REQUIRED'] = 'YES'
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'YES'
end
end
end
end
import LuckyBiteiOS
...
TargetView()
.overlay(alignment: .bottomTrailing) {
LuckyBiteFloatingButton()
}
...
ํ๊ฒ ๋ทฐ์ overlay๋ก LuckyBiteFloatingButton()
๋ฅผ ์ง์ ํฉ๋๋ค.
import LuckyBiteiOS
...
override func viewDidAppear(_ animated: Bool) {
LuckyBiteSDK().setFloatingButton(viewController: self, show: true)
}
...
viewDidAppear
ํจ์์์ LuckyBiteSDK().setFloatingButton(...)
ํจ์๋ฅผ ํธ์ถํฉ๋๋ค.
setFloatingButton
ํจ์ ์ธ์
- viewController: ํ๋กํ ๋ฒํผ์ ๋์ธ ํ๋ฉด์ UIViewController๋ฅผ ์ ๋ฌํ๋ฉด ๋ฉ๋๋ค.
- show: ํ๋กํ ๋ฒํผ์ ๋์ฐ๊ณ ์ถ๋ค๋ฉด true, ๊ฐ๋ฆฌ๊ณ ์ถ๋ค๋ฉด false๋ฅผ ์ ๋ฌํ๋ฉด ๋ฉ๋๋ค.
#import "LuckyBiteiOS/LuckyBiteiOS.h"
...
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
LuckyBiteSDK *sdk = [LuckyBiteSDK shared];
[sdk setFloatingButtonWithViewController:self show:YES];
}
...
viewDidAppear
ํจ์์์ setFloatingButtonWithViewController
ํจ์๋ฅผ ํธ์ถํฉ๋๋ค.
setFloatingButtonWithViewController
ํจ์ ์ธ์
- ์ฒซ ์ธ์: self (UIViewController)
- show: ํ๋กํ ๋ฒํผ์ ๋์ฐ๊ณ ์ถ๋ค๋ฉด YES, ๊ฐ๋ฆฌ๊ณ ์ถ๋ค๋ฉด NO๋ฅผ ์ ๋ฌํ๋ฉด ๋ฉ๋๋ค.