iOSSwiftXcode

iOS Xcode Swift 4.2 Storyboard上にあるViewControllerをプログラムから呼び出し

1 Mins read

Mac 10.14.5
Xcode 10.2.1
Swift 4.2

Storyboard上にあるViewControllerをプログラムから呼び出し方法
サンプルはMain.storyboardを対象としているので、あらかじめ設定の
「General」「Deployment Info」「Main Interface」
をクリアしておくこと

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
 
    var window: UIWindow?   //Main Window
 
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
 
        window = UIWindow(frame: UIScreen.main.bounds)
        let storyboard = UIStoryboard(name: "Main", bundle: nil)
        let viewController = storyboard.instantiateInitialViewController()
        window?.rootViewController = viewController
        window?.makeKeyAndVisible()
 
        return true
    }
}
Related posts
iOSSwift

Xcode15.3 Error Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

1 Mins read

Xcode15.3 Error Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

Xcode15.3が出たので既存プロジェクトにて確認したらエラーが

Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

どうやら

Firebase 周りで落ちてる

Firebaseパッケージをアップデート

SDK Version10.11 でエラー

SDK Version10.22 で解消

SDK上げた部分による影響確認しないとだ

macOSXcode日記

【Xcode】プロジェクト環境に合わせたInstallコマンド

1 Mins read

覚書

#まずはbundle

bundle install --path vendor/bundle

#そしてプロジェクトのbundleを使う

bundle exec pod install
macOSRubyXcode日記

【Mac】rbenv openssl [BUILD FAILED] [make: *** [all] Error 2]

1 Mins read

古い環境が必要となり旧macへXcodeやRuby環境つくる時にハマったので覚書

20220315
■環境
macOS High Sierra 10.13.6
Homebrew 3.4.1-67-gb31d8e9
rbenv 1.2.0

こんなエラーが発生

Downloading openssl-1.1.1l.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
Installing openssl-1.1.1l...

BUILD FAILED (Mac OS X 10.13.6 using ruby-build 20220218)

Inspect or clean up the working tree at /var/folders/rc/9hwgt2nd0rxgjzvt9kc0zgph0000gn/T/ruby-build.20220315231102.889.ggie1q
Results logged to /var/folders/rc/9hwgt2nd0rxgjzvt9kc0zgph0000gn/T/ruby-build.20220315231102.889.log

Last 10 log lines:
/usr/include/CommonCrypto/CommonRandom.h:35:9: error: unknown type name 'CCCryptorStatus'
typedef CCCryptorStatus CCRNGStatus;
        ^
crypto/rand/rand_unix.c:385:47: error: use of undeclared identifier 'kCCSuccess'
    if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
                                              ^
2 errors generated.
make[1]: *** [crypto/rand/rand_unix.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2

そこでOpenSSL1.0が必要
以下のコマンドにて「rbenv/tap/openssl@1.0 1.0.2t」がインストールされる

#OpenSSL1.0をInstall
brew install rbenv/tap/openssl@1.0

#環境変数設定 [hogeはuserだよ]
echo 'export PATH="/usr/local/opt/openssl@1.0/bin:$PATH"' >> /Users/hoge/.bash_profile
#環境変数反映
source .bash_profile

#必要なら環境変数反映
export LDFLAGS="-L/usr/local/opt/openssl@1.0/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.0/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.0/lib/pkgconfig"

#これその後のコマンド用に必要!
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl@1.0`"

#好きなRubyインストール
rbenv install 2.6.9

macOSの場合はOpenSSLの影響が他にもある

OpenSSLはRailsなどに使用するmysql2ライブラリーにも影響あり、MySQL5.6 Or 5.7使用する際にも影響あるので注意!

bundle installする前に
[.bundle/config]ファイルへ
以下、設定が必要!

BUNDLE_BUILD__MYSQL2: "--with-ldflags=-L/usr/local/opt/openssl@1.0/lib --with-cppflags=-I/usr/local/opt/openssl@1.0/include"
チームを強化する

サービスの
サブスクリプションの利点を説明するテキストを追加します。