Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SwiftTweaks
Search
Sho Ikeda
May 25, 2016
Programming
670
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SwiftTweaks
関西モバイルアプリ研究会 #14での発表資料です #関モバ
http://kanmoba.connpass.com/event/31750/
Sho Ikeda
May 25, 2016
More Decks by Sho Ikeda
See All by Sho Ikeda
大規模アプリにおけるXcode Previews実用化までの道のり
ikesyo
0
31k
Package Traits
ikesyo
2
1.5k
Open Source Swift Workshop - Foundation and first party libraries
ikesyo
0
3.3k
Renovateで実現するライブラリの自動更新生活 / Automated Library Updates with Renovate
ikesyo
3
720
XcodeのDevelopment Assets探訪
ikesyo
1
1.5k
RenovateによるiOSライブラリーの自動更新
ikesyo
2
4.1k
2019年のSwiftモック事情
ikesyo
3
8.7k
5分でわかる!Xcode 11から使えるXCFrameworks
ikesyo
2
4.1k
Travis CIのBuild Matrixを活用して、Swift製ライブラリをLinux対応させる
ikesyo
3
2.7k
Other Decks in Programming
See All in Programming
AIが無かった頃の素敵な出会いの話
codmoninc
1
450
AIを紡ぐPMのお話
swdtkuy
0
110
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
510
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
500
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
470
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
230
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
940
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
450
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
120
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
260
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
180
メールのエイリアス機能を履き違えない
isshinfunada
0
240
Featured
See All Featured
From π to Pie charts
rasagy
0
290
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
The untapped power of vector embeddings
frankvandijk
2
1.8k
Rails Girls Zürich Keynote
gr2m
96
14k
For a Future-Friendly Web
brad_frost
183
10k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
490
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
How to train your dragon (web standard)
notwaldorf
97
6.8k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
770
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
860
Making Projects Easy
brettharned
120
6.7k
Google's AI Overviews - The New Search
badams
0
1.1k
Transcript
SwiftTweaks @ikesyo ؔϞόΠϧΞϓϦݚڀձ #14, 2016-05-25 Wed #ؔϞό
@ikesyo • ͍͚͠ΐʔʗా ᠳ • ͯͳ@ژ • https://twitter.com/ikesyo • https://github.com/ikesyo
✨ Contributions ✨ • ReactiveCocoa • Carthage (Commandant, ReactiveTask) •
Result • Himotoki • APIKit
Tweaking
Why? • Parameters adjustment • Animation (location, duration, ...) •
Color • Layout • ... • Debug mode • Clear settings • Change API environment • Toggle experimental features • ... • And what you want
Facebook/Tweaks
Tweaks An easy way to fine-tune, and adjust parameters for
iOS apps in development.
Objective-C // Value CGFloat animationDuration = FBTweakValue(@"Category", @"Group", @"Duration", 0.5);
// Bind FBTweakBind(self.headerView, alpha, @"Main Screen", @"Header", @"Alpha", 0.85); FBTweakBind(webView.scrollView, scrollEnabled, @"Browser", @"Scrolling", @"Enabled", YES); // Action FBTweakAction(@"Player", @"Audio", @"Volume", ^{ NSLog(@"Action selected."); });
Swift // FBTweak~~ are macro, so those can't be used
in Swift let tweak = FBTweak(identifier: "com.tweaks.example.advanced") tweak.name = "Advanced settings" tweak.defaultValue = false let collection = FBTweakCollection(name: "Enable"); collection.addTweak(tweak) let category = FBTweakCategory(name: "Settings") category.addTweakCollection(collection) let store = FBTweakStore.sharedInstance() store.addTweakCategory(category) tweak.addObserver(self) func tweakDidChange(tweak: FBTweak!) { self.advancedSettingsEnabled = tweak.currentValue as Bool }
!!!
Khan/SwiftTweaks
SwiftTweaks Tweak your iOS app without recompiling! • Supported types
• Bool • Int • CGFloat • Double • UIColor • Group template • Floating window
Steps 1. Create a TweakLibraryType. 2. Reference that TweakLibraryType in
your code to use a Tweak. 3. Use the TweakWindow in your AppDelegate.
Make your TweakLibrary public struct ExampleTweaks: TweakLibraryType { public static
let colorTint = Tweak( "General", "Colors", "Tint", UIColor.blueColor()) public static let marginHorizontal = Tweak<CGFloat>( "General", "Layout", "H. Margins", defaultValue: 15, min: 0) public static let marginVertical = Tweak<CGFloat>( "General", "Layout", "V. Margins", defaultValue: 10, min: 0) public static let featureFlagMainScreenHelperText = Tweak( "Feature Flags", "Main Screen", "Show Body Text", true) public static let buttonAnimation = SpringAnimationTweakTemplate( "Animation", "Button Animation") ... }
Make your TweakLibrary public struct ExampleTweaks: TweakLibraryType { ... public
static let defaultStore: TweakStore = { let allTweaks: [TweakClusterType] = [colorTint, marginHorizontal, marginVertical, featureFlagMainScreenHelperText, buttonAnimation ] #if DEBUG let tweaksEnabled: Bool = true #else let tweaksEnabled: Bool = false #endif return TweakStore( tweaks: allTweaks, enabled: tweaksEnabled ) }() }
Using Your TweakLibrary // Assign button.tintColor = ExampleTweaks.assign(ExampleTweaks.colorTint) // Bind
ExampleTweaks.bind(ExampleTweaks.colorTint) { button.tintColor = $0 } // Bind multiple let tweaksToWatch: [TweakType] = [ ExampleTweaks.marginHorizontal, ExampleTweaks.marginVertical ] ExampleTweaks.bindMultiple(tweaksToWatch) { let horizontal = ExampleTweaks.assign(ExampleTweaks.marginHorizontal) let vertical = ExampleTweaks.assign(ExampleTweaks.marginVertical) scrollView.contentInset = UIEdgeInsets( top: vertical, right: horizontal, bottom: vertical, left: horizontal) }
Roadmaps Let's contribute! ✨ • "Backups" feature • Support String
as a TweakViewDataType • Add a "closure" Tweak Type • Design & Build tvOS UI • Design & Build iPad UI
☺☺☺
!" Happy Tweaking!! "!
Thank you❗"